Skip to content

Commit

Permalink
Rollup merge of #68651 - LeSeulArtichaut:doc-from-nonzero, r=stevekla…
Browse files Browse the repository at this point in the history
…bnik

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
  • Loading branch information
Dylan-DPC authored Jan 30, 2020
2 parents 3df1ff2 + 684bd50 commit 1780f2f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), size_of::<", s

#[stable(feature = "from_nonzero", since = "1.31.0")]
impl From<$Ty> for $Int {
fn from(nonzero: $Ty) -> Self {
nonzero.0
doc_comment! {
concat!(
"Converts a `", stringify!($Ty), "` into an `", stringify!($Int), "`"),
fn from(nonzero: $Ty) -> Self {
nonzero.0
}
}
}

Expand Down

0 comments on commit 1780f2f

Please sign in to comment.