Forgot to commit some files + small cleanup

This commit is contained in:
2020-12-01 09:28:16 +01:00
parent 62cd585261
commit 112d1462a4
6 changed files with 47 additions and 30 deletions

24
src/main.rs Normal file
View File

@@ -0,0 +1,24 @@
use std::time::Instant;
mod util;
mod day1;
fn main() {
let now = Instant::now();
let args: Vec<String> = std::env::args().collect();
let day_arg_idx = args.iter().position(|a| a == "-d");
if day_arg_idx.is_some() {
match args[day_arg_idx.unwrap() + 1].parse::<u8>().unwrap() {
1 => day1::solve(),
_ => println!("This day is not yet implemented")
}
} else {
// Solve all days:
day1::solve();
}
println!("Execution took {} μs", now.elapsed().as_micros());
}