mirror of
https://github.com/async-rs/async-std.git
synced 2025-01-30 09:15:33 +00:00
make it unstable and fix trait bound
This commit is contained in:
parent
11268a80fb
commit
d76b32e6d4
2 changed files with 10 additions and 3 deletions
|
@ -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<B, F>(
|
||||
self,
|
||||
f: F,
|
||||
|
@ -1341,7 +1345,7 @@ extension_trait! {
|
|||
where
|
||||
Self: Sized,
|
||||
F: FnMut(&Self::Item) -> bool,
|
||||
B: Default,
|
||||
B: Default + Extend<Self::Item>,
|
||||
{
|
||||
PartitionFuture::new(self, f)
|
||||
}
|
||||
|
|
|
@ -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<S, F, B> {
|
||||
#[pin]
|
||||
stream: S,
|
||||
|
|
Loading…
Reference in a new issue