From abb0df59df218eb3f5c166f02559cec17bcb1616 Mon Sep 17 00:00:00 2001 From: Tunglies <77394545+Tunglies@users.noreply.github.com> Date: Mon, 6 Oct 2025 18:26:01 +0800 Subject: [PATCH] refactor: simplify auto proxy disabling logic in clean_async function --- src-tauri/src/feat/window.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src-tauri/src/feat/window.rs b/src-tauri/src/feat/window.rs index 8b48fdc0..b8c5fb0a 100644 --- a/src-tauri/src/feat/window.rs +++ b/src-tauri/src/feat/window.rs @@ -130,12 +130,9 @@ async fn clean_async() -> bool { } // 关闭自动代理配置 - match Autoproxy::get_auto_proxy() { - Ok(mut autoproxy) => { - autoproxy.enable = false; - let _ = autoproxy.set_auto_proxy(); - } - Err(_) => {} + if let Ok(mut autoproxy) = Autoproxy::get_auto_proxy() { + autoproxy.enable = false; + let _ = autoproxy.set_auto_proxy(); } return true;