Drop Send in Command and Executor on Wasm

This commit is contained in:
Héctor Ramón Jiménez 2020-02-05 04:14:26 +01:00
parent 9a06e481b7
commit ca213922d0
8 changed files with 232 additions and 111 deletions

View file

@ -11,5 +11,9 @@ impl Executor for Null {
Ok(Self)
}
#[cfg(not(target_arch = "wasm32"))]
fn spawn(&self, _future: impl Future<Output = ()> + Send + 'static) {}
#[cfg(target_arch = "wasm32")]
fn spawn(&self, _future: impl Future<Output = ()> + 'static) {}
}

View file

@ -9,10 +9,7 @@ impl Executor for WasmBindgen {
Ok(Self)
}
fn spawn(
&self,
future: impl futures::Future<Output = ()> + Send + 'static,
) {
fn spawn(&self, future: impl futures::Future<Output = ()> + 'static) {
wasm_bindgen_futures::spawn_local(future);
}
}