diff options
author | 2020-11-25 04:24:44 +0100 | |
---|---|---|
committer | 2020-11-25 04:24:44 +0100 | |
commit | 87c9df294c79d73ff67a8d9a036cf9ddff24c52f (patch) | |
tree | 167a3a63519d20e67cf227441b938d8a9b0b584d /src/executor.rs | |
parent | 8f081bad7756e16a4eb0ca4dcb1144fc47de5e9b (diff) | |
parent | 782dd2f5222bfef5e12aa576a821da21126505b7 (diff) | |
download | iced-87c9df294c79d73ff67a8d9a036cf9ddff24c52f.tar.gz iced-87c9df294c79d73ff67a8d9a036cf9ddff24c52f.tar.bz2 iced-87c9df294c79d73ff67a8d9a036cf9ddff24c52f.zip |
Merge pull request #595 from valbendan/master
upgrade tokio to latest version(v0.3)
Diffstat (limited to 'src/executor.rs')
-rw-r--r-- | src/executor.rs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/executor.rs b/src/executor.rs index ea6ab14a..0333bc1d 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -7,13 +7,23 @@ pub use platform::Default; mod platform { use iced_futures::{executor, futures}; - #[cfg(feature = "tokio")] + #[cfg(feature = "tokio_old")] + type Executor = executor::TokioOld; + + #[cfg(all(not(feature = "tokio_old"), feature = "tokio"))] type Executor = executor::Tokio; - #[cfg(all(not(feature = "tokio"), feature = "async-std"))] + #[cfg(all( + not(any(feature = "tokio_old", feature = "tokio")), + feature = "async-std" + ))] type Executor = executor::AsyncStd; - #[cfg(not(any(feature = "tokio", feature = "async-std")))] + #[cfg(not(any( + feature = "tokio_old", + feature = "tokio", + feature = "async-std" + )))] type Executor = executor::ThreadPool; /// A default cross-platform executor. @@ -40,7 +50,7 @@ mod platform { } fn enter<R>(&self, f: impl FnOnce() -> R) -> R { - self.0.enter(f) + super::Executor::enter(&self.0, f) } } } |