From 9d7864b1a1f8b8766ba55d52583fb1fe5c0ce42f Mon Sep 17 00:00:00 2001 From: James Date: Fri, 13 Oct 2023 11:10:12 -0700 Subject: [PATCH] chore: clippy --- src/bits.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bits.rs b/src/bits.rs index 8cf01b9..d21b452 100644 --- a/src/bits.rs +++ b/src/bits.rs @@ -552,7 +552,7 @@ impl Shl for Uint { type Output = Self; #[inline(always)] - fn shl(self, rhs: Uint) -> Self::Output { + fn shl(self, rhs: Self) -> Self::Output { // This check shortcuts, and prevents panics on the `[0]` later if BITS == 0 { return self; @@ -560,6 +560,7 @@ impl Shl for Uint { // Rationale: if BITS is larger than 2**64 - 1, it means we're running // on a 128-bit platform with 2.3 exabytes of memory. In this case, // the code produces incorrect output. + #[allow(clippy::cast_possible_truncation)] self.wrapping_shl(rhs.as_limbs()[0] as usize) } } @@ -568,7 +569,7 @@ impl Shl<&Self> for Uint { type Output = Self; #[inline(always)] - fn shl(self, rhs: &Uint) -> Self::Output { + fn shl(self, rhs: &Self) -> Self::Output { self << *rhs } } @@ -577,7 +578,7 @@ impl Shr for Uint { type Output = Self; #[inline(always)] - fn shr(self, rhs: Uint) -> Self::Output { + fn shr(self, rhs: Self) -> Self::Output { // This check shortcuts, and prevents panics on the `[0]` later if BITS == 0 { return self; @@ -585,6 +586,7 @@ impl Shr for Uint { // Rationale: if BITS is larger than 2**64 - 1, it means we're running // on a 128-bit platform with 2.3 exabytes of memory. In this case, // the code produces incorrect output. + #[allow(clippy::cast_possible_truncation)] self.wrapping_shl(rhs.as_limbs()[0] as usize) } } @@ -593,7 +595,7 @@ impl Shr<&Self> for Uint { type Output = Self; #[inline(always)] - fn shr(self, rhs: &Uint) -> Self::Output { + fn shr(self, rhs: &Self) -> Self::Output { self >> *rhs } }