From 875747f7ef23d19a78b17e0411640c729d5aa6ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 14:44:03 +1100 Subject: [PATCH] Bump async_zip from 0.0.12 to 0.0.13 (#949) * Bump async_zip from 0.0.12 to 0.0.13 Bumps [async_zip](https://github.com/Majored/rs-async-zip) from 0.0.12 to 0.0.13. - [Release notes](https://github.com/Majored/rs-async-zip/releases) - [Commits](https://github.com/Majored/rs-async-zip/commits) --- updated-dependencies: - dependency-name: async_zip dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Fix compilation Signed-off-by: Jiahao XU --------- Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU --- Cargo.lock | 9 +++++++-- crates/binstalk-downloader/Cargo.toml | 3 ++- .../src/download/async_extracter.rs | 2 +- .../src/download/zip_extraction.rs | 12 +++++++----- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8edb5652..f4ee5cb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,6 +68,7 @@ dependencies = [ "bzip2", "flate2", "futures-core", + "futures-io", "memchr", "pin-project-lite", "tokio", @@ -89,16 +90,18 @@ dependencies = [ [[package]] name = "async_zip" -version = "0.0.12" +version = "0.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2105142db9c6203b9dadc83b0553394589a6cb31b1449a3b46b42f47c3434d0" +checksum = "79eaa2b44cfdce59cfff6cb013c96900635085fe7c28fbcbe926c9e5ad0ddfbc" dependencies = [ "async-compression", "crc32fast", + "futures-util", "log", "pin-project", "thiserror", "tokio", + "tokio-util", ] [[package]] @@ -201,6 +204,7 @@ dependencies = [ "digest", "flate2", "futures-lite", + "futures-util", "generic-array", "httpdate", "reqwest", @@ -2459,6 +2463,7 @@ checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" dependencies = [ "bytes", "futures-core", + "futures-io", "futures-sink", "pin-project-lite", "tokio", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 34122684..f1eaa33b 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.68" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } -async_zip = { version = "0.0.12", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } +async_zip = { version = "0.0.13", features = ["deflate", "bzip2", "lzma", "zstd", "xz", "tokio"] } binstalk-types = { version = "0.3.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" @@ -20,6 +20,7 @@ compact_str = "0.7.0" digest = "0.10.6" flate2 = { version = "1.0.25", default-features = false } futures-lite = { version = "1.12.0", default-features = false } +futures-util = "0.3.27" generic-array = "0.14.6" httpdate = "1.0.2" reqwest = { version = "0.11.15", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index c04675a2..c6319f8e 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -6,7 +6,7 @@ use std::{ path::{Component, Path, PathBuf}, }; -use async_zip::read::stream::ZipFileReader; +use async_zip::tokio::read::stream::ZipFileReader; use bytes::{Bytes, BytesMut}; use futures_lite::stream::Stream; use tokio::sync::mpsc; diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index 824088d4..558d7ba9 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -3,14 +3,16 @@ use std::{ path::{Component, Path, PathBuf}, }; -use async_zip::read::stream::{Reading, ZipFileReader}; +use async_zip::{base::read::stream::Reading, tokio::read::stream::ZipFileReader}; use bytes::{Bytes, BytesMut}; use futures_lite::future::try_zip as try_join; +use futures_util::io::Take; use thiserror::Error as ThisError; use tokio::{ - io::{AsyncRead, AsyncReadExt, Take}, + io::{AsyncRead, AsyncReadExt}, sync::mpsc, }; +use tokio_util::compat::{Compat, FuturesAsyncReadCompatExt}; use super::{DownloadError, ExtractedFiles}; use crate::utils::asyncify; @@ -35,7 +37,7 @@ impl ZipError { } pub(super) async fn extract_zip_entry( - zip_reader: &mut ZipFileReader>>, + zip_reader: &mut ZipFileReader>>>, path: &Path, buf: &mut BytesMut, extracted_files: &mut ExtractedFiles, @@ -113,7 +115,7 @@ where Ok(()) }); - let read_task = copy_file_to_mpsc(zip_reader.reader(), tx, buf); + let read_task = copy_file_to_mpsc(zip_reader.reader().compat(), tx, buf); try_join( async move { write_task.await.map_err(From::from) }, @@ -131,7 +133,7 @@ where } async fn copy_file_to_mpsc( - entry_reader: &mut R, + mut entry_reader: R, tx: mpsc::Sender, buf: &mut BytesMut, ) -> Result<(), async_zip::error::ZipError>