Skip to content

Commit fc10825

Browse files
committed
Write as for-loop
1 parent 2a8a764 commit fc10825

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
@@ -2107,7 +2107,7 @@ pub trait Itertools : Iterator {
21072107
F: FnMut(B, Self::Item) -> FoldWhile<B>
21082108
{
21092109
let mut acc = init;
2110-
while let Some(item) = self.next() {
2110+
for item in self {
21112111
match f(acc, item) {
21122112
FoldWhile::Continue(res) => acc = res,
21132113
res @ FoldWhile::Done(_) => return res,

0 commit comments

Comments
 (0)