mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 14:28:42 +00:00
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] <support@github.com> * Fix compilation Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
4af092f848
commit
875747f7ef
4 changed files with 17 additions and 9 deletions
|
@ -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;
|
||||
|
|
|
@ -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<R>(
|
||||
zip_reader: &mut ZipFileReader<Reading<'_, Take<R>>>,
|
||||
zip_reader: &mut ZipFileReader<Reading<'_, Take<Compat<R>>>>,
|
||||
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<R: AsyncRead>(
|
||||
entry_reader: &mut R,
|
||||
mut entry_reader: R,
|
||||
tx: mpsc::Sender<Bytes>,
|
||||
buf: &mut BytesMut,
|
||||
) -> Result<(), async_zip::error::ZipError>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue