We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6ac06a8 commit ba098adCopy full SHA for ba098ad
src/lib.rs
@@ -1748,12 +1748,10 @@ pub trait Itertools : Iterator {
1748
fn find_position<P>(&mut self, mut pred: P) -> Option<(usize, Self::Item)>
1749
where P: FnMut(&Self::Item) -> bool
1750
{
1751
- let mut index = 0usize;
1752
- for elt in self {
+ for (index, elt) in self.enumerate() {
1753
if pred(&elt) {
1754
return Some((index, elt));
1755
}
1756
- index += 1;
1757
1758
None
1759
0 commit comments