Allow switching executor::Default with features

This commit is contained in:
Héctor Ramón Jiménez 2020-02-06 03:56:21 +01:00
parent e8316b2087
commit ad500441af
6 changed files with 34 additions and 28 deletions

View file

@ -6,8 +6,7 @@ edition = "2018"
publish = false
[dependencies]
iced = { path = "../..", features = ["image", "debug"] }
iced_futures = { path = "../../futures", features = ["tokio"] }
iced = { path = "../..", features = ["image", "debug", "tokio"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
rand = { version = "0.7", features = ["wasm-bindgen"] }

View file

@ -27,12 +27,7 @@ enum Message {
}
impl Application for Pokedex {
#[cfg(not(target_arch = "wasm32"))]
type Executor = iced_futures::executor::Tokio;
#[cfg(target_arch = "wasm32")]
type Executor = iced_futures::executor::WasmBindgen;
type Executor = iced::executor::Default;
type Message = Message;
fn new() -> (Pokedex, Command<Message>) {