From 5dd278b8f1529cb76fceb6f0e18b043e0aae79ad Mon Sep 17 00:00:00 2001 From: Jan-Peter von Hunnius Date: Wed, 2 Apr 2025 14:53:35 +0200 Subject: [PATCH] Fix: For the best cars the highest RQ of any given track where they were best was printed, instead of the car's RQ. The list was also sorted by that wrong RQ --- src/records.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/records.rs b/src/records.rs index 8bf6b6c..6e1fedf 100644 --- a/src/records.rs +++ b/src/records.rs @@ -110,12 +110,12 @@ fn print_best_cars() { // Convert to vector and sort by RQ first, then frequency let mut car_count_vec: Vec<_> = car_count.iter().collect(); - car_count_vec.sort_by(|a, b| a.1 .1.cmp(&b.1 .1).then(a.0.cmp(b.0))); + car_count_vec.sort_by(|a, b| a.1.2.rq.cmp(&b.1.2.rq).then(a.0.cmp(b.0))); - for (_car_rid, (count, rq, car_record)) in car_count_vec { + for (_car_rid, (count, _rq, car_record)) in car_count_vec { println!( "{},{},{},{},{}", - rq, car_record.brand, car_record.only_name, car_record.year, count + car_record.rq, car_record.brand, car_record.only_name, car_record.year, count ); } }