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))
}