2019: da04: fix clippy lints
This commit is contained in:
parent
2b4173e80e
commit
c7a1ecf280
|
@ -59,11 +59,11 @@ fn part2(begin: usize, end: usize) -> Result<usize> {
|
||||||
let mut pair = false;
|
let mut pair = false;
|
||||||
let mut count = 1;
|
let mut count = 1;
|
||||||
let mut prev = digits[0];
|
let mut prev = digits[0];
|
||||||
for i in 1..digits.len() {
|
for digit in digits.iter().skip(1) {
|
||||||
if prev > digits[i] {
|
if prev > *digit {
|
||||||
ordered = false;
|
ordered = false;
|
||||||
break;
|
break;
|
||||||
} else if prev == digits[i] {
|
} else if prev == *digit {
|
||||||
count += 1;
|
count += 1;
|
||||||
} else {
|
} else {
|
||||||
if count == 2 {
|
if count == 2 {
|
||||||
|
@ -72,7 +72,7 @@ fn part2(begin: usize, end: usize) -> Result<usize> {
|
||||||
count = 1;
|
count = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
prev = digits[i];
|
prev = *digit;
|
||||||
}
|
}
|
||||||
pair = pair || count == 2;
|
pair = pair || count == 2;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue