-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
stream: add stream extend function #3010
Conversation
Allows extending a Vec<T> with a Stream<Item=T>. Ref: tokio-rs#2842
2c50bb6
to
36157b3
Compare
Shouldn't it be generic over |
It makes sense. However, in order to call |
|
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 haven't decided if we want this yet, but I noticed that it could be simplified.
Co-authored-by: Alice Ryhl <alice@ryhl.io>
It's unfortunate that we are not able to reserve space before-hand using the |
@Darksonn shall we close this PR? |
I've decided to close this because I feel that this is not the best possible API for this function. I want an API that:
This PR only satisfies the first. You should feel free to open an issue proposing a different API if you have an implementation idea that satisfies these. |
@taiki-e based on your comment do you think we should wait until rust-lang/rust#72631 in order to implement this properly? |
That would be one solution, but it's unclear when and if it will be merged, which is why I didn't just merge this now to wait for that. |
Allows extending a Vec with a Stream<Item=T>.
Ref: #2842
Motivation
Solution