Skip to content

Commit

Permalink
Fix WASM build
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaka committed Nov 20, 2019
1 parent e0207bd commit ee6f010
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "wasm-timer"
edition = "2018"
description = "Abstraction over std::time::Instant and futures-timer that works on WASM"
version = "0.2.3"
version = "0.2.4"
authors = ["Pierre Krieger <pierre.krieger1708@gmail.com>"]
license = "MIT"
repository = "https://github.com/tomaka/wasm-timer"
Expand Down
4 changes: 2 additions & 2 deletions src/timer/global/wasm.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use futures::task::ArcWake;
use futures::task::{self, ArcWake};
use parking_lot::Mutex;
use std::convert::TryFrom;
use std::future::Future;
Expand Down Expand Up @@ -33,7 +33,7 @@ fn schedule_callback(timer: Arc<Mutex<Timer>>, when: Duration) {
// We start by polling the timer. If any new `Delay` is created, the waker will be used
// to wake up this task pre-emptively. As such, we pass a `Waker` that calls
// `schedule_callback` with a delay of `0`.
let waker = Arc::new(Waker { timer: timer.clone() }).into_waker();
let waker = task::waker(Arc::new(Waker { timer: timer.clone() }));
let _ = Future::poll(Pin::new(&mut *timer_lock), &mut Context::from_waker(&waker));

// Notify the timers that are ready.
Expand Down

0 comments on commit ee6f010

Please sign in to comment.