Fix lint error: passing a unit value to a function
What changed, and why it matters
This is a minor code cleanup in a benchmark file. A Rust linting tool (Clippy) complained that the benchmark was passing a meaningless empty value to a function. The developer changed the code to silence the lint. It does not affect real users, security behavior, or runtime code.
No action needed; this is a non-security benchmark lint fix.
Security signals we found
No strong security signals were identified.
Evidence from the diff
In benches/chacha20_poly1305/chacha20poly1305.rs, the benchmark previously called black_box(res.unwrap()), which Clippy flagged because res.unwrap() returns the unit type () when decrypt succeeds, and passing () to black_box is considered passing a unit value to a function. The patch splits it into res.unwrap(); black_box(()); to satisfy the lint. This is purely a benchmark-file lint fix with no functional change to the ChaCha20Poly1305 implementation or its public API.
Changed components
benches/chacha20_poly1305/chacha20poly1305.rsInspect captured patch +2 / −1
diff --git a/benches/chacha20_poly1305/chacha20poly1305.rs b/benches/chacha20_poly1305/chacha20poly1305.rs
index cc87e4c6..7719734b 100644
--- a/benches/chacha20_poly1305/chacha20poly1305.rs
+++ b/benches/chacha20_poly1305/chacha20poly1305.rs
@@ -46,7 +46,8 @@ fn bench_chacha20poly1305(c: &mut Criterion) {
let mut buf = ct.clone();
let cipher = ChaCha20Poly1305::new(key, nonce);
let res = cipher.decrypt(black_box(&mut buf), tag, Some(aad));
- black_box(res.unwrap());
+ res.unwrap();
+ black_box(());
});
});
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.