|
1 | 1 | use super::{ConcurrentStream, Consumer, ConsumerState, IntoConcurrentStream};
|
2 |
| -use crate::future::FutureGroup; |
3 | 2 | #[cfg(all(feature = "alloc", not(feature = "std")))]
|
4 | 3 | use alloc::vec::Vec;
|
5 | 4 | use core::future::Future;
|
6 | 5 | use core::pin::Pin;
|
| 6 | +use futures_buffered::FuturesUnordered; |
7 | 7 | use futures_lite::StreamExt;
|
8 | 8 | use pin_project::pin_project;
|
9 | 9 |
|
@@ -32,14 +32,14 @@ impl<T> FromConcurrentStream<T> for Vec<T> {
|
32 | 32 | #[pin_project]
|
33 | 33 | pub(crate) struct VecConsumer<'a, Fut: Future> {
|
34 | 34 | #[pin]
|
35 |
| - group: FutureGroup<Fut>, |
| 35 | + group: FuturesUnordered<Fut>, |
36 | 36 | output: &'a mut Vec<Fut::Output>,
|
37 | 37 | }
|
38 | 38 |
|
39 | 39 | impl<'a, Fut: Future> VecConsumer<'a, Fut> {
|
40 | 40 | pub(crate) fn new(output: &'a mut Vec<Fut::Output>) -> Self {
|
41 | 41 | Self {
|
42 |
| - group: FutureGroup::new(), |
| 42 | + group: FuturesUnordered::new(), |
43 | 43 | output,
|
44 | 44 | }
|
45 | 45 | }
|
|
54 | 54 | async fn send(self: Pin<&mut Self>, future: Fut) -> super::ConsumerState {
|
55 | 55 | let mut this = self.project();
|
56 | 56 | // unbounded concurrency, so we just goooo
|
57 |
| - this.group.as_mut().insert_pinned(future); |
| 57 | + this.group.as_mut().push(future); |
58 | 58 | ConsumerState::Continue
|
59 | 59 | }
|
60 | 60 |
|
|
0 commit comments