Switches `wasm-timer` for `futures-timer`.

master
Azriel Hoh 5 years ago
parent e20b0f0d75
commit d3e59370e7

@ -43,7 +43,7 @@ std = [
"pin-utils",
"slab",
"smol",
"wasm-timer",
"futures-timer",
"wasm-bindgen-futures",
"futures-channel",
]
@ -74,7 +74,7 @@ surf = { version = "1.0.3", optional = true }
smol = { version = "0.1.1", optional = true }
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-timer = { version = "0.2.4", optional = true }
futures-timer = { version = "3.0.2", optional = true, features = ["wasm-bindgen"] }
wasm-bindgen-futures = { version = "0.4.10", optional = true }
futures-channel = { version = "0.3.4", optional = true }

@ -64,12 +64,12 @@ pub(crate) type Timer = smol::Timer;
#[cfg(all(target_arch = "wasm32", feature = "default"))]
#[derive(Debug)]
pub(crate) struct Timer(wasm_timer::Delay);
pub(crate) struct Timer(futures_timer::Delay);
#[cfg(all(target_arch = "wasm32", feature = "default"))]
impl Timer {
pub(crate) fn after(dur: std::time::Duration) -> Self {
Timer(wasm_timer::Delay::new(dur))
Timer(futures_timer::Delay::new(dur))
}
}

Loading…
Cancel
Save