Small fixes

This commit is contained in:
2021-01-04 15:00:00 +01:00
parent 7df982d819
commit 7edc0b6b6d
4 changed files with 47 additions and 25 deletions

View File

@@ -1,5 +1,6 @@
extern crate intel_mkl_src;
use std::cmp::Ordering;
use std::collections::HashSet;
use std::fs;
use std::io::{self, BufRead};
@@ -39,12 +40,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let score_1: u16 = data[3].parse()?;
let score_2: u16 = data[4].parse()?;
if score_1 > score_2 {
observations.push((data[1].to_string(), data[2].to_string(), t));
} else if score_1 < score_2 {
observations.push((data[2].to_string(), data[1].to_string(), t));
} else {
panic!("there shouldn't be any tie games");
match score_1.cmp(&score_2) {
Ordering::Greater => {
observations.push((data[1].to_string(), data[2].to_string(), t));
}
Ordering::Less => {
observations.push((data[2].to_string(), data[1].to_string(), t));
}
_ => panic!("there shouldn't be any tie games"),
}
}