Cargo clippy

This commit is contained in:
ChristianVisintin
2021-01-16 18:02:12 +01:00
parent ac02928e69
commit 23ca2baa8c
8 changed files with 29 additions and 38 deletions

View File

@@ -97,7 +97,7 @@ impl KeyStorage for FileStorage {
{
Ok(mut file) => {
// Write key to file
if let Err(_) = file.write_all(key.as_bytes()) {
if file.write_all(key.as_bytes()).is_err() {
return Err(KeyStorageError::ProviderError);
}
// Set file to readonly

View File

@@ -89,14 +89,7 @@ impl KeyStorage for KeyringStorage {
// Check what kind of error is returned
match storage.get_password() {
Ok(_) => true,
Err(err) => match err {
KeyringError::NoBackendFound => false,
//#[cfg(target_os = "macos")]
//KeyringError::MacOsKeychainError(_) => false,
//#[cfg(target_os = "windows")]
//KeyringError::WindowsVaultError => false,
_ => true,
},
Err(err) => !matches!(err, KeyringError::NoBackendFound),
}
}
}