mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-25 12:00:35 +00:00

## Motivation This allows `StreamMap` to be used with [`futures::stream::StreamExt::collect`][collect]. My use case is something like this: ```rust let stream_map: StreamMap<_, _> = things .into_iter() .map(|thing| make_stream(thing)) // iterator of futures .collect::<FuturesUnordered<_>>() // stream of streams .collect::<StreamMap<_, _>>() // combine all the inner streams into one .await; async fn make_stream(thing: Thing) -> impl Stream { ... } ``` [collect]: https://docs.rs/futures/0.3.17/futures/stream/trait.StreamExt.html#method.collect ## Solution Add `Extend` impl that delegates to the inner `Vec`.