Skip to content

Commit

Permalink
Use Self::BITS in log2 implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
nvzqz committed Mar 12, 2022
1 parent 1d13de6 commit 6b5acf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/core/src/num/nonzero.rs
Expand Up @@ -465,7 +465,7 @@ macro_rules! nonzero_unsigned_operations {
without modifying the original"]
#[inline]
pub const fn log2(self) -> u32 {
<$Int>::BITS - 1 - self.leading_zeros()
Self::BITS - 1 - self.leading_zeros()
}

/// Returns the base 10 logarithm of the number, rounded down.
Expand Down

0 comments on commit 6b5acf0

Please sign in to comment.