Skip to content

Commit

Permalink
Merge pull request #5 from twittner/master
Browse files Browse the repository at this point in the history
Update to futures-0.3
  • Loading branch information
tomaka authored Nov 20, 2019
2 parents 10a791e + 99c3a61 commit 999a99b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
13 changes: 8 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@ license = "MIT"
repository = "https://github.com/tomaka/wasm-timer"

[dependencies]
futures-preview = "0.3.0-alpha"
futures = "0.3.1"
parking_lot = "0.9"
pin-utils = "0.1.0-alpha.4"

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
js-sys = "0.3.14"
js-sys = "0.3.31"
send_wrapper = "0.2"
wasm-bindgen = { version = "0.2.37" }
wasm-bindgen-futures = { version = "0.3.25", features = ["futures_0_3"] }
web-sys = { version = "0.3.14", features = ["Performance", "Window"] }
wasm-bindgen = "0.2.37"
wasm-bindgen-futures = "0.4.4"
web-sys = { version = "0.3.31", features = ["Performance", "Window"] }

[dev-dependencies]
async-std = "1.0"
16 changes: 8 additions & 8 deletions src/timer/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,24 @@ pub trait TryFutureExt: TryFuture + Sized {
/// # Examples
///
/// ```no_run
/// # #![feature(async_await)]
/// use std::time::Duration;
/// use futures::prelude::*;
/// use futures_timer::TryFutureExt;
/// use wasm_timer::TryFutureExt;
///
/// # fn long_future() -> impl TryFuture<Ok = (), Error = std::io::Error> {
/// # futures::future::ok(())
/// # }
/// #
/// #[runtime::main]
/// async fn main() {
/// fn main() {
/// let future = long_future();
/// let timed_out = future.timeout(Duration::from_secs(1));
///
/// match timed_out.await {
/// Ok(item) => println!("got {:?} within enough time!", item),
/// Err(_) => println!("took too long to produce the item"),
/// }
/// async_std::task::block_on(async {
/// match timed_out.await {
/// Ok(item) => println!("got {:?} within enough time!", item),
/// Err(_) => println!("took too long to produce the item"),
/// }
/// })
/// }
/// ```
fn timeout(self, dur: Duration) -> Timeout<Self>
Expand Down

0 comments on commit 999a99b

Please sign in to comment.