Skip to content

armgit / Pake

Public Imported from GitHub
0

Turn any website into a lightweight desktop app with one command, on macOS, Windows and Linux.

style: clear clippy lints in macos menu and tray handlers

Tw930f8a68c81719
diff --git a/src-tauri/src/app/menu.rs b/src-tauri/src/app/menu.rs
index e9537bbc..db59b9e3 100644
--- a/src-tauri/src/app/menu.rs
+++ b/src-tauri/src/app/menu.rs
@@ -1,6 +1,4 @@
-// Menu functionality is only used on macOS
-#![cfg(target_os = "macos")]
-
+// Menu functionality is only used on macOS; the module is gated in app/mod.rs.
use crate::app::window::open_additional_window_safe;
use tauri::menu::{AboutMetadata, Menu, MenuItem, PredefinedMenuItem, Submenu};
use tauri::{AppHandle, Manager, Wry};
@@ -308,7 +306,7 @@ pub fn handle_menu_click(app_handle: &AppHandle, id: &str) {
}
"clear_cache_restart" => {
if let Some(window) = app_handle.get_webview_window("pake") {
- if let Ok(_) = window.clear_all_browsing_data() {
+ if window.clear_all_browsing_data().is_ok() {
app_handle.restart();
}
}
diff --git a/src-tauri/src/app/setup.rs b/src-tauri/src/app/setup.rs
index 87f27bb8..b94ff571 100644
--- a/src-tauri/src/app/setup.rs
+++ b/src-tauri/src/app/setup.rs
@@ -66,8 +66,8 @@ pub fn set_system_tray(
}
_ => (),
})
- .on_tray_icon_event(move |tray, event| match event {
- TrayIconEvent::Click { button, .. } => {
+ .on_tray_icon_event(move |tray, event| {
+ if let TrayIconEvent::Click { button, .. } = event {
if button == tauri::tray::MouseButton::Left {
if let Some(window) = tray.app_handle().get_webview_window("pake") {
let is_visible = window.is_visible().unwrap_or(false);
@@ -84,7 +84,6 @@ pub fn set_system_tray(
}
}
}
- _ => {}
});
let resolved_icon = if tray_icon_path.is_empty() {