We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4c2daad commit 20a228fCopy full SHA for 20a228f
src/stream.rs
@@ -25,9 +25,10 @@ pub async fn collect<St, C>(stream: St) -> C
25
26
pub fn map<St, U, F>(stream: St, f: F) -> impl Stream<Item = U>
27
where F: FnMut(St::Item) -> U,
28
- St: Stream + Unpin,
+ St: Stream,
29
{
30
- futures::stream::unfold((stream, f), async move |(mut stream, mut f)| {
+ let stream = Box::pin(stream);
31
+ futures::stream::unfold((stream, f), async move | (mut stream, mut f)| {
32
let item = await!(next(&mut stream));
33
item.map(|item| (f(item), (stream, f)))
34
})
0 commit comments