fix: replace unstable is_multiple_of with modulo operator (fixes #42)

This commit is contained in:
argenis de la rosa 2026-02-14 16:39:24 -05:00
parent 09d3140127
commit fc033783b5

View file

@ -241,7 +241,7 @@ fn hex_encode(data: &[u8]) -> String {
/// Hex-decode a hex string to bytes.
fn hex_decode(hex: &str) -> Result<Vec<u8>> {
if !hex.len().is_multiple_of(2) {
if hex.len() % 2 != 0 {
anyhow::bail!("Hex string has odd length");
}
(0..hex.len())