Rearrange docs to match 'repeat'

new-scheduler
Felipe Sere 5 years ago
parent 4c09cdbeac
commit bfb42b432e

@ -7,33 +7,10 @@ use crate::task::{Context, Poll, ready};
use pin_project_lite::pin_project; use pin_project_lite::pin_project;
pin_project! {
/// A stream that yields elements by calling an async closure with the previous value as an
/// argument
///
/// This stream is constructed by [`successors`] function
///
/// [`succcessors`]: fn.succssors.html
#[cfg(feature = "unstable")]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[derive(Debug)]
pub struct Successors<F, Fut, T>
where
Fut: Future<Output = Option<T>>,
{
succ: F,
#[pin]
future: Option<Fut>,
slot: Option<T>,
}
}
/// Creates a new stream where to produce each new element a closure is called with the previous /// Creates a new stream where to produce each new element a closure is called with the previous
/// value. /// value.
/// ///
/// #Examples /// # Examples
/// ///
/// ``` /// ```
/// # fn main() { async_std::task::block_on(async { /// # fn main() { async_std::task::block_on(async {
@ -82,6 +59,27 @@ where
} }
} }
pin_project! {
/// A stream that yields elements by calling an async closure with the previous value as an
/// argument
///
/// This stream is constructed by [`successors`] function
///
/// [`successors`]: fn.succssors.html
#[cfg(feature = "unstable")]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
#[derive(Debug)]
pub struct Successors<F, Fut, T>
where
Fut: Future<Output = Option<T>>,
{
succ: F,
#[pin]
future: Option<Fut>,
slot: Option<T>,
}
}
impl<F, Fut, T> Stream for Successors<F, Fut, T> impl<F, Fut, T> Stream for Successors<F, Fut, T>
where where
Fut: Future<Output = Option<T>>, Fut: Future<Output = Option<T>>,

Loading…
Cancel
Save