diff --git a/src/stream/stream/mod.rs b/src/stream/stream/mod.rs index 1d9ae6e..672a085 100644 --- a/src/stream/stream/mod.rs +++ b/src/stream/stream/mod.rs @@ -54,7 +54,6 @@ mod ne; mod next; mod nth; mod partial_cmp; -mod partition; mod position; mod scan; mod skip; @@ -92,7 +91,6 @@ use ne::NeFuture; use next::NextFuture; use nth::NthFuture; use partial_cmp::PartialCmpFuture; -use partition::PartitionFuture; use position::PositionFuture; use try_fold::TryFoldFuture; use try_for_each::TryForEachFuture; @@ -122,8 +120,11 @@ cfg_unstable! { use crate::stream::into_stream::IntoStream; use crate::stream::{FromStream, Product, Sum}; + use crate::stream::Extend; use count::CountFuture; + use partition::PartitionFuture; + pub use merge::Merge; pub use flatten::Flatten; pub use flat_map::FlatMap; @@ -134,6 +135,7 @@ cfg_unstable! { mod merge; mod flatten; mod flat_map; + mod partition; mod timeout; mod throttle; } @@ -1334,6 +1336,8 @@ extension_trait! { # }) } ``` "#] + #[cfg(feature = "unstable")] + #[cfg_attr(feature = "docs", doc(cfg(unstable)))] fn partition( self, f: F, @@ -1341,7 +1345,7 @@ extension_trait! { where Self: Sized, F: FnMut(&Self::Item) -> bool, - B: Default, + B: Default + Extend, { PartitionFuture::new(self, f) } diff --git a/src/stream/stream/partition.rs b/src/stream/stream/partition.rs index 46e957c..ba4938c 100644 --- a/src/stream/stream/partition.rs +++ b/src/stream/stream/partition.rs @@ -8,6 +8,9 @@ use crate::task::{Context, Poll}; pin_project! { #[derive(Debug)] + #[allow(missing_debug_implementations)] + #[cfg(all(feature = "default", feature = "unstable"))] + #[cfg_attr(feature = "docs", doc(cfg(unstable)))] pub struct PartitionFuture { #[pin] stream: S,