From d913b84e2356a2ff94502a414fbcfe9bb087d817 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 13 Aug 2019 12:15:59 +0300 Subject: [PATCH] impl fused future for Next --- src/stream/stream.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/stream/stream.rs b/src/stream/stream.rs index dee195df6..a171c0768 100644 --- a/src/stream/stream.rs +++ b/src/stream/stream.rs @@ -138,6 +138,15 @@ impl Future for NextFuture<'_, T> { } } +impl futures::future::FusedFuture for NextFuture<'_, T> +where + T: futures::stream::FusedStream + Unpin + ?Sized, +{ + fn is_terminated(&self) -> bool { + self.stream.is_terminated() + } +} + /// A stream that yields the first `n` items of another stream. #[derive(Clone, Debug)] pub struct Take {