~ruther/ctu-fee-eoa

ref: cab8e17120da81286ea20f990eec468130938541 ctu-fee-eoa/env/src/comparison/mod.rs -rw-r--r-- 355 bytes
cab8e171 — Rutherther chore: guard test imports by #[cfg(test)] 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub trait BetterThanOperator<T> {
    fn better_than(self: &Self, a: &T, b: &T) -> bool;
}

pub struct MinimizingOperator;
impl MinimizingOperator {
    pub fn new() -> Self {
        Self
    }
}

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