Skip to content

Commit 07cbc79

Browse files
committed
use generic NonZero for uint impl
1 parent 13423be commit 07cbc79

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

library/core/src/num/uint_macros.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ macro_rules! uint_impl {
33
Self = $SelfT:ty,
44
ActualT = $ActualT:ident,
55
SignedT = $SignedT:ident,
6-
NonZeroT = $NonZeroT:ty,
76

87
// There are all for use *only* in doc comments.
98
// As such, they're all passed as literals -- passing them as a string
@@ -1216,8 +1215,7 @@ macro_rules! uint_impl {
12161215
without modifying the original"]
12171216
#[inline]
12181217
pub const fn checked_ilog2(self) -> Option<u32> {
1219-
// FIXME: Simply use `NonZero::new` once it is actually generic.
1220-
if let Some(x) = <$NonZeroT>::new(self) {
1218+
if let Some(x) = NonZero::new(self) {
12211219
Some(x.ilog2())
12221220
} else {
12231221
None
@@ -1239,8 +1237,7 @@ macro_rules! uint_impl {
12391237
without modifying the original"]
12401238
#[inline]
12411239
pub const fn checked_ilog10(self) -> Option<u32> {
1242-
// FIXME: Simply use `NonZero::new` once it is actually generic.
1243-
if let Some(x) = <$NonZeroT>::new(self) {
1240+
if let Some(x) = NonZero::new(self) {
12441241
Some(x.ilog10())
12451242
} else {
12461243
None

0 commit comments

Comments
 (0)