1
0
Fork 0

day(22): fix clippy warnings

Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
Matej Focko 2023-07-07 13:33:26 +02:00
parent 13a0b3dbf7
commit 7093f4f7d0
Signed by: mfocko
GPG key ID: 7C47D46246790496

View file

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