From 04086a90c9e933ebfb42de378054e1115b33529d Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 20 Jan 2020 05:43:09 +0100 Subject: Implement `WasmBindgen` executor and reorganize --- src/native/executor.rs | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 src/native/executor.rs (limited to 'src/native/executor.rs') diff --git a/src/native/executor.rs b/src/native/executor.rs deleted file mode 100644 index 68a1d280..00000000 --- a/src/native/executor.rs +++ /dev/null @@ -1,23 +0,0 @@ -//! Choose your preferred executor to power your application. -pub use iced_winit::{executor::Null, Executor}; -use iced_winit::{executor::ThreadPool, futures}; - -/// The default cross-platform executor. -/// -/// - On native platforms, it will use a `ThreadPool`. -/// - On the Web, it will use `wasm-bindgen-futures::spawn_local`. -#[derive(Debug)] -pub struct Default(ThreadPool); - -impl Executor for Default { - fn new() -> Result { - Ok(Default(ThreadPool::new()?)) - } - - fn spawn( - &self, - future: impl futures::Future + Send + 'static, - ) { - self.0.spawn(future); - } -} -- cgit