mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-23 04:55:21 +00:00
fix: add missing read_only field and resolve clippy warnings
This commit is contained in:
@@ -195,6 +195,7 @@ mod tests {
|
||||
jdbc_driver_class: None,
|
||||
jdbc_driver_paths: Vec::new(),
|
||||
one_time: false,
|
||||
read_only: false,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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()))
|
||||
|
||||
@@ -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),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user