Skip to content

Commit 3397168

Browse files
committed
Write as for-loop
1 parent 116f632 commit 3397168

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2105,7 +2105,7 @@ pub trait Itertools : Iterator {
21052105
F: FnMut(B, Self::Item) -> FoldWhile<B>
21062106
{
21072107
let mut acc = init;
2108-
while let Some(item) = self.next() {
2108+
for item in self {
21092109
match f(acc, item) {
21102110
FoldWhile::Continue(res) => acc = res,
21112111
res @ FoldWhile::Done(_) => return res,

0 commit comments

Comments
 (0)