summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-01-19 11:08:47 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-01-19 11:08:47 +0100
commit35760ac68f06e783e64e9048aff0fff6df1c09cf (patch)
tree0ed42bd6c9417f7adb42f1dae62e17bfaab74319
parentb8b0d97525aaa2641d8493aa65e3108d70c1560a (diff)
downloadiced-35760ac68f06e783e64e9048aff0fff6df1c09cf.tar.gz
iced-35760ac68f06e783e64e9048aff0fff6df1c09cf.tar.bz2
iced-35760ac68f06e783e64e9048aff0fff6df1c09cf.zip
Make `thread-pool` optional in `iced_futures`
-rw-r--r--futures/Cargo.toml4
-rw-r--r--futures/src/runtime/executor.rs1
-rw-r--r--winit/Cargo.toml7
3 files changed, 10 insertions, 2 deletions
diff --git a/futures/Cargo.toml b/futures/Cargo.toml
index fe0d378c..5b303e01 100644
--- a/futures/Cargo.toml
+++ b/futures/Cargo.toml
@@ -10,12 +10,14 @@ documentation = "https://docs.rs/iced_futures"
keywords = ["gui", "ui", "graphics", "interface", "futures"]
categories = ["gui"]
+[features]
+thread-pool = ["futures/thread-pool"]
+
[dependencies]
log = "0.4"
[dependencies.futures]
version = "0.3"
-features = ["thread-pool"]
[dependencies.tokio]
version = "0.2"
diff --git a/futures/src/runtime/executor.rs b/futures/src/runtime/executor.rs
index 855aa105..eec5e231 100644
--- a/futures/src/runtime/executor.rs
+++ b/futures/src/runtime/executor.rs
@@ -8,6 +8,7 @@ pub trait Executor {
}
}
+#[cfg(feature = "thread-pool")]
impl Executor for futures::executor::ThreadPool {
fn spawn(&self, future: impl Future<Output = ()> + Send + 'static) {
self.spawn_ok(future);
diff --git a/winit/Cargo.toml b/winit/Cargo.toml
index 3ed37dd5..ba6d5229 100644
--- a/winit/Cargo.toml
+++ b/winit/Cargo.toml
@@ -16,12 +16,17 @@ debug = []
[dependencies]
winit = { version = "0.20.0-alpha3", git = "https://github.com/hecrj/winit", rev = "709808eb4e69044705fcb214bcc30556db761405"}
log = "0.4"
-futures = { version = "0.3", features = ["thread-pool"] }
+futures = "0.3"
[dependencies.iced_native]
version = "0.1.0-alpha"
path = "../native"
+[dependencies.iced_futures]
+version = "0.1.0-alpha"
+path = "../futures"
+features = ["thread-pool"]
+
[dependencies.window_clipboard]
git = "https://github.com/hecrj/window_clipboard"
rev = "22c6dd6c04cd05d528029b50a30c56417cd4bebf"