forked from mirror/async-std
Merge #230
230: fixes merge artifacts in stream docs r=stjepang a=montekki Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com>
This commit is contained in:
commit
697a7207cb
1 changed files with 11 additions and 1 deletions
|
@ -275,6 +275,7 @@ pub trait Stream {
|
|||
/// This combinator does no guarding against overflows.
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
|
@ -291,6 +292,7 @@ pub trait Stream {
|
|||
///
|
||||
/// #
|
||||
/// # }) }
|
||||
/// ```
|
||||
fn enumerate(self) -> Enumerate<Self>
|
||||
where
|
||||
Self: Sized,
|
||||
|
@ -357,6 +359,7 @@ pub trait Stream {
|
|||
done: false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a stream that uses a predicate to determine if an element
|
||||
/// should be yeilded.
|
||||
///
|
||||
|
@ -378,6 +381,7 @@ pub trait Stream {
|
|||
/// assert_eq!(s.next().await, None);
|
||||
/// #
|
||||
/// # }) }
|
||||
/// ```
|
||||
fn filter<P>(self, predicate: P) -> Filter<Self, P, Self::Item>
|
||||
where
|
||||
Self: Sized,
|
||||
|
@ -415,6 +419,7 @@ pub trait Stream {
|
|||
/// assert_eq!(end, None);
|
||||
/// #
|
||||
/// # }) }
|
||||
/// ```
|
||||
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F, Self::Item, B>
|
||||
where
|
||||
Self: Sized,
|
||||
|
@ -801,6 +806,11 @@ pub trait Stream {
|
|||
///
|
||||
/// ## Examples
|
||||
///
|
||||
/// ```
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
/// #
|
||||
/// use std::collections::VecDeque;
|
||||
/// use async_std::stream::Stream;
|
||||
/// let s: VecDeque<usize> = vec![1, 2, 3].into_iter().collect();
|
||||
/// let mut skipped = s.skip(2);
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue