fix: add missing read_only field and resolve clippy warnings
This commit is contained in:
1 parent
e0269a07cc
commit
1545224d34
3 files changed
+10
-7
No files matched your search
@@ -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()))
|
||||
|
||||
Reference in new issue
Block a user