Small improvements
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user