make it unstable and fix trait bound

new-scheduler
yjhmelody 5 years ago
parent 11268a80fb
commit d76b32e6d4

@ -54,7 +54,6 @@ mod ne;
mod next; mod next;
mod nth; mod nth;
mod partial_cmp; mod partial_cmp;
mod partition;
mod position; mod position;
mod scan; mod scan;
mod skip; mod skip;
@ -92,7 +91,6 @@ use ne::NeFuture;
use next::NextFuture; use next::NextFuture;
use nth::NthFuture; use nth::NthFuture;
use partial_cmp::PartialCmpFuture; use partial_cmp::PartialCmpFuture;
use partition::PartitionFuture;
use position::PositionFuture; use position::PositionFuture;
use try_fold::TryFoldFuture; use try_fold::TryFoldFuture;
use try_for_each::TryForEachFuture; use try_for_each::TryForEachFuture;
@ -122,8 +120,11 @@ cfg_unstable! {
use crate::stream::into_stream::IntoStream; use crate::stream::into_stream::IntoStream;
use crate::stream::{FromStream, Product, Sum}; use crate::stream::{FromStream, Product, Sum};
use crate::stream::Extend;
use count::CountFuture; use count::CountFuture;
use partition::PartitionFuture;
pub use merge::Merge; pub use merge::Merge;
pub use flatten::Flatten; pub use flatten::Flatten;
pub use flat_map::FlatMap; pub use flat_map::FlatMap;
@ -134,6 +135,7 @@ cfg_unstable! {
mod merge; mod merge;
mod flatten; mod flatten;
mod flat_map; mod flat_map;
mod partition;
mod timeout; mod timeout;
mod throttle; mod throttle;
} }
@ -1334,6 +1336,8 @@ extension_trait! {
# }) } # }) }
``` ```
"#] "#]
#[cfg(feature = "unstable")]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
fn partition<B, F>( fn partition<B, F>(
self, self,
f: F, f: F,
@ -1341,7 +1345,7 @@ extension_trait! {
where where
Self: Sized, Self: Sized,
F: FnMut(&Self::Item) -> bool, F: FnMut(&Self::Item) -> bool,
B: Default, B: Default + Extend<Self::Item>,
{ {
PartitionFuture::new(self, f) PartitionFuture::new(self, f)
} }

@ -8,6 +8,9 @@ use crate::task::{Context, Poll};
pin_project! { pin_project! {
#[derive(Debug)] #[derive(Debug)]
#[allow(missing_debug_implementations)]
#[cfg(all(feature = "default", feature = "unstable"))]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
pub struct PartitionFuture<S, F, B> { pub struct PartitionFuture<S, F, B> {
#[pin] #[pin]
stream: S, stream: S,

Loading…
Cancel
Save