From c8dc14fd8c6b82584d94e3a2cc802dd9c23e4510 Mon Sep 17 00:00:00 2001 From: Aumetra Weisman Date: Mon, 3 Jun 2024 15:12:16 +0200 Subject: [PATCH] Fix linter warnings --- src/util/simd/v128.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/util/simd/v128.rs b/src/util/simd/v128.rs index 3fa1ae5..3070371 100644 --- a/src/util/simd/v128.rs +++ b/src/util/simd/v128.rs @@ -34,8 +34,8 @@ impl Simd for Simd128i { fn eq(&self, rhs: &Self) -> Self::Mask { let mut mask = [0u8; 16]; - for i in 0..Self::LANES { - mask[i] = if self.0[i] == rhs.0[i] { 1 } else { 0 }; + for (i, item) in mask.iter_mut().enumerate() { + *item = if self.0[i] == rhs.0[i] { 1 } else { 0 }; } Mask128(mask) } @@ -46,16 +46,16 @@ impl Simd for Simd128i { fn le(&self, rhs: &Self) -> Self::Mask { let mut mask = [0u8; 16]; - for i in 0..Self::LANES { - mask[i] = if self.0[i] <= rhs.0[i] { 1 } else { 0 }; + for (i, item) in mask.iter_mut().enumerate() { + *item = if self.0[i] <= rhs.0[i] { 1 } else { 0 }; } Mask128(mask) } fn gt(&self, rhs: &Self) -> Self::Mask { let mut mask = [0u8; 16]; - for i in 0..Self::LANES { - mask[i] = if self.0[i] > rhs.0[i] { 1 } else { 0 }; + for (i, item) in mask.iter_mut().enumerate() { + *item = if self.0[i] > rhs.0[i] { 1 } else { 0 }; } Mask128(mask) } @@ -81,8 +81,8 @@ impl Simd for Simd128u { fn eq(&self, rhs: &Self) -> Self::Mask { let mut mask = [0u8; 16]; - for i in 0..Self::LANES { - mask[i] = if self.0[i] == rhs.0[i] { 1 } else { 0 }; + for (i, item) in mask.iter_mut().enumerate() { + *item = if self.0[i] == rhs.0[i] { 1 } else { 0 }; } Mask128(mask) } @@ -93,16 +93,16 @@ impl Simd for Simd128u { fn le(&self, rhs: &Self) -> Self::Mask { let mut mask = [0u8; 16]; - for i in 0..Self::LANES { - mask[i] = if self.0[i] <= rhs.0[i] { 1 } else { 0 }; + for (i, item) in mask.iter_mut().enumerate() { + *item = if self.0[i] <= rhs.0[i] { 1 } else { 0 }; } Mask128(mask) } fn gt(&self, rhs: &Self) -> Self::Mask { let mut mask = [0u8; 16]; - for i in 0..Self::LANES { - mask[i] = if self.0[i] > rhs.0[i] { 1 } else { 0 }; + for (i, item) in mask.iter_mut().enumerate() { + *item = if self.0[i] > rhs.0[i] { 1 } else { 0 }; } Mask128(mask) } @@ -139,8 +139,8 @@ impl BitAnd for Mask128 { fn bitand(self, rhs: Self) -> Self::Output { let mut result = [0u8; 16]; - for i in 0..16 { - result[i] = self.0[i] & rhs.0[i]; + for (i, item) in result.iter_mut().enumerate() { + *item = self.0[i] & rhs.0[i]; } Mask128(result) } @@ -151,8 +151,8 @@ impl BitOr for Mask128 { fn bitor(self, rhs: Self) -> Self::Output { let mut result = [0u8; 16]; - for i in 0..16 { - result[i] = self.0[i] | rhs.0[i]; + for (i, item) in result.iter_mut().enumerate() { + *item = self.0[i] | rhs.0[i]; } Mask128(result) }