mod day1; mod day2; mod day3; mod day4; mod day5; mod day6; mod day7; 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(), Some("5a") => day5::part1(), Some("5b") => day5::part2(), Some("6a") => day6::part1(), Some("6b") => day6::part2(), Some("7a") => day7::part1(), Some("7b") => day7::part2(), _ => panic!("unrecognized day"), }; println!("[{}] {}", day.unwrap(), result); }