summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml2
-rw-r--r--examples/pokedex/Cargo.toml4
-rw-r--r--futures/Cargo.toml6
-rw-r--r--futures/src/executor.rs6
-rw-r--r--futures/src/executor/tokio_old.rs21
-rw-r--r--futures/src/lib.rs7
-rw-r--r--futures/src/time.rs24
-rw-r--r--src/executor.rs17
-rw-r--r--src/lib.rs8
9 files changed, 15 insertions, 80 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 9bc1b90c..bb50888a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -38,8 +38,6 @@ glow_default_system_font = ["iced_glow/default_system_font"]
debug = ["iced_winit/debug"]
# Enables `tokio` as the `executor::Default` on native platforms
tokio = ["iced_futures/tokio"]
-# Enables old `tokio` (0.2) as the `executor::Default` on native platforms
-tokio_old = ["iced_futures/tokio_old"]
# Enables `async-std` as the `executor::Default` on native platforms
async-std = ["iced_futures/async-std"]
# Enables `smol` as the `executor::Default` on native platforms
diff --git a/examples/pokedex/Cargo.toml b/examples/pokedex/Cargo.toml
index 05e73992..751e2872 100644
--- a/examples/pokedex/Cargo.toml
+++ b/examples/pokedex/Cargo.toml
@@ -6,7 +6,7 @@ edition = "2018"
publish = false
[dependencies]
-iced = { path = "../..", features = ["image", "debug", "tokio_old"] }
+iced = { path = "../..", features = ["image", "debug", "tokio"] }
serde_json = "1.0"
[dependencies.serde]
@@ -14,7 +14,7 @@ version = "1.0"
features = ["derive"]
[dependencies.reqwest]
-version = "0.10.2"
+version = "0.11"
features = ["json"]
[dependencies.rand]
diff --git a/futures/Cargo.toml b/futures/Cargo.toml
index cdae72e7..aa55df1e 100644
--- a/futures/Cargo.toml
+++ b/futures/Cargo.toml
@@ -19,12 +19,6 @@ log = "0.4"
[dependencies.futures]
version = "0.3"
-[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio_old]
-package = "tokio"
-version = "0.2"
-optional = true
-features = ["rt-core", "rt-threaded", "time", "stream"]
-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio]
package = "tokio"
version = "1.0"
diff --git a/futures/src/executor.rs b/futures/src/executor.rs
index b35b5bc1..23682f32 100644
--- a/futures/src/executor.rs
+++ b/futures/src/executor.rs
@@ -7,9 +7,6 @@ mod thread_pool;
#[cfg(all(not(target_arch = "wasm32"), feature = "tokio"))]
mod tokio;
-#[cfg(all(not(target_arch = "wasm32"), feature = "tokio_old"))]
-mod tokio_old;
-
#[cfg(all(not(target_arch = "wasm32"), feature = "async-std"))]
mod async_std;
@@ -27,9 +24,6 @@ pub use thread_pool::ThreadPool;
#[cfg(all(not(target_arch = "wasm32"), feature = "tokio"))]
pub use self::tokio::Tokio;
-#[cfg(all(not(target_arch = "wasm32"), feature = "tokio_old"))]
-pub use self::tokio_old::TokioOld;
-
#[cfg(all(not(target_arch = "wasm32"), feature = "async-std"))]
pub use self::async_std::AsyncStd;
diff --git a/futures/src/executor/tokio_old.rs b/futures/src/executor/tokio_old.rs
deleted file mode 100644
index d64729fa..00000000
--- a/futures/src/executor/tokio_old.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-use crate::Executor;
-
-use futures::Future;
-
-/// An old `tokio` runtime.
-#[cfg_attr(docsrs, doc(cfg(feature = "tokio_old")))]
-pub type TokioOld = tokio_old::runtime::Runtime;
-
-impl Executor for TokioOld {
- fn new() -> Result<Self, futures::io::Error> {
- tokio_old::runtime::Runtime::new()
- }
-
- fn spawn(&self, future: impl Future<Output = ()> + Send + 'static) {
- let _ = tokio_old::runtime::Runtime::spawn(self, future);
- }
-
- fn enter<R>(&self, f: impl FnOnce() -> R) -> R {
- tokio_old::runtime::Runtime::enter(self, f)
- }
-}
diff --git a/futures/src/lib.rs b/futures/src/lib.rs
index ddb56341..dbcb8aca 100644
--- a/futures/src/lib.rs
+++ b/futures/src/lib.rs
@@ -20,12 +20,7 @@ pub mod executor;
pub mod subscription;
#[cfg(all(
- any(
- feature = "tokio",
- feature = "tokio_old",
- feature = "async-std",
- feature = "smol"
- ),
+ any(feature = "tokio", feature = "async-std", feature = "smol"),
not(target_arch = "wasm32")
))]
#[cfg_attr(
diff --git a/futures/src/time.rs b/futures/src/time.rs
index 86b4a4e7..0ece6f04 100644
--- a/futures/src/time.rs
+++ b/futures/src/time.rs
@@ -14,7 +14,7 @@ pub fn every<H: std::hash::Hasher, E>(
struct Every(std::time::Duration);
#[cfg(all(
- not(any(feature = "tokio_old", feature = "tokio", feature = "async-std")),
+ not(any(feature = "tokio", feature = "async-std")),
feature = "smol"
))]
impl<H, E> subscription::Recipe<H, E> for Every
@@ -67,7 +67,7 @@ where
}
#[cfg(all(
- any(feature = "tokio", feature = "tokio_old"),
+ feature = "tokio",
not(any(feature = "async-std", feature = "smol"))
))]
impl<H, E> subscription::Recipe<H, E> for Every
@@ -89,23 +89,15 @@ where
) -> futures::stream::BoxStream<'static, Self::Output> {
use futures::stream::StreamExt;
- #[cfg(feature = "tokio_old")]
- use tokio_old as tokio;
-
let start = tokio::time::Instant::now() + self.0;
let stream = {
- #[cfg(feature = "tokio")]
- {
- futures::stream::unfold(
- tokio::time::interval_at(start, self.0),
- |mut interval| async move {
- Some((interval.tick().await, interval))
- },
- )
- }
- #[cfg(feature = "tokio_old")]
- tokio::time::interval_at(start, self.0)
+ futures::stream::unfold(
+ tokio::time::interval_at(start, self.0),
+ |mut interval| async move {
+ Some((interval.tick().await, interval))
+ },
+ )
};
stream.map(tokio::time::Instant::into_std).boxed()
diff --git a/src/executor.rs b/src/executor.rs
index 9f3656b1..c7166c68 100644
--- a/src/executor.rs
+++ b/src/executor.rs
@@ -7,30 +7,19 @@ pub use platform::Default;
mod platform {
use iced_futures::{executor, futures};
- #[cfg(feature = "tokio_old")]
- type Executor = executor::TokioOld;
-
- #[cfg(all(feature = "tokio", not(feature = "tokio_old")))]
+ #[cfg(feature = "tokio")]
type Executor = executor::Tokio;
- #[cfg(all(
- feature = "async-std",
- not(any(feature = "tokio_old", feature = "tokio")),
- ))]
+ #[cfg(all(feature = "async-std", not(feature = "tokio"),))]
type Executor = executor::AsyncStd;
#[cfg(all(
feature = "smol",
- not(any(
- feature = "tokio_old",
- feature = "tokio",
- feature = "async-std"
- )),
+ not(any(feature = "tokio", feature = "async-std")),
))]
type Executor = executor::Smol;
#[cfg(not(any(
- feature = "tokio_old",
feature = "tokio",
feature = "async-std",
feature = "smol",
diff --git a/src/lib.rs b/src/lib.rs
index 1ca07e80..6c0e03e8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -195,19 +195,13 @@ pub mod widget;
pub mod window;
#[cfg(all(
- any(
- feature = "tokio",
- feature = "tokio_old",
- feature = "async-std",
- feature = "smol"
- ),
+ any(feature = "tokio", feature = "async-std", feature = "smol"),
not(target_arch = "wasm32")
))]
#[cfg_attr(
docsrs,
doc(cfg(any(
feature = "tokio",
- feature = "tokio_old",
feature = "async-std"
feature = "smol"
)))