Skip to content

Commit 7c4ed72

Browse files
committed
Apply clippy fixes
1 parent 55629ff commit 7c4ed72

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

crates/bitwarden-core/src/client/encryption_settings.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,7 @@ impl EncryptionSettings {
6666
// state to be missing, because they are *always* present when the user key is an
6767
// XChaCha20Poly1305Key. Thus, the server or network cannot lie about the presence of these,
6868
// because otherwise the entire user account will fail to decrypt.
69-
let is_v2_user = if let SymmetricCryptoKey::XChaCha20Poly1305Key(_) = user_key {
70-
true
71-
} else {
72-
false
73-
};
74-
69+
let is_v2_user = matches!(user_key, SymmetricCryptoKey::XChaCha20Poly1305Key(_));
7570
if is_v2_user {
7671
// For v2 users, we mandate the signing key and security state to be present
7772
// The private key must also be valid.

crates/bitwarden-crypto/src/security_state.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub fn sign<Ids: KeyIds>(
7272
ctx: &mut KeyStoreContext<Ids>,
7373
) -> Result<SignedSecurityState, CryptoError> {
7474
let signing_key = ctx.get_signing_key(signing_key_id)?;
75-
security_state.sign(&signing_key)
75+
security_state.sign(signing_key)
7676
}
7777

7878
impl SignedSecurityState {
@@ -81,9 +81,9 @@ impl SignedSecurityState {
8181
self,
8282
verifying_key: &VerifyingKey,
8383
) -> Result<SecurityState, CryptoError> {
84-
Ok(self
84+
self
8585
.0
86-
.verify_and_unwrap(verifying_key, &SigningNamespace::SecurityState)?)
86+
.verify_and_unwrap(verifying_key, &SigningNamespace::SecurityState)
8787
}
8888
}
8989

0 commit comments

Comments
 (0)