From 7466cfbfd3dd1e9b4f4d05208e3ed00d15429e64 Mon Sep 17 00:00:00 2001 From: Anders Steen Date: Sat, 15 Jun 2024 18:32:50 +0200 Subject: [PATCH] Fixing clippy warnings --- multimixer-128/src/lib.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/multimixer-128/src/lib.rs b/multimixer-128/src/lib.rs index 3ffbaead..9477ae57 100644 --- a/multimixer-128/src/lib.rs +++ b/multimixer-128/src/lib.rs @@ -69,7 +69,7 @@ impl MultimixerCore { for i in 0..4 { x[i] = u32::from_ne_bytes([ - message_block[0 + i * 4], + message_block[i * 4], message_block[1 + i * 4], message_block[2 + i * 4], message_block[3 + i * 4], @@ -105,9 +105,12 @@ impl MultimixerCore { p[3] as u64 * q[3] as u64, ]; - for i in 0..self.block_sums.len() { - self.block_sums[i] = self.block_sums[i].wrapping_add(block_res[i]); - } + self.block_sums + .iter_mut() + .zip(block_res.iter()) + .for_each(|(sum, &res)| { + *sum = sum.wrapping_add(res); + }); self.block_index += 1; }