Wouldn't it be convenient to have the following API that "composes" two Ordering
according to the transitive relations? I'm not sure with the naming though.
impl Ordering {
fn compose(self, other: Ordering) -> Option<Ordering> {
use Ordering::*;
match (a, b) {
(x, Equal) | (Equal, x) => Some(x),
(Less, Less) | (Greater, Greater) => Some(a),
_ => None,
}
}
}