Skip to content

Commit 684bd50

Browse files
Document From implementation for NonZero nums
1 parent eed12bc commit 684bd50

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/libcore/num/mod.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), size_of::<", s
9191

9292
#[stable(feature = "from_nonzero", since = "1.31.0")]
9393
impl From<$Ty> for $Int {
94-
fn from(nonzero: $Ty) -> Self {
95-
nonzero.0
94+
doc_comment! {
95+
concat!(
96+
"Converts a `", stringify!($Ty), "` into an `", stringify!($Int), "`"),
97+
fn from(nonzero: $Ty) -> Self {
98+
nonzero.0
99+
}
96100
}
97101
}
98102

0 commit comments

Comments
 (0)