Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 76b866c

Browse files
committedNov 3, 2024
Modify NonZero documentation to reference the underlying integer type
This change updates the documentation for `NonZero` integer types to explicitly reference the underlying integer type each `NonZero` variant wraps, instead of using a general "integer" term.
1 parent 4c6593f commit 76b866c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed
 

‎core/src/num/nonzero.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,15 @@ macro_rules! nonzero_integer {
458458
reversed = $reversed:literal,
459459
leading_zeros_test = $leading_zeros_test:expr,
460460
) => {
461-
/// An integer that is known not to equal zero.
461+
#[doc = sign_dependent_expr!{
462+
$signedness ?
463+
if signed {
464+
concat!("An [`", stringify!($Int), "`] that is known not to equal zero.")
465+
}
466+
if unsigned {
467+
concat!("A [`", stringify!($Int), "`] that is known not to equal zero.")
468+
}
469+
}]
462470
///
463471
/// This enables some memory layout optimization.
464472
#[doc = concat!("For example, `Option<", stringify!($Ty), ">` is the same size as `", stringify!($Int), "`:")]

0 commit comments

Comments
 (0)
Failed to load comments.