fix feature settings

This commit is contained in:
dignifiedquire 2020-04-26 21:02:01 +02:00
parent 804a52b7fd
commit 48dd683535
2 changed files with 4 additions and 4 deletions

View file

@ -29,7 +29,6 @@ default = [
"log", "log",
"num_cpus", "num_cpus",
"pin-project-lite", "pin-project-lite",
"smol",
] ]
docs = ["attributes", "unstable", "default"] docs = ["attributes", "unstable", "default"]
unstable = ["std", "broadcaster"] unstable = ["std", "broadcaster"]
@ -43,6 +42,7 @@ std = [
"once_cell", "once_cell",
"pin-utils", "pin-utils",
"slab", "slab",
"smol",
] ]
alloc = [ alloc = [
"futures-core/alloc", "futures-core/alloc",

View file

@ -59,14 +59,14 @@ pub(crate) trait Context {
fn context(self, message: impl Fn() -> String) -> Self; fn context(self, message: impl Fn() -> String) -> Self;
} }
#[cfg(not(target_os = "unknown"))] #[cfg(all(not(target_os = "unknown"), feature = "default"))]
pub(crate) type Timer = smol::Timer; pub(crate) type Timer = smol::Timer;
#[cfg(target_arch = "wasm32")] #[cfg(all(target_arch = "wasm32", feature = "default"))]
#[derive(Debug)] #[derive(Debug)]
pub(crate) struct Timer(wasm_timer::Delay); pub(crate) struct Timer(wasm_timer::Delay);
#[cfg(target_arch = "wasm32")] #[cfg(all(target_arch = "wasm32", feature = "default"))]
impl Timer { impl Timer {
pub(crate) fn after(dur: std::time::Duration) -> Self { pub(crate) fn after(dur: std::time::Duration) -> Self {
Timer(wasm_timer::Delay::new(dur)) Timer(wasm_timer::Delay::new(dur))