File tree 2 files changed +10
-5
lines changed
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"
32
32
crossbeam-deque = " 0.7.1"
33
33
futures-core-preview = " =0.3.0-alpha.19"
34
34
futures-io-preview = " =0.3.0-alpha.19"
35
- futures-timer = " 1.0.0 "
35
+ futures-timer = " 1.0.1 "
36
36
lazy_static = " 1.4.0"
37
37
log = { version = " 0.4.8" , features = [" kv_unstable" ] }
38
38
memchr = " 2.2.1"
Original file line number Diff line number Diff line change @@ -23,13 +23,18 @@ use futures_timer::Delay;
23
23
/// Basic example:
24
24
///
25
25
/// ```no_run
26
+ /// use async_std::prelude::*;
27
+ /// use async_std::stream;
26
28
/// use std::time::Duration;
27
- /// use futures::prelude::*;
28
29
///
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));
30
33
/// while let Some(_) = interval.next().await {
31
- /// println!("prints every four seconds")) ;
34
+ /// println!("prints every four seconds");
32
35
/// }
36
+ /// #
37
+ /// # Ok(()) }) }
33
38
/// ```
34
39
#[ cfg_attr( feature = "docs" , doc( cfg( unstable) ) ) ]
35
40
#[ doc( inline) ]
@@ -63,7 +68,7 @@ impl Stream for Interval {
63
68
}
64
69
let when = Instant :: now ( ) ;
65
70
let next = next_interval ( when, Instant :: now ( ) , self . interval ) ;
66
- self . delay . reset_at ( next) ;
71
+ self . delay . reset ( next) ;
67
72
Poll :: Ready ( Some ( ( ) ) )
68
73
}
69
74
}
You can’t perform that action at this time.
0 commit comments