From 526c5bdd91e67a1c036cc2da098dbf895164bc67 Mon Sep 17 00:00:00 2001 From: huzibaca Date: Sun, 27 Oct 2024 10:19:42 +0800 Subject: [PATCH] fix: unused variable --- src-tauri/src/core/tray.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src-tauri/src/core/tray.rs b/src-tauri/src/core/tray.rs index 4d1e5d7..9c92ca6 100644 --- a/src-tauri/src/core/tray.rs +++ b/src-tauri/src/core/tray.rs @@ -97,6 +97,7 @@ impl Tray { *tun_mode, )?)); + #[cfg(target_os = "macos")] let mut use_custom_icon = false; #[allow(unused)] let mut indication_icon = if *system_proxy { @@ -120,7 +121,10 @@ impl Tray { } else if png_path.exists() { icon = std::fs::read(png_path).unwrap(); } - use_custom_icon = true; + #[cfg(target_os = "macos")] + { + use_custom_icon = true; + } } icon } else if *tun_mode { @@ -144,7 +148,10 @@ impl Tray { } else if png_path.exists() { icon = std::fs::read(png_path).unwrap(); } - use_custom_icon = true; + #[cfg(target_os = "macos")] + { + use_custom_icon = true; + } } icon } else { @@ -168,7 +175,10 @@ impl Tray { } else if png_path.exists() { icon = std::fs::read(png_path).unwrap(); } - use_custom_icon = true; + #[cfg(target_os = "macos")] + { + use_custom_icon = true; + } } icon };