Skip to content

Commit

Permalink
Document From implementation for NonZero nums
Browse files Browse the repository at this point in the history
  • Loading branch information
LeSeulArtichaut committed Jan 29, 2020
1 parent eed12bc commit 684bd50
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 684bd50

Please sign in to comment.