Skip to content

Commit 825937e

Browse files
committed
Drop support for tokio 0.2/0.3
1 parent a6b2e86 commit 825937e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+53
-3225
lines changed

Cargo.lock

Lines changed: 34 additions & 76 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 & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ rustdoc-args = ["--cfg", "docsrs"]
1919
# groups
2020
default = []
2121
all = ["all-implementations", "all-algorithms"]
22-
all-implementations = ["futures-io", "tokio-02", "tokio-03", "tokio"]
22+
all-implementations = ["futures-io", "tokio"]
2323
all-algorithms = ["brotli", "bzip2", "deflate", "gzip", "lzma", "xz", "zlib", "zstd"]
2424

2525
# algorithms
@@ -41,8 +41,6 @@ pin-project-lite = "0.2.0"
4141
libzstd = { package = "zstd", version = "0.11.1", optional = true, default-features = false }
4242
zstd-safe = { version = "5.0.1", optional = true, default-features = false }
4343
memchr = "2.2.1"
44-
tokio-02 = { package = "tokio", version = "0.2.21", optional = true, default-features = false }
45-
tokio-03 = { package = "tokio", version = "0.3.0", optional = true, default-features = false }
4644
tokio = { version = "1.0.0", optional = true, default-features = false }
4745

4846
[dev-dependencies]
@@ -52,12 +50,8 @@ rand = "0.8.5"
5250
futures = "0.3.5"
5351
futures-test = "0.3.5"
5452
ntest = "0.8.1"
55-
bytes-05 = { package = "bytes", version = "0.5.0" }
5653
bytes = "1.0.0"
57-
tokio-02 = { package = "tokio", version = "0.2.21", default-features = false, features = ["io-util", "stream", "macros", "io-std"] }
58-
tokio-03 = { package = "tokio", version = "0.3.0", default-features = false, features = ["io-util", "stream"] }
59-
tokio = { version = "1.0.0", default-features = false, features = ["io-util"] }
60-
tokio-util-04 = { package = "tokio-util", version = "0.4.0", default-features = false, features = ["io"] }
54+
tokio = { version = "1.0.0", default-features = false, features = ["io-util", "macros", "rt-multi-thread", "io-std"] }
6155
tokio-util-06 = { package = "tokio-util", version = "0.6.0", default-features = false, features = ["io"] }
6256

6357
[[test]]
@@ -93,9 +87,9 @@ name = "zstd"
9387
required-features = ["zstd"]
9488

9589
[[example]]
96-
name = "zlib_tokio_02_write"
97-
required-features = ["zlib", "tokio-02"]
90+
name = "zlib_tokio_write"
91+
required-features = ["zlib", "tokio"]
9892

9993
[[example]]
10094
name = "zstd_gzip"
101-
required-features = ["zstd", "gzip", "tokio-02"]
95+
required-features = ["zstd", "gzip", "tokio"]

examples/zlib_tokio_02_write.rs renamed to examples/zlib_tokio_write.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
use async_compression::tokio_02::write::ZlibDecoder;
2-
use async_compression::tokio_02::write::ZlibEncoder;
1+
use async_compression::tokio::write::ZlibDecoder;
2+
use async_compression::tokio::write::ZlibEncoder;
33

44
use std::io::Result;
5-
use tokio_02::io::AsyncWriteExt as _; // for `write_all` and `shutdown`
5+
use tokio::io::AsyncWriteExt as _; // for `write_all` and `shutdown`
66

7-
use tokio_02 as tokio; // this enable the tokio main macro
8-
#[tokio_02::main]
7+
#[tokio::main]
98
async fn main() -> Result<()> {
109
let data = b"example";
1110
let compressed_data = compress(data).await?;

examples/zstd_gzip.rs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
use async_compression::tokio_02::bufread::ZstdDecoder;
2-
use async_compression::tokio_02::write::GzipEncoder;
1+
use async_compression::tokio::bufread::ZstdDecoder;
2+
use async_compression::tokio::write::GzipEncoder;
33

44
use std::io::Result;
5-
use tokio_02::io::stderr;
6-
use tokio_02::io::stdin;
7-
use tokio_02::io::stdout;
8-
use tokio_02::io::AsyncReadExt as _; // for `read_to_end`
9-
use tokio_02::io::AsyncWriteExt as _; // for `write_all` and `shutdown`
10-
use tokio_02::io::BufReader;
5+
use tokio::io::stderr;
6+
use tokio::io::stdin;
7+
use tokio::io::stdout;
8+
use tokio::io::AsyncReadExt as _; // for `read_to_end`
9+
use tokio::io::AsyncWriteExt as _; // for `write_all` and `shutdown`
10+
use tokio::io::BufReader;
1111

1212
// Run this example by running the following in the terminal:
1313
// ```
1414
// echo 'example' | zstd | cargo run --example zstd_gzip --features="all" | gunzip -c ─╯
1515
// ```
1616

17-
use tokio_02 as tokio; // this enable the tokio main macro
18-
#[tokio_02::main]
17+
#[tokio::main]
1918
async fn main() -> Result<()> {
2019
// Read zstd encoded data from stdin and decode
2120
let mut reader = ZstdDecoder::new(BufReader::new(stdin()));

src/lib.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,6 @@
3737
not(feature = "futures-io"),
3838
doc = "`futures-io` (*inactive*) | `futures::io::AsyncBufRead`, `futures::io::AsyncWrite`"
3939
)]
40-
#![cfg_attr(
41-
feature = "tokio-02",
42-
doc = "[`tokio-02`](crate::tokio_02) | [`tokio::io::AsyncBufRead`](::tokio_02::io::AsyncBufRead), [`tokio::io::AsyncWrite`](::tokio_02::io::AsyncWrite)"
43-
)]
44-
#![cfg_attr(
45-
not(feature = "tokio-02"),
46-
doc = "`tokio-02` (*inactive*) | `tokio::io::AsyncBufRead`, `tokio::io::AsyncWrite`"
47-
)]
48-
#![cfg_attr(
49-
feature = "tokio-03",
50-
doc = "[`tokio-03`](crate::tokio_03) | [`tokio::io::AsyncBufRead`](::tokio_03::io::AsyncBufRead), [`tokio::io::AsyncWrite`](::tokio_03::io::AsyncWrite)"
51-
)]
52-
#![cfg_attr(
53-
not(feature = "tokio-03"),
54-
doc = "`tokio-03` (*inactive*) | `tokio::io::AsyncBufRead`, `tokio::io::AsyncWrite`"
55-
)]
5640
#![cfg_attr(
5741
feature = "tokio",
5842
doc = "[`tokio`](crate::tokio) | [`tokio::io::AsyncBufRead`](::tokio::io::AsyncBufRead), [`tokio::io::AsyncWrite`](::tokio::io::AsyncWrite)"
@@ -156,12 +140,6 @@ pub mod futures;
156140
#[cfg(feature = "tokio")]
157141
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
158142
pub mod tokio;
159-
#[cfg(feature = "tokio-02")]
160-
#[cfg_attr(docsrs, doc(cfg(feature = "tokio-02")))]
161-
pub mod tokio_02;
162-
#[cfg(feature = "tokio-03")]
163-
#[cfg_attr(docsrs, doc(cfg(feature = "tokio-03")))]
164-
pub mod tokio_03;
165143

166144
mod unshared;
167145
mod util;

0 commit comments

Comments
 (0)