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

@ -9,7 +9,8 @@ mod platform {
/// A default cross-platform executor.
///
/// - On native platforms, it will use a `iced_futures::executor::ThreadPool`.
/// - On native platforms, it will use a
/// `iced_futures::executor::ThreadPool`.
/// - On the Web, it will use `iced_futures::executor::WasmBindgen`.
#[derive(Debug)]
pub struct Default(ThreadPool);
@ -34,7 +35,8 @@ mod platform {
/// A default cross-platform executor.
///
/// - On native platforms, it will use a `iced_futures::executor::ThreadPool`.
/// - On native platforms, it will use a
/// `iced_futures::executor::ThreadPool`.
/// - On the Web, it will use `iced_futures::executor::WasmBindgen`.
#[derive(Debug)]
pub struct Default(WasmBindgen);
@ -44,10 +46,7 @@ mod platform {
Ok(Default(WasmBindgen::new()?))
}
fn spawn(
&self,
future: impl futures::Future<Output = ()> + Send + 'static,
) {
fn spawn(&self, future: impl futures::Future<Output = ()> + 'static) {
self.0.spawn(future);
}
}