Skip to content

Commit 92f8e6f

Browse files
committed
Avoid closures in the default <Zip as ZipImpl>::next
1 parent 5a1c4ff commit 92f8e6f

File tree

1 file changed

+3
-5
lines changed
  • src/libcore/iter/adapters

1 file changed

+3
-5
lines changed

src/libcore/iter/adapters/zip.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,9 @@ impl<A, B> ZipImpl<A, B> for Zip<A, B>
9494

9595
#[inline]
9696
default fn next(&mut self) -> Option<(A::Item, B::Item)> {
97-
self.a.next().and_then(|x| {
98-
self.b.next().and_then(|y| {
99-
Some((x, y))
100-
})
101-
})
97+
let x = self.a.next()?;
98+
let y = self.b.next()?;
99+
Some((x, y))
102100
}
103101

104102
#[inline]

0 commit comments

Comments
 (0)