diff --git a/src-tauri/src/core/service.rs b/src-tauri/src/core/service.rs index b6f053d9e27c5a614aceeb64c69e64c3a75c35b4..ac26d8653b41a4f8ccb3890760b0888e23310b4f 100644 --- a/src-tauri/src/core/service.rs +++ b/src-tauri/src/core/service.rs @@ -182,9 +182,9 @@ impl Service { } pub fn check_start(&mut self) -> Result<()> { - let global = Data::global(); #[cfg(target_os = "windows")] { + let global = Data::global(); let verge = global.verge.lock(); let service_mode = verge.enable_service_mode.unwrap_or(false); diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index e8cdb61862f88033df333f46ddf9ec9129f471a1..0d0c04ff2c5c5eee1425ebc7f674cb30b98cbe08 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -190,7 +190,8 @@ fn main() -> std::io::Result<()> { }) .expect("error when exiting."); - app.run(|_, e| match e { + #[allow(unused)] + app.run(|app_handle, e| match e { tauri::RunEvent::ExitRequested { api, .. } => { api.prevent_exit(); }