-
Notifications
You must be signed in to change notification settings - Fork 341
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
Add stream::from_iter #400
Comments
Riffing on this more: actually the preferred outcome would be to have
We currently can't do this, but such a bound seems like it'd be ideal. That way any Actually I'm wondering if instead of instant-stabilizing |
Going to go ahead and mark this "good first issue". It should be fairly straight forward to implement |
Can I try this ❓ |
@k-nasa go for it! |
It's quite common to want to create a stream from an iterator. Currently we're having a lot of
VecDequeue
in our examples because it implementsStream
, but that might not stay around (see rust-lang/futures-rs#1879).So I propose we add a new function
stream::from_iter
that returns a structFromIter
, similar to how we havestream::from_fn
that returnsFromFn
.This is mostly as a pragmatic fix for the fact that we can't implement
IntoStream
for std types ourselves (see #129), and probably in general useful when porting codebases. The value of this function should decrease if we can resolve that, but in order to do so theVecDequeue
must be removed first, so in order to break the somewhat recursive dependency there I propose we add this function.Because we'd want to use this function to replace all uses of
VecDequeue
we currently have in our examples, and we're in somewhat of time pressure ([email protected]
is in 9 days),I'd like to propose we make an exception here and introduce this without the."unstable"
markeredit: unsure about stability. More in follow-up comment.
cc/ @stjepang
Examples
The text was updated successfully, but these errors were encountered: