Skip to content

Commit

Permalink
revert to non-wrapping lower_n_bits
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Coats committed Oct 12, 2023
1 parent b1d064c commit ae8c131
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sdk/src/types/block/mana/structure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ const fn upper_bits(v: u64) -> u64 {
/// Returns the lower n bits of a u64 value.
const fn lower_n_bits(v: u64, n: u8) -> u64 {
debug_assert!(n <= 64);
v & ((1 << n) - 1)
v & u64::MAX >> (64 - n)
}

/// Returns the lower 32 bits of a u64 value.
Expand Down

0 comments on commit ae8c131

Please sign in to comment.