Skip to content

Commit 1780f2f

Browse files
authored
Rollup merge of #68651 - LeSeulArtichaut:doc-from-nonzero, r=steveklabnik
Document `From` implementation for NonZero nums This is more of a nitpick than a real change in documentation. I did this for consistency with other documentation (namely Atomic integers). Related to #51430 r? @steveklabnik PS: I actually tested the code this time. My CPU died in the process, but I get to open a (hopefully 🤞) working PR
2 parents 3df1ff2 + 684bd50 commit 1780f2f

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)