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
This commit is contained in:
commit
1780f2f12f
@ -91,8 +91,12 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), size_of::<", s
|
|||||||
|
|
||||||
#[stable(feature = "from_nonzero", since = "1.31.0")]
|
#[stable(feature = "from_nonzero", since = "1.31.0")]
|
||||||
impl From<$Ty> for $Int {
|
impl From<$Ty> for $Int {
|
||||||
fn from(nonzero: $Ty) -> Self {
|
doc_comment! {
|
||||||
nonzero.0
|
concat!(
|
||||||
|
"Converts a `", stringify!($Ty), "` into an `", stringify!($Int), "`"),
|
||||||
|
fn from(nonzero: $Ty) -> Self {
|
||||||
|
nonzero.0
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user