diff --git a/src/bin/day22.rs b/src/bin/day22.rs index ec03bca..e622261 100644 --- a/src/bin/day22.rs +++ b/src/bin/day22.rs @@ -324,7 +324,7 @@ impl Solution for Day22 { let steps: String = it .clone() .skip(skip) - .take_while(|c| c.is_digit(10)) + .take_while(|c| c.is_ascii_digit()) .collect(); if !steps.is_empty() { // found a move instruction @@ -333,7 +333,7 @@ impl Solution for Day22 { continue; } - match it.clone().skip(skip).next().unwrap() { + match it.clone().nth(skip).unwrap() { 'L' => instructions.push(Instruction::TurnLeft), 'R' => instructions.push(Instruction::TurnRight), x => panic!("Invalid turn: {}", x),