Skip to content

Commit

Permalink
Merge pull request #7 from jean-airoldie/fused_stream
Browse files Browse the repository at this point in the history
Added FusedStream impl for Unordered
  • Loading branch information
udoprog authored Jul 2, 2020
2 parents 574c030 + 19e3a0c commit 93feb80
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ use self::pin_slab::PinSlab;
use self::wake_set::{SharedWakeSet, WakeSet};
use self::waker::SharedWaker;
#[cfg(feature = "futures-rs")]
use futures_core::Stream;
use futures_core::{FusedStream, Stream};
use std::{
future::Future,
iter, marker, mem,
Expand Down Expand Up @@ -905,6 +905,12 @@ cfg_futures_rs! {
}
}

impl<T, S> FusedStream for Unordered<T, S> where S: Sentinel, Self: PollNext, {
fn is_terminated(&self) -> bool {
self.is_empty()
}
}

impl<T> PollNext for StreamsUnordered<T>
where
T: Stream,
Expand Down

0 comments on commit 93feb80

Please # to comment.