Merge pull request #595 from valbendan/master

upgrade tokio to latest version(v0.3)
This commit is contained in:
Héctor Ramón 2020-11-25 04:24:44 +01:00 committed by GitHub
commit 87c9df294c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 72 additions and 13 deletions

View file

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

View file

@ -193,10 +193,17 @@ pub mod widget;
pub mod window;
#[cfg(all(
any(feature = "tokio", feature = "async-std"),
any(feature = "tokio", feature = "tokio_old", feature = "async-std"),
not(target_arch = "wasm32")
))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "tokio", feature = "async-std"))))]
#[cfg_attr(
docsrs,
doc(cfg(any(
feature = "tokio",
feature = "tokio_old",
feature = "async-std"
)))
)]
pub mod time;
#[cfg(all(