diff --git a/2023/src/bin/day02.rs b/2023/src/bin/day02.rs index bdf70e8..1f57200 100644 --- a/2023/src/bin/day02.rs +++ b/2023/src/bin/day02.rs @@ -88,7 +88,7 @@ impl aoc::Solver for Day { // If valid, get the id and add it to the sum if valid { - let (_, id) = game.split_once(' ').unwrap(); + let id = game.split_once(' ').unwrap().1; let id: usize = id.parse().unwrap(); Some(id) } else { @@ -107,7 +107,7 @@ impl aoc::Solver for Day { .lines() .map(|line| { // Split the game id from the actual game played - let (_, line) = line.split_once(": ").unwrap(); + let line = line.split_once(": ").unwrap().1; // Get the required minimum amount for each color let required = line.split(", ").fold((0, 0, 0), |acc, entry| { diff --git a/2023/src/bin/day04.rs b/2023/src/bin/day04.rs index f8ed3ea..c4a1f9a 100644 --- a/2023/src/bin/day04.rs +++ b/2023/src/bin/day04.rs @@ -61,9 +61,10 @@ impl aoc::Solver for Day { .lines() .map(|line| { // Get rid of the first part - let (_, line) = line + let line = line .split_once(": ") - .expect("Input should be formatted properly"); + .expect("Input should be formatted properly") + .1; // Seperate the winning numbers and numbers we have let (winning, numbers) = line @@ -96,9 +97,10 @@ impl aoc::Solver for Day { input.lines().enumerate().for_each(|(i, line)| { // Get rid of the first part - let (_, line) = line + let line = line .split_once(": ") - .expect("Input should be formatted properly"); + .expect("Input should be formatted properly") + .1; // Seperate the winning numbers and numbers we have let (winning, numbers) = line