Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for tokio 0.2 and 0.3 #152

Merged
merged 2 commits into from
May 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0),

## Unreleased

- Remove deprecated `stream`, `futures-bufread` and `futures-write` features.
- Remove Tokio 0.2.x and 0.3.x support (`tokio-02` and `tokio-03` features).

## 0.3.15 - 2022-10-08

- `Level::Default::into_zstd()` now returns libzstd's default value `3`.
Expand Down
141 changes: 34 additions & 107 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 5 additions & 20 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ rustdoc-args = ["--cfg", "docsrs"]
# groups
default = []
all = ["all-implementations", "all-algorithms"]
all-implementations = ["futures-io", "stream", "tokio-02", "tokio-03", "tokio"]
all-implementations = ["futures-io", "tokio"]
all-algorithms = ["brotli", "bzip2", "deflate", "gzip", "lzma", "xz", "zlib", "zstd"]

# algorithms
Expand All @@ -30,15 +30,9 @@ xz = ["xz2"]
zlib = ["flate2"]
zstd = ["libzstd", "zstd-safe"]

# deprecated
stream = ["bytes-05"]
futures-bufread = ["futures-io"]
futures-write = ["futures-io"]

[dependencies]
xz2 = { version = "0.1.6", optional = true }
brotli = { version = "3.3.0", optional = true, default-features = false, features = ["std"] }
bytes-05 = { package = "bytes", version = "0.5.0", optional = true }
bzip2 = { version = "0.4.1" , optional = true }
flate2 = { version = "1.0.11", optional = true }
futures-core = { version = "0.3.0", default-features = false }
Expand All @@ -47,8 +41,6 @@ pin-project-lite = "0.2.0"
libzstd = { package = "zstd", version = "0.11.1", optional = true, default-features = false }
zstd-safe = { version = "5.0.1", optional = true, default-features = false }
memchr = "2.2.1"
tokio-02 = { package = "tokio", version = "0.2.21", optional = true, default-features = false }
tokio-03 = { package = "tokio", version = "0.3.0", optional = true, default-features = false }
tokio = { version = "1.0.0", optional = true, default-features = false }

[dev-dependencies]
Expand All @@ -58,15 +50,8 @@ rand = "0.8.5"
futures = "0.3.5"
futures-test = "0.3.5"
ntest = "0.8.1"
bytes-05 = { package = "bytes", version = "0.5.0" }
bytes-06 = { package = "bytes", version = "0.6.0" }
bytes = "1.0.0"
tokio-02 = { package = "tokio", version = "0.2.21", default-features = false, features = ["io-util", "stream", "macros", "io-std"] }
tokio-03 = { package = "tokio", version = "0.3.0", default-features = false, features = ["io-util", "stream"] }
tokio = { version = "1.0.0", default-features = false, features = ["io-util"] }
tokio-util-03 = { package = "tokio-util", version = "0.3.0", default-features = false, features = ["codec"] }
tokio-util-04 = { package = "tokio-util", version = "0.4.0", default-features = false, features = ["io"] }
tokio-util-05 = { package = "tokio-util", version = "0.5.0", default-features = false, features = ["io"] }
tokio = { version = "1.0.0", default-features = false, features = ["io-util", "macros", "rt-multi-thread", "io-std"] }
tokio-util-06 = { package = "tokio-util", version = "0.6.0", default-features = false, features = ["io"] }

[[test]]
Expand Down Expand Up @@ -102,9 +87,9 @@ name = "zstd"
required-features = ["zstd"]

[[example]]
name = "zlib_tokio_02_write"
required-features = ["zlib", "tokio-02"]
name = "zlib_tokio_write"
required-features = ["zlib", "tokio"]

[[example]]
name = "zstd_gzip"
required-features = ["zstd", "gzip", "tokio-02"]
required-features = ["zstd", "gzip", "tokio"]
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use async_compression::tokio_02::write::ZlibDecoder;
use async_compression::tokio_02::write::ZlibEncoder;
use async_compression::tokio::write::ZlibDecoder;
use async_compression::tokio::write::ZlibEncoder;

use std::io::Result;
use tokio_02::io::AsyncWriteExt as _; // for `write_all` and `shutdown`
use tokio::io::AsyncWriteExt as _; // for `write_all` and `shutdown`

use tokio_02 as tokio; // this enable the tokio main macro
#[tokio_02::main]
#[tokio::main]
async fn main() -> Result<()> {
let data = b"example";
let compressed_data = compress(data).await?;
Expand Down
19 changes: 9 additions & 10 deletions examples/zstd_gzip.rs
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
use async_compression::tokio_02::bufread::ZstdDecoder;
use async_compression::tokio_02::write::GzipEncoder;
use async_compression::tokio::bufread::ZstdDecoder;
use async_compression::tokio::write::GzipEncoder;

use std::io::Result;
use tokio_02::io::stderr;
use tokio_02::io::stdin;
use tokio_02::io::stdout;
use tokio_02::io::AsyncReadExt as _; // for `read_to_end`
use tokio_02::io::AsyncWriteExt as _; // for `write_all` and `shutdown`
use tokio_02::io::BufReader;
use tokio::io::stderr;
use tokio::io::stdin;
use tokio::io::stdout;
use tokio::io::AsyncReadExt as _; // for `read_to_end`
use tokio::io::AsyncWriteExt as _; // for `write_all` and `shutdown`
use tokio::io::BufReader;

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

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