NonZero is just another deref
This commit is contained in:
parent
8b6f77095a
commit
0e7c027ff1
@ -331,6 +331,9 @@ deref_impl!(<T> Serialize for Arc<T> where T: Serialize);
|
|||||||
#[cfg(any(feature = "std", feature = "collections"))]
|
#[cfg(any(feature = "std", feature = "collections"))]
|
||||||
deref_impl!(<'a, T: ?Sized> Serialize for Cow<'a, T> where T: Serialize + ToOwned);
|
deref_impl!(<'a, T: ?Sized> Serialize for Cow<'a, T> where T: Serialize + ToOwned);
|
||||||
|
|
||||||
|
#[cfg(feature = "unstable")]
|
||||||
|
deref_impl!(<T> Serialize for NonZero<T> where T: Serialize + Zeroable);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
impl<T, E> Serialize for Result<T, E>
|
impl<T, E> Serialize for Result<T, E>
|
||||||
@ -525,16 +528,3 @@ impl Serialize for OsString {
|
|||||||
self.as_os_str().serialize(serializer)
|
self.as_os_str().serialize(serializer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "unstable")]
|
|
||||||
impl<T> Serialize for NonZero<T>
|
|
||||||
where
|
|
||||||
T: Serialize + Zeroable,
|
|
||||||
{
|
|
||||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
|
||||||
where
|
|
||||||
S: Serializer,
|
|
||||||
{
|
|
||||||
(**self).serialize(serializer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user