Make thread-pool optional in iced_futures

This commit is contained in:
Héctor Ramón Jiménez 2020-01-19 11:08:47 +01:00
parent b8b0d97525
commit 35760ac68f
3 changed files with 10 additions and 2 deletions

View file

@ -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"

View file

@ -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);