Skip to content

Commit

Permalink
Uint: Fix clippy warnings (#707)
Browse files Browse the repository at this point in the history
- In the uint crate
- When using the uint crate
  • Loading branch information
DragonDev1906 authored Feb 1, 2023
1 parent 0eb011b commit 223af1d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions uint/src/uint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl From<FromHexError> for FromStrRadixErr {
}

/// Conversion from decimal string error
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Eq)]
pub enum FromDecStrErr {
/// Char not from range 0-9
InvalidCharacter,
Expand Down Expand Up @@ -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
Expand All @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 223af1d

Please sign in to comment.