diff --git a/lib/src/revset.rs b/lib/src/revset.rs index 854c7bf94..ca39f2c1f 100644 --- a/lib/src/revset.rs +++ b/lib/src/revset.rs @@ -681,9 +681,9 @@ impl<'revset, 'repo> Iterator for FilterRevsetIterator<'revset, 'repo> { type Item = IndexEntry<'repo>; fn next(&mut self) -> Option { - while let Some(next) = self.iter.next() { - if (self.predicate)(&next) { - return Some(next); + for entry in &mut self.iter { + if (self.predicate)(&entry) { + return Some(entry); } } None