diff --git a/lib/v3/CHANGELOG.md b/lib/v3/CHANGELOG.md index 39832f3..91311f5 100644 --- a/lib/v3/CHANGELOG.md +++ b/lib/v3/CHANGELOG.md @@ -4,6 +4,7 @@ ### Patch +- Use `iter().enumerate()` when possible - Encode by the greatest multiple of blocks that fits 128 bits - Use `doc_cfg` instead of `doc_auto_cfg` diff --git a/lib/v3/src/lib.rs b/lib/v3/src/lib.rs index d876786..ea2117f 100644 --- a/lib/v3/src/lib.rs +++ b/lib/v3/src/lib.rs @@ -344,8 +344,8 @@ fn decode_block( let bit = Bit::VAL; let msb = Msb::VAL; let mut x = 0u64; - for j in 0 .. input.len() { - let y = values[input[j] as usize]; + for (j, input) in input.iter().enumerate() { + let y = values[*input as usize]; check!(j, y < 1 << bit); x |= u64::from(y) << (bit * order(msb, dec(bit), j)); }