From 359e5124bd2c4fd25210ad93eddf9817b4bf4ddd Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Sat, 17 Feb 2024 00:00:57 +0100 Subject: [PATCH] some clippy improvements --- src/util.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/util.rs b/src/util.rs index e0ed3b7..17a99de 100644 --- a/src/util.rs +++ b/src/util.rs @@ -541,9 +541,9 @@ pub mod tests { u8.write_to_be_bytes(&mut buf) .expect("writing to raw buffer failed"); assert_eq!(buf[0], 5); - for i in 1..8 { + (1..8).for_each(|i| { assert_eq!(buf[i], 0); - } + }); } #[test] @@ -569,9 +569,9 @@ pub mod tests { .expect("writing to raw buffer failed"); let raw_val = u32::from_be_bytes(buf[0..4].try_into().unwrap()); assert_eq!(raw_val, 80932); - for i in 4..8 { + (4..8).for_each(|i| { assert_eq!(buf[i], 0); - } + }); } #[test]