From 3c9dc4eaaada547e3ae92e555b31e6342aae273f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeromos=20Kov=C3=A1cs?= Date: Mon, 25 Nov 2024 18:55:56 +0100 Subject: [PATCH] fix(round-robin): don't include bye player in results --- src/tournament/format/round_robin.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tournament/format/round_robin.rs b/src/tournament/format/round_robin.rs index c409fd6..11d1278 100644 --- a/src/tournament/format/round_robin.rs +++ b/src/tournament/format/round_robin.rs @@ -94,6 +94,10 @@ impl Format for RoundRobin { fn results(self) -> Players { // hashmap -> vec let mut result: Vec<_> = self.points.into_iter().collect(); + // don't include bye in results + if result.last().is_some_and(|p| p.0.is_unset()) { + result.pop(); + } // sorted by points result.sort_by(|x, y| x.1.cmp(&y.1)); // extract players