aboutsummaryrefslogtreecommitdiff
path: root/src/stream/try_stream/try_collect.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/stream/try_stream/try_collect.rs')
-rw-r--r--src/stream/try_stream/try_collect.rs24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/stream/try_stream/try_collect.rs b/src/stream/try_stream/try_collect.rs
index 76ce619..387de97 100644
--- a/src/stream/try_stream/try_collect.rs
+++ b/src/stream/try_stream/try_collect.rs
@@ -1,23 +1,25 @@
use core::mem;
use core::pin::Pin;
use futures_core::future::{FusedFuture, Future};
+use futures_core::ready;
use futures_core::stream::{FusedStream, TryStream};
use futures_core::task::{Context, Poll};
-use pin_project::pin_project;
+use pin_project_lite::pin_project;
-/// Future for the [`try_collect`](super::TryStreamExt::try_collect) method.
-#[pin_project]
-#[derive(Debug)]
-#[must_use = "futures do nothing unless you `.await` or poll them"]
-pub struct TryCollect<St, C> {
- #[pin]
- stream: St,
- items: C,
+pin_project! {
+ /// Future for the [`try_collect`](super::TryStreamExt::try_collect) method.
+ #[derive(Debug)]
+ #[must_use = "futures do nothing unless you `.await` or poll them"]
+ pub struct TryCollect<St, C> {
+ #[pin]
+ stream: St,
+ items: C,
+ }
}
impl<St: TryStream, C: Default> TryCollect<St, C> {
- pub(super) fn new(s: St) -> TryCollect<St, C> {
- TryCollect {
+ pub(super) fn new(s: St) -> Self {
+ Self {
stream: s,
items: Default::default(),
}