sort-steps 0.2.4

Sort terms step by step.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::cmp::Ordering::{self, Greater, Less};

#[inline]
pub fn gt_by<T, F>(lhs: &T, rhs: &T, compare: F) -> bool
where
    F: Fn(&T, &T) -> Option<Ordering>,
{
    matches!(compare(lhs, rhs), Some(Greater))
}

#[inline]
pub fn lt_by<T, F>(lhs: &T, rhs: &T, compare: F) -> bool
where
    F: Fn(&T, &T) -> Option<Ordering>,
{
    matches!(compare(lhs, rhs), Some(Less))
}