-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
mod array; | ||
mod atomic; | ||
mod bool; | ||
mod cmp; | ||
mod floating; | ||
mod integral; | ||
mod non_zero; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use core::cmp::{Ordering, Reverse}; | ||
|
||
use error_stack::Result; | ||
|
||
use crate::{ | ||
error::{DeserializeError, VisitorError}, | ||
Deserialize, Deserializer, Document, Reflection, Schema, Visitor, | ||
}; | ||
|
||
impl<'de, T: Deserialize<'de>> Deserialize<'de> for Reverse<T> { | ||
type Reflection = T::Reflection; | ||
|
||
fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, DeserializeError> { | ||
T::deserialize(de).map(Reverse) | ||
} | ||
} |