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.
|
/// This combinator does no guarding against overflows.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// # fn main() { async_std::task::block_on(async {
|
/// # fn main() { async_std::task::block_on(async {
|
||||||
/// #
|
/// #
|
||||||
|
@ -291,6 +292,7 @@ pub trait Stream {
|
||||||
///
|
///
|
||||||
/// #
|
/// #
|
||||||
/// # }) }
|
/// # }) }
|
||||||
|
/// ```
|
||||||
fn enumerate(self) -> Enumerate<Self>
|
fn enumerate(self) -> Enumerate<Self>
|
||||||
where
|
where
|
||||||
Self: Sized,
|
Self: Sized,
|
||||||
|
@ -357,6 +359,7 @@ pub trait Stream {
|
||||||
done: false,
|
done: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a stream that uses a predicate to determine if an element
|
/// Creates a stream that uses a predicate to determine if an element
|
||||||
/// should be yeilded.
|
/// should be yeilded.
|
||||||
///
|
///
|
||||||
|
@ -378,6 +381,7 @@ pub trait Stream {
|
||||||
/// assert_eq!(s.next().await, None);
|
/// assert_eq!(s.next().await, None);
|
||||||
/// #
|
/// #
|
||||||
/// # }) }
|
/// # }) }
|
||||||
|
/// ```
|
||||||
fn filter<P>(self, predicate: P) -> Filter<Self, P, Self::Item>
|
fn filter<P>(self, predicate: P) -> Filter<Self, P, Self::Item>
|
||||||
where
|
where
|
||||||
Self: Sized,
|
Self: Sized,
|
||||||
|
@ -415,6 +419,7 @@ pub trait Stream {
|
||||||
/// assert_eq!(end, None);
|
/// assert_eq!(end, None);
|
||||||
/// #
|
/// #
|
||||||
/// # }) }
|
/// # }) }
|
||||||
|
/// ```
|
||||||
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F, Self::Item, B>
|
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F, Self::Item, B>
|
||||||
where
|
where
|
||||||
Self: Sized,
|
Self: Sized,
|
||||||
|
@ -801,6 +806,11 @@ pub trait Stream {
|
||||||
///
|
///
|
||||||
/// ## Examples
|
/// ## 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 s: VecDeque<usize> = vec![1, 2, 3].into_iter().collect();
|
||||||
/// let mut skipped = s.skip(2);
|
/// let mut skipped = s.skip(2);
|
||||||
///
|
///
|
||||||
|
|
Loading…
Reference in a new issue