Use Self::BITS in log2 implementation

This commit is contained in:
Nikolai Vazquez 2022-03-12 08:01:35 -05:00
parent 1d13de6867
commit 6b5acf0d40

View File

@ -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.