From 1545224d343be81f55804c0cee4391a049cefe99 Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Wed, 10 Jun 2026 12:55:39 +0800 Subject: [PATCH] fix: add missing read_only field and resolve clippy warnings --- src-tauri/src/commands/connection.rs | 1 + src-tauri/src/commands/keychain.rs | 10 ++++++---- src-tauri/src/lib.rs | 6 +++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src-tauri/src/commands/connection.rs b/src-tauri/src/commands/connection.rs index 378951578c..4467102da4 100644 --- a/src-tauri/src/commands/connection.rs +++ b/src-tauri/src/commands/connection.rs @@ -195,6 +195,7 @@ mod tests { jdbc_driver_class: None, jdbc_driver_paths: Vec::new(), one_time: false, + read_only: false, } } diff --git a/src-tauri/src/commands/keychain.rs b/src-tauri/src/commands/keychain.rs index 020a311fb0..57a9baed06 100644 --- a/src-tauri/src/commands/keychain.rs +++ b/src-tauri/src/commands/keychain.rs @@ -5,7 +5,7 @@ pub async fn read_keychain_password(service: String, account: Option) -> #[cfg(not(target_os = "macos"))] { let _ = (service, account); - return Err("Keychain access is only available on macOS".to_string()); + Err("Keychain access is only available on macOS".to_string()) } #[cfg(target_os = "macos")] @@ -32,9 +32,11 @@ fn read_keychain_password_blocking(service: String, account: Option) -> } else { // Exit code 44 = user cancelled the authorization dialog let stderr = String::from_utf8_lossy(&output.stderr).to_string(); - if output.status.code() == Some(44) || stderr.contains("User canceled") { - Ok(String::new()) - } else if stderr.contains("could not be found") || stderr.contains("The specified item could not be found") { + if output.status.code() == Some(44) + || stderr.contains("User canceled") + || stderr.contains("could not be found") + || stderr.contains("The specified item could not be found") + { Ok(String::new()) } else { Err(format!("Keychain read failed: {}", stderr.trim())) diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 3f29267801..e09012ff8b 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -61,14 +61,14 @@ fn open_connection_deep_links(app: &tauri::AppHandle, links: Vec) { #[cfg_attr(not(any(target_os = "macos", target_os = "windows")), allow(dead_code))] fn setup_desktop_tray>( manager: &M, - icon_theme: DesktopIconTheme, + _icon_theme: DesktopIconTheme, ) -> tauri::Result<()> { let menu = MenuBuilder::new(manager).text("show", "Show DBX").separator().text("quit", "Quit DBX").build()?; let mut tray = TrayIconBuilder::::with_id(DESKTOP_TRAY_ID).tooltip("DBX").menu(&menu).show_menu_on_left_click(false); #[cfg(target_os = "macos")] { - match icon_theme { + match _icon_theme { DesktopIconTheme::Default => { tray = tray.icon(MACOS_TRAY_ICON).icon_as_template(true); } @@ -79,7 +79,7 @@ fn setup_desktop_tray>( } #[cfg(target_os = "windows")] { - let icon = match icon_theme { + let icon = match _icon_theme { DesktopIconTheme::Default => manager.app_handle().default_window_icon().cloned(), DesktopIconTheme::Black => Some(BLACK_APP_ICON), };