Skip to content

Commit ba098ad

Browse files
hellow554phimuemue
authored andcommitted
fix clippy::explicit_counter_loop
1 parent 6ac06a8 commit ba098ad

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1748,12 +1748,10 @@ pub trait Itertools : Iterator {
17481748
fn find_position<P>(&mut self, mut pred: P) -> Option<(usize, Self::Item)>
17491749
where P: FnMut(&Self::Item) -> bool
17501750
{
1751-
let mut index = 0usize;
1752-
for elt in self {
1751+
for (index, elt) in self.enumerate() {
17531752
if pred(&elt) {
17541753
return Some((index, elt));
17551754
}
1756-
index += 1;
17571755
}
17581756
None
17591757
}

0 commit comments

Comments
 (0)