Small improvements

This commit is contained in:
Connor Johnstone
2023-12-01 22:41:42 -07:00
parent 993c23dc1b
commit 78b17e5f82
3 changed files with 4 additions and 4 deletions

View File

@@ -26,8 +26,8 @@ pub fn part1(input: &str) -> String {
pub fn part2(input: &str) -> String {
let games = input.lines().map(|line| {
let mut iter = line.split(":");
let results_iter = iter.next().unwrap().split(&[';', ',']).map(|result| {
let iter = line.split(":");
let results_iter = iter.skip(1).next().unwrap().split(&[';', ',']).map(|result| {
let mut result_iter = result.trim().split(" ");
let count = result_iter.next().unwrap().parse::<u32>().unwrap();
let color = result_iter.next().unwrap();