-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat: add StreamExt::take_until
.
#103
Conversation
This commit migrates `Stream::take_until` from futures into futures-lite, with little modification. version are updated, as well.
This commit migrates `Stream::take_until` from futures into futures-lite with little modification. version are also updated.
# Conflicts: # src/stream.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is possible with the current set of combinators, so I think it's worth accepting this PR.
src/stream.rs
Outdated
/// | ||
/// assert_eq!(vec![1, 2, 3, 4, 5], stream.collect::<Vec<_>>().await); | ||
/// # }); | ||
fn take_until<F>(self, future: F) -> TakeUntil<Self, F> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer this as a free function, rather than a member of the trait.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will move it out of this trait, but I'd remind you that futures
library take it as a member of StreamExt
…StreamExt` trait.
Co-authored-by: John Nunley <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This commit migrates
Stream::take_until
from futures into futures-lite with little modification.version are also updated.