Skip to content

Commit 999a99b

Browse files
authored
Merge pull request #5 from twittner/master
Update to futures-0.3
2 parents 10a791e + 99c3a61 commit 999a99b

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

Cargo.toml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ license = "MIT"
88
repository = "https://github.com/tomaka/wasm-timer"
99

1010
[dependencies]
11-
futures-preview = "0.3.0-alpha"
11+
futures = "0.3.1"
1212
parking_lot = "0.9"
1313
pin-utils = "0.1.0-alpha.4"
1414

1515
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
16-
js-sys = "0.3.14"
16+
js-sys = "0.3.31"
1717
send_wrapper = "0.2"
18-
wasm-bindgen = { version = "0.2.37" }
19-
wasm-bindgen-futures = { version = "0.3.25", features = ["futures_0_3"] }
20-
web-sys = { version = "0.3.14", features = ["Performance", "Window"] }
18+
wasm-bindgen = "0.2.37"
19+
wasm-bindgen-futures = "0.4.4"
20+
web-sys = { version = "0.3.31", features = ["Performance", "Window"] }
21+
22+
[dev-dependencies]
23+
async-std = "1.0"

src/timer/ext.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,24 @@ pub trait TryFutureExt: TryFuture + Sized {
2727
/// # Examples
2828
///
2929
/// ```no_run
30-
/// # #![feature(async_await)]
3130
/// use std::time::Duration;
3231
/// use futures::prelude::*;
33-
/// use futures_timer::TryFutureExt;
32+
/// use wasm_timer::TryFutureExt;
3433
///
3534
/// # fn long_future() -> impl TryFuture<Ok = (), Error = std::io::Error> {
3635
/// # futures::future::ok(())
3736
/// # }
3837
/// #
39-
/// #[runtime::main]
40-
/// async fn main() {
38+
/// fn main() {
4139
/// let future = long_future();
4240
/// let timed_out = future.timeout(Duration::from_secs(1));
4341
///
44-
/// match timed_out.await {
45-
/// Ok(item) => println!("got {:?} within enough time!", item),
46-
/// Err(_) => println!("took too long to produce the item"),
47-
/// }
42+
/// async_std::task::block_on(async {
43+
/// match timed_out.await {
44+
/// Ok(item) => println!("got {:?} within enough time!", item),
45+
/// Err(_) => println!("took too long to produce the item"),
46+
/// }
47+
/// })
4848
/// }
4949
/// ```
5050
fn timeout(self, dur: Duration) -> Timeout<Self>

0 commit comments

Comments
 (0)