Skip to content
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

Merged
merged 6 commits into from
May 28, 2024
Merged

feat: add StreamExt::take_until. #103

merged 6 commits into from
May 28, 2024

Conversation

LebranceBW
Copy link
Contributor

This commit migrates Stream::take_until from futures into futures-lite with little modification.
version are also updated.

zhulin.zzz added 3 commits May 27, 2024 09:57
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.
Copy link
Member

@notgull notgull left a 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.

CHANGELOG.md Outdated Show resolved Hide resolved
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>
Copy link
Member

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.

Copy link
Contributor Author

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

src/stream.rs Outdated Show resolved Hide resolved
@LebranceBW LebranceBW requested a review from notgull May 28, 2024 00:47
src/stream.rs Outdated Show resolved Hide resolved
src/stream.rs Outdated Show resolved Hide resolved
src/stream.rs Outdated Show resolved Hide resolved
@LebranceBW LebranceBW requested a review from notgull May 28, 2024 01:19
Copy link
Member

@notgull notgull left a comment

Choose a reason for hiding this comment

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

Thanks!

@notgull notgull merged commit 091964c into smol-rs:master May 28, 2024
7 checks passed
@notgull notgull mentioned this pull request May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants