summaryrefslogtreecommitdiffstats
path: root/futures/src/executor
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-05 04:14:26 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-02-05 04:14:26 +0100
commitca213922d043a5532d9ab352c0d54bfca7563871 (patch)
treeee4ce50991d974144e23030d31ffb11b975cb603 /futures/src/executor
parent9a06e481b7f52a9d8e123c909d5614332f607c53 (diff)
downloadiced-ca213922d043a5532d9ab352c0d54bfca7563871.tar.gz
iced-ca213922d043a5532d9ab352c0d54bfca7563871.tar.bz2
iced-ca213922d043a5532d9ab352c0d54bfca7563871.zip
Drop `Send` in `Command` and `Executor` on Wasm
Diffstat (limited to 'futures/src/executor')
-rw-r--r--futures/src/executor/null.rs4
-rw-r--r--futures/src/executor/wasm_bindgen.rs5
2 files changed, 5 insertions, 4 deletions
diff --git a/futures/src/executor/null.rs b/futures/src/executor/null.rs
index 6d5cf982..65e2e2df 100644
--- a/futures/src/executor/null.rs
+++ b/futures/src/executor/null.rs
@@ -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) {}
}
diff --git a/futures/src/executor/wasm_bindgen.rs b/futures/src/executor/wasm_bindgen.rs
index 69b7c7e2..94d694c8 100644
--- a/futures/src/executor/wasm_bindgen.rs
+++ b/futures/src/executor/wasm_bindgen.rs
@@ -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);
}
}