Skip to content

Commit

Permalink
Added FusedStream impl to Buffered
Browse files Browse the repository at this point in the history
  • Loading branch information
jean-airoldie committed Nov 9, 2019
1 parent 16afd7c commit da2cd6b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion futures-util/src/stream/stream/buffered.rs
@@ -1,4 +1,4 @@
use crate::stream::{Fuse, FuturesOrdered, StreamExt};
use crate::stream::{Fuse, FuturesOrdered, StreamExt, FusedStream};
use futures_core::future::Future;
use futures_core::stream::Stream;
use futures_core::task::{Context, Poll};
Expand Down Expand Up @@ -40,6 +40,16 @@ where
}
}

impl<St> FusedStream for Buffered<St>
where
St: FusedStream,
St::Item: Future,
{
fn is_terminated(&self) -> bool {
self.stream.is_terminated() && self.in_progress_queue.is_empty()
}
}

impl<St> Buffered<St>
where
St: Stream,
Expand Down

0 comments on commit da2cd6b

Please sign in to comment.