From 13e5d2f1c7b7ddcf15c2bab0b8c8be51c88bcf44 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sun, 5 Oct 2025 11:51:39 +0200 Subject: [PATCH] feat: add MaximizingOperator --- env/src/comparison/mod.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/env/src/comparison/mod.rs b/env/src/comparison/mod.rs index 82601af51e3a0bd19b07f8ce39759132331a92ac..28f241581d09caaded070c9809187f6a318f63f2 100644 --- a/env/src/comparison/mod.rs +++ b/env/src/comparison/mod.rs @@ -16,3 +16,18 @@ impl BetterThanOperator for MinimizingOperator a < b } } + +pub struct MaximizingOperator; +impl MaximizingOperator { + pub fn new() -> Self { + Self + } +} + +impl BetterThanOperator for MaximizingOperator + where T: PartialOrd +{ + fn better_than(self: &Self, a: &T, b: &T) -> bool { + a > b + } +}