Fix WASM build

This commit is contained in:
Pierre Krieger 2019-11-20 16:04:07 +01:00
parent e0207bd1c1
commit ee6f010a87
No known key found for this signature in database
GPG Key ID: EE749C4F41D4EA47
2 changed files with 3 additions and 3 deletions

View File

@ -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"

View File

@ -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;
@ -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.