diff --git a/crates/primitives/src/signed/int.rs b/crates/primitives/src/signed/int.rs index 39fd4bc5b3..b09c047a3f 100644 --- a/crates/primitives/src/signed/int.rs +++ b/crates/primitives/src/signed/int.rs @@ -104,7 +104,7 @@ impl fmt::UpperHex for Signed Signed { /// Mask for the highest limb. - pub(crate) const MASK: u64 = mask(BITS); + pub(crate) const MASK: u64 = ruint::mask(BITS); /// Location of the sign bit within the highest limb. pub(crate) const SIGN_BIT: u64 = sign_bit(BITS); diff --git a/crates/primitives/src/signed/utils.rs b/crates/primitives/src/signed/utils.rs index e8ab1d3ce8..4da4bc3965 100644 --- a/crates/primitives/src/signed/utils.rs +++ b/crates/primitives/src/signed/utils.rs @@ -93,17 +93,3 @@ pub(super) const fn sign_bit(bits: usize) -> u64 { 1 << (bits - 1) } } - -/// Mask to apply to the highest limb to get the correct number of bits. -#[must_use] -pub(super) const fn mask(bits: usize) -> u64 { - if bits == 0 { - return 0; - } - let bits = bits % 64; - if bits == 0 { - u64::MAX - } else { - (1 << bits) - 1 - } -}