Re-export NonZero* types from ::lib

This commit is contained in:
David Tolnay 2018-03-25 12:30:30 +02:00
parent d7f9f8209d
commit d45ca2f5e4
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
3 changed files with 3 additions and 6 deletions

View File

@ -1936,7 +1936,7 @@ where
}
macro_rules! nonzero_integers {
( @ $( $T: ty, )+ ) => {
( $( $T: ty, )+ ) => {
$(
#[cfg(feature = "unstable")]
impl<'de> Deserialize<'de> for $T {
@ -1953,9 +1953,6 @@ macro_rules! nonzero_integers {
}
)+
};
( $( $T: ident, )+ ) => {
nonzero_integers!(@ $(::lib::num::$T,)+ );
}
}
nonzero_integers! {

View File

@ -215,7 +215,7 @@ mod lib {
pub use core::nonzero::{NonZero, Zeroable};
#[cfg(feature = "unstable")]
pub use core::num;
pub use core::num::{NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroUsize};
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -368,7 +368,7 @@ macro_rules! nonzero_integers {
( $( $T: ident, )+ ) => {
$(
#[cfg(feature = "unstable")]
impl Serialize for ::lib::num::$T {
impl Serialize for $T {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,