From 76a1f9c3302cd064af6bf54b218332fbf8a9d7f4 Mon Sep 17 00:00:00 2001 From: Erin Date: Sat, 2 Dec 2023 16:57:10 +0100 Subject: [PATCH] hehe --- src/bin/day02.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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") }