From 223af1dc6c176e35698aed9285f44e428da0050e Mon Sep 17 00:00:00 2001 From: Jens W <8270201+DragonDev1906@users.noreply.github.com> Date: Wed, 1 Feb 2023 20:40:35 +0100 Subject: [PATCH] Uint: Fix clippy warnings (#707) - In the uint crate - When using the uint crate --- uint/src/uint.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/uint/src/uint.rs b/uint/src/uint.rs index 2366543f4..2914f7223 100644 --- a/uint/src/uint.rs +++ b/uint/src/uint.rs @@ -128,7 +128,7 @@ impl From for FromStrRadixErr { } /// Conversion from decimal string error -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub enum FromDecStrErr { /// Char not from range 0-9 InvalidCharacter, @@ -1001,13 +1001,13 @@ macro_rules! construct_uint { while n > u_one { if is_even(&n) { x = x * x; - n = n >> 1usize; + n >>= 1usize; } else { y = x * y; x = x * x; // to reduce odd number by 1 we should just clear the last bit - n.0[$n_words-1] = n.0[$n_words-1] & ((!0u64)>>1); - n = n >> 1usize; + n.0[$n_words-1] &= (!0u64)>>1; + n >>= 1usize; } } x * y @@ -1028,7 +1028,7 @@ macro_rules! construct_uint { while n > u_one { if is_even(&n) { x = $crate::overflowing!(x.overflowing_mul(x), overflow); - n = n >> 1usize; + n >>= 1usize; } else { y = $crate::overflowing!(x.overflowing_mul(y), overflow); x = $crate::overflowing!(x.overflowing_mul(x), overflow); @@ -1678,7 +1678,7 @@ macro_rules! construct_uint { loop { let digit = (current % ten).low_u64() as u8; buf[i] = digit + b'0'; - current = current / ten; + current /= ten; if current.is_zero() { break; }