disabled party to candidate conversion

This commit is contained in:
Jay Robson 2025-05-03 23:52:34 +10:00
parent ea3e405295
commit ae8b1c8989
2 changed files with 5 additions and 4 deletions

View File

@ -13,7 +13,7 @@ impl Counter {
let mut ballots = Vec::new();
for row in csv {
ballots.push(Ballot::parse(row?, &header)?.to_candidate_ballot(&header));
ballots.push(Ballot::parse(row?, &header)?);
}
Ok(Counter {

View File

@ -22,6 +22,7 @@ fn main() {
let csv = quick_csv::Csv::from_file(csv_path).unwrap().flexible(true);
let counter = Counter::new(csv).unwrap();
eprintln!("Header: {:#?}", counter.header);
eprintln!("Parties: {}", counter.header.parties.len());
eprintln!("Candidates: {}", counter.header.candidates.len());
@ -93,9 +94,9 @@ fn main() {
println!();
eprintln!(" {index}:");
eprintln!(" - {index}:");
eprintln!(" Best: {} ({score_best})", names[id_best]);
eprintln!(" Worst: {} ({score_worst})", names[id_worst]);
eprintln!(" Lost: {} ({score_worst})", names[id_worst]);
}
let winners = names.iter().enumerate().filter_map(|(index, name)| match running[index] {