Skip to content

Add Stream::sum() and Stream::product() implementations #377

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2019

Conversation

ktomsic
Copy link
Contributor

@ktomsic ktomsic commented Oct 22, 2019

These are the stream equivalents to std::iter::Iterator::sum() and
std::iter::Iterator::product().

Note that this changeset tweaks the Stream::Sum and Stream::Product
traits a little: rather than returning a generic future F, they return
a pinned, boxed, Future trait object now. This is in line with other
traits that return a future, e.g. FromStream.

These are the stream equivalents to `std::iter::Iterator::sum()` and
`std::iter::Iterator::product()`.

Note that this changeset tweaks the `Stream::Sum` and `Stream::Product`
traits a little: rather than returning a generic future `F`, they return
a pinned, boxed, `Future` trait object now. This is in line with other
traits that return a future, e.g. `FromStream`.
@ktomsic ktomsic force-pushed the sum-and-product-impls branch from b19b903 to e26eb7a Compare October 23, 2019 00:30
Copy link
Contributor

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great. Thanks so much!

@yoshuawuyts yoshuawuyts merged commit ca4856a into async-rs:master Oct 28, 2019
@yoshuawuyts yoshuawuyts added the enhancement New feature or request label Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants