From ad60ab1b1152e3352e63cabfbe36c856f59c051a Mon Sep 17 00:00:00 2001 From: Jan-Peter von Hunnius Date: Fri, 25 Apr 2025 09:17:54 +0200 Subject: [PATCH] Sort by RQ and car name rather than RQ and occurences --- src/records.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/records.rs b/src/records.rs index a8e1f6b..5f1ed90 100644 --- a/src/records.rs +++ b/src/records.rs @@ -108,9 +108,9 @@ fn print_best_cars() { entry.1 += 1; } - // Convert to vector and sort by RQ first, then frequency + // Convert to vector and sort by RQ first, then name let mut car_count_vec: Vec<_> = car_count.iter().collect(); - car_count_vec.sort_by(|a, b| a.1.0.rq.cmp(&b.1.0.rq).then(a.1.1.cmp(&b.1.1))); + car_count_vec.sort_by(|a, b| a.1.0.rq.cmp(&b.1.0.rq).then(a.0.cmp(&b.0))); for (_car_rid, (car_record, count)) in car_count_vec { println!(