From 554d5cfbc1ec93c4240c9cdbfac90ea62bd596ea Mon Sep 17 00:00:00 2001 From: Felipe Sere Date: Sun, 20 Oct 2019 13:37:26 +0200 Subject: [PATCH] Slight renamings --- src/stream/successor.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/stream/successor.rs b/src/stream/successor.rs index 8e93956..32353d0 100644 --- a/src/stream/successor.rs +++ b/src/stream/successor.rs @@ -12,7 +12,7 @@ use crate::task::{Context, Poll}; /// /// [`successor`]: fn.successor.html #[derive(Debug)] -pub struct Successor +pub struct Successors where Fut: Future, { @@ -22,7 +22,7 @@ where _marker: PhantomData, } -/// Creates a new stream where to produce each new element a clousre is called with the previous +/// Creates a new stream where to produce each new element a closure is called with the previous /// value. /// /// #Examples @@ -33,7 +33,7 @@ where /// use async_std::prelude::*; /// use async_std::stream; /// -/// let s = stream::successor(22, |val| { +/// let s = stream::successors(22, |val| { /// async move { /// val + 1 /// } @@ -47,13 +47,13 @@ where /// # }) } /// /// ``` -pub fn successor(start: T, func: F) -> Successor +pub fn successors(start: T, func: F) -> Successors where F: FnMut(T) -> Fut, Fut: Future, T: Copy, { - Successor { + Successors { successor: func, future: None, next: start, @@ -61,7 +61,7 @@ where } } -impl Successor +impl Successors where F: FnMut(T) -> Fut, Fut: Future, @@ -72,7 +72,7 @@ where pin_utils::unsafe_pinned!(future: Option); } -impl Stream for Successor +impl Stream for Successors where Fut: Future, F: FnMut(T) -> Fut,