See comment.
This primarily stems from how the ordering implementation for Option is derived:
#[derive(PartialEq, PartialOrd)]
enum Foo {
First,
Second,
}
fn main() {
assert!(Foo::First < Foo::Second);
assert!([Some(Foo::First), None] > [None, Some(Foo::Second)]);
}
Without such a definition, some form of wrapper would be needed to change how ordering is done. But any such abstractions also cause issues with potential optimization opportunities.
However it's done, it will become part of the public API of this crate.
See comment.
This primarily stems from how the ordering implementation for
Optionis derived:Without such a definition, some form of wrapper would be needed to change how ordering is done. But any such abstractions also cause issues with potential optimization opportunities.
However it's done, it will become part of the public API of this crate.