From 1ec85552bbb744cd70ff9e3d66572a593a0f4d05 Mon Sep 17 00:00:00 2001 From: Alain Emilia Anna Zscheile Date: Mon, 30 Sep 2024 18:53:12 +0200 Subject: [PATCH] Cargo.toml: reduce dependencies of CLI, WASM --- Cargo.toml | 24 ++++++++++++++++++------ src/bin/topola-egui/app.rs | 2 +- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3ec97f9..864a82e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,16 @@ required-features = ["egui"] [features] default = ["disable_contracts"] cli = ["dep:clap"] -egui = ["dep:sys-locale", "dep:unic-langid", "dep:fluent-templates", "dep:eframe", "dep:egui", "dep:rfd", "dep:futures-executor"] +egui = [ + "dep:eframe", + "dep:egui", + "dep:env_logger", + "dep:fluent-templates", + "dep:futures-lite", + "dep:rfd", + "dep:sys-locale", + "dep:unic-langid" +] disable_contracts = ["contracts/disable_contracts"] [dependencies] @@ -77,12 +86,15 @@ version = "0.28.1" optional = true version = "0.14.0" -[dependencies.futures-executor] -optional = true -version = "0.3.30" - [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -env_logger = "0.10" + +[target.'cfg(not(target_arch = "wasm32"))'.dependencies.futures-lite] +optional = true +version = "2.3" + +[target.'cfg(not(target_arch = "wasm32"))'.dependencies.env_logger] +optional = true +version = "0.11" [target.'cfg(target_arch = "wasm32")'.dependencies] wasm-bindgen-futures = "0.4" diff --git a/src/bin/topola-egui/app.rs b/src/bin/topola-egui/app.rs index 8105c09..fc451cf 100644 --- a/src/bin/topola-egui/app.rs +++ b/src/bin/topola-egui/app.rs @@ -223,7 +223,7 @@ impl eframe::App for App { #[cfg(not(target_arch = "wasm32"))] pub fn execute + Send + 'static>(f: F) { - std::thread::spawn(move || futures_executor::block_on(f)); + std::thread::spawn(move || futures_lite::future::block_on(f)); } #[cfg(target_arch = "wasm32")]