Use is_multiple_of in hex decoder (clippy)
Some checks failed
CI / backend (push) Has been cancelled
CI / frontend (push) Has been cancelled
CI / ui (push) Has been cancelled

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Dennis Nemec
2026-09-02 22:17:15 +02:00
parent 4de6d0a872
commit b6c3ddf040

View File

@ -21,7 +21,7 @@ impl AesGcmCipher {
}
fn hex_decode(s: &str) -> anyhow::Result<Vec<u8>> {
anyhow::ensure!(s.len() % 2 == 0, "odd hex length");
anyhow::ensure!(s.len().is_multiple_of(2), "odd hex length");
(0..s.len())
.step_by(2)
.map(|i| Ok(u8::from_str_radix(&s[i..i + 2], 16)?))