chore(core): clean up Plan 1A clippy warnings

Auto-deref at &Zeroizing<[u8;32]> call sites, range pattern in generators,
useless String::into conversions in tests, unused Zeroizing import.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
adlee-was-taken
2026-04-19 15:55:32 -04:00
parent 3cf09faf1e
commit 49b78203f8
7 changed files with 14 additions and 15 deletions

View File

@@ -20,7 +20,7 @@ fn version_byte_is_2() {
fn fresh_ciphertext_starts_with_0x02() {
let key = Zeroizing::new([0u8; 32]);
// encrypt(key: &[u8; 32], plaintext: &[u8])
let ct = encrypt(&*key, b"hello").unwrap();
let ct = encrypt(&key, b"hello").unwrap();
assert_eq!(ct[0], 0x02);
}
@@ -31,7 +31,7 @@ fn v1_blob_is_rejected_with_unsupported_format_version() {
blob.extend_from_slice(&[0u8; 24 + 16]);
let key = Zeroizing::new([0u8; 32]);
// decrypt(key: &[u8; 32], data: &[u8])
let err = decrypt(&*key, &blob);
let err = decrypt(&key, &blob);
match err {
Err(IdfotoError::UnsupportedFormatVersion { found, expected }) => {
assert_eq!(found, 0x01);