From 0267a6f5677f27905e571d8471fe63c67f6e2463 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Thu, 2 Apr 2026 06:14:54 +0100 Subject: [PATCH] modes:pair: adjust Ord impl for Pair Instead of doing a deep-check where we compare their best member before their worst member, we just compare by the best member. This allows (Joker, 4S) to be equal to (4C, 4S). --- src/modes/pair.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/modes/pair.rs b/src/modes/pair.rs index 792b67a..1e1f295 100644 --- a/src/modes/pair.rs +++ b/src/modes/pair.rs @@ -50,12 +50,8 @@ use std::cmp::Ordering; impl Ord for Pair { fn cmp(&self, other: &Self) -> Ordering { - match (self.0.cmp(&other.0), self.1.cmp(&other.1)) { - // If Pair::1 are equal, then it's dependent on Pair::0 - (x, Ordering::Equal) => x, - // Otherwise leave it to Pair::1 - (_, x) => x, - } + // We order pairs by their "best" member i.e. Pair::1 + self.1.cmp(&other.1) } }