Skip to content

Commit d76b32e

Browse files
committed
make it unstable and fix trait bound
1 parent 11268a8 commit d76b32e

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/stream/stream/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ mod ne;
5454
mod next;
5555
mod nth;
5656
mod partial_cmp;
57-
mod partition;
5857
mod position;
5958
mod scan;
6059
mod skip;
@@ -92,7 +91,6 @@ use ne::NeFuture;
9291
use next::NextFuture;
9392
use nth::NthFuture;
9493
use partial_cmp::PartialCmpFuture;
95-
use partition::PartitionFuture;
9694
use position::PositionFuture;
9795
use try_fold::TryFoldFuture;
9896
use try_for_each::TryForEachFuture;
@@ -122,8 +120,11 @@ cfg_unstable! {
122120

123121
use crate::stream::into_stream::IntoStream;
124122
use crate::stream::{FromStream, Product, Sum};
123+
use crate::stream::Extend;
125124

126125
use count::CountFuture;
126+
use partition::PartitionFuture;
127+
127128
pub use merge::Merge;
128129
pub use flatten::Flatten;
129130
pub use flat_map::FlatMap;
@@ -134,6 +135,7 @@ cfg_unstable! {
134135
mod merge;
135136
mod flatten;
136137
mod flat_map;
138+
mod partition;
137139
mod timeout;
138140
mod throttle;
139141
}
@@ -1334,14 +1336,16 @@ extension_trait! {
13341336
# }) }
13351337
```
13361338
"#]
1339+
#[cfg(feature = "unstable")]
1340+
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
13371341
fn partition<B, F>(
13381342
self,
13391343
f: F,
13401344
) -> impl Future<Output = (B, B)> [PartitionFuture<Self, F, B>]
13411345
where
13421346
Self: Sized,
13431347
F: FnMut(&Self::Item) -> bool,
1344-
B: Default,
1348+
B: Default + Extend<Self::Item>,
13451349
{
13461350
PartitionFuture::new(self, f)
13471351
}

src/stream/stream/partition.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ use crate::task::{Context, Poll};
88

99
pin_project! {
1010
#[derive(Debug)]
11+
#[allow(missing_debug_implementations)]
12+
#[cfg(all(feature = "default", feature = "unstable"))]
13+
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
1114
pub struct PartitionFuture<S, F, B> {
1215
#[pin]
1316
stream: S,

0 commit comments

Comments
 (0)