Skip to content

Commit 4e31bb3

Browse files
committed
fix tests
Signed-off-by: Yoshua Wuyts <[email protected]>
1 parent 01f8584 commit 4e31bb3

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

Diff for: Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ crossbeam-channel = "0.3.9"
3232
crossbeam-deque = "0.7.1"
3333
futures-core-preview = "=0.3.0-alpha.19"
3434
futures-io-preview = "=0.3.0-alpha.19"
35-
futures-timer = "1.0.0"
35+
futures-timer = "1.0.1"
3636
lazy_static = "1.4.0"
3737
log = { version = "0.4.8", features = ["kv_unstable"] }
3838
memchr = "2.2.1"

Diff for: src/stream/interval.rs

+9-4
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)