Skip to content

Commit

Permalink
apply suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
MagisterDallis committed Jan 15, 2025
1 parent b17a898 commit 3643c60
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions corelib/src/iter/traits/iterator.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,9 @@ pub trait Iterator<T> {
>(
ref self: T, init: B, f: F,
) -> B {
let mut accum = init;
match Self::next(ref self) {
Option::Some(x) => {
accum = f(accum, x);
Self::fold(ref self, accum, f)
},
Option::None => { accum },
Option::None => init,
Option::Some(x) => Self::fold(ref self, f(init, x), f),
}
}
}

0 comments on commit 3643c60

Please sign in to comment.