From 25e79bc7261d0a92b8459a47d4f8753f3139963c Mon Sep 17 00:00:00 2001 From: Yukino_fox Date: Sun, 22 Mar 2026 19:41:59 +0800 Subject: [PATCH] =?UTF-8?q?refactor(database):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E4=B8=8D=E5=BF=85=E8=A6=81=E7=9A=84state=5Fguard=E9=87=8A?= =?UTF-8?q?=E6=94=BE=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除db_switch_connection函数中多余的drop(state_guard)调用,因为Rust的RAII机制会自动处理资源释放 --- src-tauri/src/commands/database.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src-tauri/src/commands/database.rs b/src-tauri/src/commands/database.rs index c6f3ce1..90270fa 100644 --- a/src-tauri/src/commands/database.rs +++ b/src-tauri/src/commands/database.rs @@ -1169,7 +1169,6 @@ pub async fn db_switch_connection( conn, ) }; - drop(state_guard); { let settings_db_path = sqlite_db_path(&app_handle)?;