summaryrefslogtreecommitdiffstats
path: root/futures
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-02-01 11:40:58 +0700
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-02-01 11:40:58 +0700
commitd95889aca9557dcefae37c63eb9b7dbc0d3cd7f2 (patch)
treec9296743188d298a4654163e275834692bca1f98 /futures
parent12060f823f9d519de2c61c7590b6e847e4b702e8 (diff)
downloadiced-d95889aca9557dcefae37c63eb9b7dbc0d3cd7f2.tar.gz
iced-d95889aca9557dcefae37c63eb9b7dbc0d3cd7f2.tar.bz2
iced-d95889aca9557dcefae37c63eb9b7dbc0d3cd7f2.zip
Fix `default` backend in `iced_futures`
Fixes #1228.
Diffstat (limited to 'futures')
-rw-r--r--futures/src/backend/default.rs9
-rw-r--r--futures/src/backend/native/thread_pool.rs8
-rw-r--r--futures/src/backend/null.rs4
3 files changed, 18 insertions, 3 deletions
diff --git a/futures/src/backend/default.rs b/futures/src/backend/default.rs
index 76264f55..842b5927 100644
--- a/futures/src/backend/default.rs
+++ b/futures/src/backend/default.rs
@@ -22,12 +22,19 @@ mod platform {
))]
pub use crate::backend::native::smol::*;
+ #[cfg(all(
+ feature = "thread-pool",
+ not(any(feature = "tokio", feature = "async-std", feature = "smol"))
+ ))]
+ pub use crate::backend::native::thread_pool::*;
+
#[cfg(not(any(
feature = "tokio",
feature = "async-std",
feature = "smol",
+ feature = "thread-pool"
)))]
- pub use crate::backend::native::thread_pool::*;
+ pub use crate::backend::null::*;
}
#[cfg(target_arch = "wasm32")]
diff --git a/futures/src/backend/native/thread_pool.rs b/futures/src/backend/native/thread_pool.rs
index 6e791533..da5d4b9b 100644
--- a/futures/src/backend/native/thread_pool.rs
+++ b/futures/src/backend/native/thread_pool.rs
@@ -3,9 +3,9 @@ use futures::Future;
/// A thread pool executor for futures.
#[cfg_attr(docsrs, doc(cfg(feature = "thread-pool")))]
-pub type ThreadPool = futures::executor::ThreadPool;
+pub type Executor = futures::executor::ThreadPool;
-impl crate::Executor for futures::executor::ThreadPool {
+impl crate::Executor for Executor {
fn new() -> Result<Self, futures::io::Error> {
futures::executor::ThreadPool::new()
}
@@ -14,3 +14,7 @@ impl crate::Executor for futures::executor::ThreadPool {
self.spawn_ok(future);
}
}
+
+pub mod time {
+ //! Listen and react to time.
+}
diff --git a/futures/src/backend/null.rs b/futures/src/backend/null.rs
index e22e7921..609b8b3f 100644
--- a/futures/src/backend/null.rs
+++ b/futures/src/backend/null.rs
@@ -16,3 +16,7 @@ impl crate::Executor for Executor {
#[cfg(target_arch = "wasm32")]
fn spawn(&self, _future: impl Future<Output = ()> + 'static) {}
}
+
+pub mod time {
+ //! Listen and react to time.
+}