From 6b5acf0d4063fc726f68fcd444140ffd576b7304 Mon Sep 17 00:00:00 2001 From: Nikolai Vazquez Date: Sat, 12 Mar 2022 08:01:35 -0500 Subject: [PATCH] Use `Self::BITS` in `log2` implementation --- library/core/src/num/nonzero.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs index 05e53175873..c3652931478 100644 --- a/library/core/src/num/nonzero.rs +++ b/library/core/src/num/nonzero.rs @@ -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.