pub trait BetterThanOperator { fn better_than(self: &Self, a: &T, b: &T) -> bool; } pub struct MinimizingOperator; impl MinimizingOperator { pub fn new() -> Self { Self } } impl BetterThanOperator for MinimizingOperator where T: PartialOrd { fn better_than(self: &Self, a: &T, b: &T) -> bool { a < b } }