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)?))