diff --git a/src/bin/day02.rs b/src/bin/day02.rs index d7cb873..683d053 100644 --- a/src/bin/day02.rs +++ b/src/bin/day02.rs @@ -23,10 +23,9 @@ fn part1(id: u64, game: &str) -> Result { .map(|poll| -> Result { let (count, colour) = n_colour_pair(poll)?; Ok(match colour { - "red" if count <= 12 => true, - "green" if count <= 13 => true, - "blue" if count <= 14 => true, - "red" | "green" | "blue" => false, + "red" => count <= 12, + "green" => count <= 13, + "blue" => count <= 14, c => { bail!("Invalid colour: {c}, expected red, green or blue") }