impl Serialize and Deserialize for core::cmp::Reverse
This commit is contained in:
parent
bf27b28554
commit
f3ffcfd61e
@ -578,6 +578,8 @@ macro_rules! forwarded_impl {
|
||||
#[cfg(all(feature = "std", de_boxed_c_str))]
|
||||
forwarded_impl!((), Box<CStr>, CString::into_boxed_c_str);
|
||||
|
||||
forwarded_impl!((T), Reverse<T>, Reverse);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct OptionVisitor<T> {
|
||||
|
@ -139,6 +139,7 @@ mod lib {
|
||||
|
||||
pub use self::core::cell::{Cell, RefCell};
|
||||
pub use self::core::clone::{self, Clone};
|
||||
pub use self::core::cmp::Reverse;
|
||||
pub use self::core::convert::{self, From, Into};
|
||||
pub use self::core::default::{self, Default};
|
||||
pub use self::core::fmt::{self, Debug, Display};
|
||||
|
@ -824,3 +824,16 @@ where
|
||||
self.0.serialize(serializer)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Serialize for Reverse<T>
|
||||
where
|
||||
T: Serialize,
|
||||
{
|
||||
#[inline]
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: Serializer,
|
||||
{
|
||||
self.0.serialize(serializer)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user