about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNikolai Vazquez <hello@nikolaivazquez.com>2022-03-12 08:01:35 -0500
committerNikolai Vazquez <hello@nikolaivazquez.com>2022-03-12 08:01:35 -0500
commit6b5acf0d4063fc726f68fcd444140ffd576b7304 (patch)
tree1eae9b4dba0af85f1f0f083fef0d79c4d1d2f9be
parent1d13de686706f48f9da30b5640dd16b357df2806 (diff)
downloadrust-6b5acf0d4063fc726f68fcd444140ffd576b7304.tar.gz
rust-6b5acf0d4063fc726f68fcd444140ffd576b7304.zip
Use `Self::BITS` in `log2` implementation
-rw-r--r--library/core/src/num/nonzero.rs2
1 files changed, 1 insertions, 1 deletions
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.