-
Notifications
You must be signed in to change notification settings - Fork 627
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace
All
and Any
's accum
field with done
It looks like `All` was originally implemented by copying from `TryFold` from which it inherited its `accum` field. However, `accum` can only ever be one of two values: `None` (if `All` has already completed) or `Some(true)` (if it's still processing values from the inner `Stream`). It doesn't need to keep track of an accumulator because the very fact that it hasn't short-circuited yet means that the accumulated value can't be `Some(false)`. Therefore, we only need two values here and we can represent them with a `bool` indicating whether or not `All` has already completed. The same principle applies for `Any` but substituting `Some(false)` for `Some(true)`.
- Loading branch information
Showing
2 changed files
with
22 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters