From b6c3ddf040f86e970b92519d814ca67f63734cb8 Mon Sep 17 00:00:00 2001 From: Dennis Nemec Date: Wed, 2 Sep 2026 22:17:15 +0200 Subject: [PATCH] Use is_multiple_of in hex decoder (clippy) Co-Authored-By: Claude Fable 5.1 --- backend/crates/infrastructure/src/cipher.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/crates/infrastructure/src/cipher.rs b/backend/crates/infrastructure/src/cipher.rs index 91ebde5..addc7f7 100644 --- a/backend/crates/infrastructure/src/cipher.rs +++ b/backend/crates/infrastructure/src/cipher.rs @@ -21,7 +21,7 @@ impl AesGcmCipher { } fn hex_decode(s: &str) -> anyhow::Result> { - 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)?))