@@ -4,17 +4,17 @@ use tauri::{
44 AppHandle , Runtime ,
55} ;
66
7- use crate :: models:: * ;
7+ use crate :: models:: { ActionType , ActiveNotification , PendingNotification } ;
88
99use std:: { collections:: HashMap , sync:: Arc } ;
1010
1111pub use ffi:: NotificationPlugin ;
1212
1313/// Validation checks for macOS notifications functionality.
1414///
15- /// UserNotifications requires the app to run from a signed .app bundle.
15+ /// ` UserNotifications` requires the app to run from a signed .app bundle.
1616/// During development with `tauri dev`, the binary runs
17- /// directly without a bundle, causing UserNotifications calls to fail silently or crash.
17+ /// directly without a bundle, causing ` UserNotifications` calls to fail silently or crash.
1818mod validation {
1919 /// Ensures the app is running from a .app bundle.
2020 pub fn require_bundle ( ) -> crate :: Result < ( ) > {
@@ -141,6 +141,8 @@ impl ParseFfiVoidResponse for Result<i32, ffi::FFIResult> {
141141}
142142
143143/// Called by Swift via FFI when transaction updates occur.
144+ // Owned strings come straight from the Swift bridge.
145+ #[ allow( clippy:: needless_pass_by_value) ]
144146fn bridge_trigger ( event : String , payload : String ) -> Result < ( ) , ffi:: FFIResult > {
145147 crate :: listeners:: trigger ( & event, payload)
146148 . map_err ( |e| ffi:: FFIResult :: Err ( format ! ( "Failed to trigger event '{event}': {e}" ) ) )
@@ -165,7 +167,7 @@ impl<R: Runtime> crate::NotificationsBuilder<R> {
165167 self . plugin
166168 . show (
167169 serde_json:: to_string ( & self . data )
168- . map_err ( |e| crate :: error:: PluginInvokeError :: CannotSerializePayload ( e ) ) ?,
170+ . map_err ( crate :: error:: PluginInvokeError :: CannotSerializePayload ) ?,
169171 )
170172 . await
171173 . parse_void ( )
@@ -236,7 +238,7 @@ impl<R: Runtime> Notifications<R> {
236238 self . plugin
237239 . registerActionTypes (
238240 serde_json:: to_string ( & args)
239- . map_err ( |e| crate :: error:: PluginInvokeError :: CannotSerializePayload ( e ) ) ?,
241+ . map_err ( crate :: error:: PluginInvokeError :: CannotSerializePayload ) ?,
240242 )
241243 . parse_void ( )
242244 }
@@ -259,7 +261,7 @@ impl<R: Runtime> Notifications<R> {
259261 self . plugin
260262 . removeActive (
261263 serde_json:: to_string ( & args)
262- . map_err ( |e| crate :: error:: PluginInvokeError :: CannotSerializePayload ( e ) ) ?,
264+ . map_err ( crate :: error:: PluginInvokeError :: CannotSerializePayload ) ?,
263265 )
264266 . parse_void ( )
265267 }
@@ -291,7 +293,7 @@ impl<R: Runtime> Notifications<R> {
291293 self . plugin
292294 . cancel (
293295 serde_json:: to_string ( & args)
294- . map_err ( |e| crate :: error:: PluginInvokeError :: CannotSerializePayload ( e ) ) ?,
296+ . map_err ( crate :: error:: PluginInvokeError :: CannotSerializePayload ) ?,
295297 )
296298 . parse_void ( )
297299 }
@@ -313,7 +315,7 @@ impl<R: Runtime> Notifications<R> {
313315 self . plugin
314316 . setClickListenerActive (
315317 serde_json:: to_string ( & args)
316- . map_err ( |e| crate :: error:: PluginInvokeError :: CannotSerializePayload ( e ) ) ?,
318+ . map_err ( crate :: error:: PluginInvokeError :: CannotSerializePayload ) ?,
317319 )
318320 . parse_void ( )
319321 }
0 commit comments