From 055800219d838b9ae11a93f64de47db779b92763 Mon Sep 17 00:00:00 2001 From: szymon Date: Wed, 30 Sep 2026 19:07:31 +0200 Subject: [PATCH] fix: clippy fixes --- src/functions.rs | 6 +++--- src/notification.rs | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/functions.rs b/src/functions.rs index 318c0fe..12bf781 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -16,7 +16,7 @@ where { let app_name = app_name .into() - .map(|app_name| std::ffi::CString::new(app_name)) + .map(std::ffi::CString::new) .transpose()?; if unsafe { @@ -56,7 +56,7 @@ pub fn get_app_name() -> Option { let app_name_c: *const std::os::raw::c_char = unsafe { notify_get_app_name() }; if app_name_c.is_null() { - return None; + None } else { Some( unsafe { std::ffi::CStr::from_ptr(app_name_c) } @@ -72,7 +72,7 @@ pub fn get_app_icon() -> Option { let app_icon_c: *const std::os::raw::c_char = unsafe { notify_get_app_icon() }; if app_icon_c.is_null() { - return None; + None } else { Some( unsafe { std::ffi::CStr::from_ptr(app_icon_c) } diff --git a/src/notification.rs b/src/notification.rs index abee4f9..f53717b 100644 --- a/src/notification.rs +++ b/src/notification.rs @@ -56,12 +56,12 @@ impl<'a> Notification { let body = body .into() - .map(|body| std::ffi::CString::new(body)) + .map(std::ffi::CString::new) .transpose()?; let icon = icon .into() - .map(|icon| std::ffi::CString::new(icon)) + .map(std::ffi::CString::new) .transpose()?; let inner = unsafe { @@ -232,7 +232,7 @@ impl<'a> Notification { /// Note that the timeout may be ignored by the server. pub fn set_timeout(&mut self, timeout: Timeout) { let timeout_c = match timeout { - Timeout::Default => NOTIFY_EXPIRES_DEFAULT as i32, + Timeout::Default => NOTIFY_EXPIRES_DEFAULT, Timeout::Never => NOTIFY_EXPIRES_NEVER as i32, Timeout::Custom(i) => i, }; @@ -295,12 +295,12 @@ impl<'a> Notification { let body = body .into() - .map(|body| std::ffi::CString::new(body)) + .map(std::ffi::CString::new) .transpose()?; let icon = icon .into() - .map(|icon| std::ffi::CString::new(icon)) + .map(std::ffi::CString::new) .transpose()?; unsafe {