File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ crossbeam-channel = "0.3.9"
3232crossbeam-deque = "0.7.1"
3333futures-core-preview = "=0.3.0-alpha.19"
3434futures-io-preview = "=0.3.0-alpha.19"
35- futures-timer = "1.0.0 "
35+ futures-timer = "1.0.1 "
3636lazy_static = "1.4.0"
3737log = { version = "0.4.8", features = ["kv_unstable"] }
3838memchr = "2.2.1"
Original file line number Diff line number Diff line change @@ -23,13 +23,18 @@ use futures_timer::Delay;
2323/// Basic example:
2424///
2525/// ```no_run
26+ /// use async_std::prelude::*;
27+ /// use async_std::stream;
2628/// use std::time::Duration;
27- /// use futures::prelude::*;
2829///
29- /// let interval = Interval::new(Duration::from_secs(4));
30+ /// # fn main() -> std::io::Result<()> { async_std::task::block_on(async {
31+ /// #
32+ /// let mut interval = stream::interval(Duration::from_secs(4));
3033/// while let Some(_) = interval.next().await {
31- /// println!("prints every four seconds")) ;
34+ /// println!("prints every four seconds");
3235/// }
36+ /// #
37+ /// # Ok(()) }) }
3338/// ```
3439#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
3540#[doc(inline)]
@@ -63,7 +68,7 @@ impl Stream for Interval {
6368 }
6469 let when = Instant::now();
6570 let next = next_interval(when, Instant::now(), self.interval);
66- self.delay.reset_at (next);
71+ self.delay.reset (next);
6772 Poll::Ready(Some(()))
6873 }
6974}
You can’t perform that action at this time.
0 commit comments