fix: clippy warnings

This commit is contained in:
2025-12-18 18:42:50 +02:00
parent 9869036bdf
commit 0687fe0431
5 changed files with 43 additions and 39 deletions

View File

@@ -519,7 +519,8 @@ fn encrypt_decrypt_roundtrip(
let ciphertext = aes
.encrypt(&plaintext.to_be_bytes())
.expect("Encryption failed");
let ciphertext_u128 = u128::from_be_bytes(ciphertext.as_slice().try_into().unwrap());
let ciphertext_u128 =
u128::from_be_bytes(ciphertext.as_slice().try_into().expect("ciphertext"));
assert_eq!(
ciphertext_u128, expected_ciphertext,
@@ -528,7 +529,12 @@ fn encrypt_decrypt_roundtrip(
// Decrypt
let decrypted = aes.decrypt(&ciphertext).expect("Decryption failed");
let decrypted_u128 = u128::from_be_bytes(decrypted.as_slice().try_into().unwrap());
let decrypted_u128 = u128::from_be_bytes(
decrypted
.as_slice()
.try_into()
.expect("decrypted plaintext"),
);
assert_eq!(
decrypted_u128, plaintext,