Crate impartial_ord
source ·Expand description
// Input
#[derive(PartialEq, Eq, Ord, impartial_ord::ImpartialOrd)]
struct MyStruct { foo: Bar, qux: Baz, }
// Output
impl PartialOrd for MyStruct where Self: Ord {
#[inline]
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(Ord::cmp(self, other))
}
}
Derive Macros
- A quicker PartialOrd for types that already implement Ord.