From c7621aa019023c56d8bdaa2103a437c65ec899f3 Mon Sep 17 00:00:00 2001 From: Lucas Nogueira Date: Thu, 6 Jan 2022 10:39:21 -0300 Subject: [PATCH] chore: fix some clippy warnings --- core/tauri-runtime-wry/src/lib.rs | 2 -- core/tauri/src/endpoints/global_shortcut.rs | 2 +- core/tauri/src/manager.rs | 2 +- core/tauri/src/updater/core.rs | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/core/tauri-runtime-wry/src/lib.rs b/core/tauri-runtime-wry/src/lib.rs index 85031e426..0a9205f54 100644 --- a/core/tauri-runtime-wry/src/lib.rs +++ b/core/tauri-runtime-wry/src/lib.rs @@ -2875,8 +2875,6 @@ fn handle_gl_loop( windows, window_event_listeners, menu_event_listeners, - #[cfg(feature = "system-tray")] - tray_context, .. } = context; let egui_id = EGUI_ID.lock().unwrap(); diff --git a/core/tauri/src/endpoints/global_shortcut.rs b/core/tauri/src/endpoints/global_shortcut.rs index c749458c7..ec315673a 100644 --- a/core/tauri/src/endpoints/global_shortcut.rs +++ b/core/tauri/src/endpoints/global_shortcut.rs @@ -37,7 +37,7 @@ fn register_shortcut( ) -> crate::Result<()> { let accelerator = shortcut.clone(); manager.register(&shortcut, move || { - let callback_string = crate::api::rpc::format_callback(handler.to_string(), &accelerator) + let callback_string = crate::api::rpc::format_callback(&handler, &accelerator) .expect("unable to serialize shortcut string to json"); let _ = window.eval(callback_string.as_str()); })?; diff --git a/core/tauri/src/manager.rs b/core/tauri/src/manager.rs index 37a636bad..770bf7310 100644 --- a/core/tauri/src/manager.rs +++ b/core/tauri/src/manager.rs @@ -320,7 +320,7 @@ impl WindowManager { ) }; pending.register_uri_scheme_protocol("asset", move |request| { - let parsed_path = Url::parse(&request.uri())?; + let parsed_path = Url::parse(request.uri())?; let filtered_path = &parsed_path[..Position::AfterPath]; #[cfg(target_os = "windows")] let path = filtered_path.replace("asset://localhost/", ""); diff --git a/core/tauri/src/updater/core.rs b/core/tauri/src/updater/core.rs index 84b20b496..7ce5e9243 100644 --- a/core/tauri/src/updater/core.rs +++ b/core/tauri/src/updater/core.rs @@ -781,7 +781,7 @@ fn default_archive_name_by_os() -> String { // Convert base64 to string and prevent failing fn base64_to_string(base64_string: &str) -> Result { - let decoded_string = &decode(base64_string.to_owned())?; + let decoded_string = &decode(base64_string)?; let result = from_utf8(decoded_string)?.to_string(); Ok(result) }