revsets: replace while loop by for loop, as pointed out by clippy

This commit is contained in:
Martin von Zweigbergk 2021-06-05 08:39:07 -07:00
parent 82b62e92f1
commit f722e8662f

View file

@ -681,9 +681,9 @@ impl<'revset, 'repo> Iterator for FilterRevsetIterator<'revset, 'repo> {
type Item = IndexEntry<'repo>; type Item = IndexEntry<'repo>;
fn next(&mut self) -> Option<Self::Item> { fn next(&mut self) -> Option<Self::Item> {
while let Some(next) = self.iter.next() { for entry in &mut self.iter {
if (self.predicate)(&next) { if (self.predicate)(&entry) {
return Some(next); return Some(entry);
} }
} }
None None