From ee6f010a873a99da2cef34900c6d738bcbd147b2 Mon Sep 17 00:00:00 2001 From: Pierre Krieger Date: Wed, 20 Nov 2019 16:04:07 +0100 Subject: [PATCH] Fix WASM build --- Cargo.toml | 2 +- src/timer/global/wasm.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b66bce7..857c00f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 "] license = "MIT" repository = "https://github.com/tomaka/wasm-timer" diff --git a/src/timer/global/wasm.rs b/src/timer/global/wasm.rs index e8604df..d04b0e2 100644 --- a/src/timer/global/wasm.rs +++ b/src/timer/global/wasm.rs @@ -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>, 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.