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

This commit is contained in:
Jan-Peter von Hunnius 2025-04-02 14:53:35 +02:00
parent 1a6ea07ed9
commit 5dd278b8f1

View file

@ -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
);
}
}