mod day1; mod day2; mod day3; mod day4; fn main() { let day = std::env::args().skip(1).next(); let result = match day.as_ref().map(|v| v.as_ref()) { Some("1a") => day1::part1(), Some("1b") => day1::part2(), Some("2a") => day2::part1(), Some("2b") => day2::part2(), Some("3a") => day3::part1(), Some("3b") => day3::part2(), Some("4a") => day4::part1(), Some("4b") => day4::part2(), _ => panic!("unrecognized day"), }; println!("[{}] {}", day.unwrap(), result); }