fix: add missing read_only field and resolve clippy warnings

This commit is contained in:
t8y2
2026-06-10 12:55:39 +08:00
parent e0269a07cc
commit 1545224d34
3 changed files with 10 additions and 7 deletions
+1
View File
@@ -195,6 +195,7 @@ mod tests {
jdbc_driver_class: None,
jdbc_driver_paths: Vec::new(),
one_time: false,
read_only: false,
}
}
+6 -4
View File
@@ -5,7 +5,7 @@ pub async fn read_keychain_password(service: String, account: Option<String>) ->
#[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<String>) ->
} 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()))
+3 -3
View File
@@ -61,14 +61,14 @@ fn open_connection_deep_links(app: &tauri::AppHandle, links: Vec<String>) {
#[cfg_attr(not(any(target_os = "macos", target_os = "windows")), allow(dead_code))]
fn setup_desktop_tray<R: tauri::Runtime, M: Manager<R>>(
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::<R>::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<R: tauri::Runtime, M: Manager<R>>(
}
#[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),
};