Skip to content

Commit fd6e2d8

Browse files
committed
tokio: switch to async-compat
1 parent ee6e517 commit fd6e2d8

File tree

3 files changed

+20
-28
lines changed

3 files changed

+20
-28
lines changed

Cargo.lock

Lines changed: 14 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async-global-executor = ["dep:async-global-executor"]
1818
async-io = ["dep:async-io", "async-global-executor?/async-io"]
1919
hickory-dns = ["dep:hickory-resolver", "tokio"] # hickory-dns only supports tokio as of now
2020
smol = ["dep:smol", "async-io"] # async-io required for implementing IoSafe
21-
tokio = ["dep:tokio", "dep:tokio-stream", "async-global-executor?/tokio", "hickory-resolver?/tokio"]
21+
tokio = ["dep:async-compat", "dep:tokio", "dep:tokio-stream", "async-global-executor?/tokio", "hickory-resolver?/tokio"]
2222

2323
[dependencies]
2424
async-trait = "^0.1.89"
@@ -27,6 +27,10 @@ futures-core = "^0.3"
2727
futures-executor = "^0.3"
2828
futures-io = "^0.3"
2929

30+
[dependencies.async-compat]
31+
version = "^0.2.5"
32+
optional = true
33+
3034
[dependencies.async-global-executor]
3135
version = "^3.1"
3236
optional = true
@@ -56,11 +60,6 @@ features = ["net", "rt", "rt-multi-thread", "time"]
5660
version = "^0.1"
5761
optional = true
5862

59-
[dependencies.tokio-util]
60-
version = "^0.7"
61-
default-features = false
62-
features = ["compat"]
63-
6463
[dev-dependencies.tokio]
6564
version = "^1.47"
6665
features = ["macros", "rt-multi-thread"]

src/implementors/tokio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use crate::{
66
traits::{Executor, Reactor, RuntimeKit},
77
util::Task,
88
};
9+
use async_compat::{Compat, CompatExt};
910
use cfg_if::cfg_if;
1011
use futures_core::Stream;
1112
use futures_io::{AsyncRead, AsyncWrite};
@@ -23,7 +24,6 @@ use tokio::{
2324
runtime::{EnterGuard, Handle, Runtime as TokioRT},
2425
};
2526
use tokio_stream::{StreamExt, wrappers::IntervalStream};
26-
use tokio_util::compat::{Compat, TokioAsyncReadCompatExt};
2727

2828
use task::TTask;
2929

0 commit comments

Comments
 (0)