Skip to content

Commit

Permalink
Fix CI errors and reduce deps
Browse files Browse the repository at this point in the history
Signed-off-by: John Nunley <dev@notgull.net>
  • Loading branch information
notgull authored and Majored committed Dec 22, 2023
1 parent de80fce commit 442152a
Show file tree
Hide file tree
Showing 19 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion examples/actix_multipart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mod inner {
use actix_web::{web, App, HttpServer, Responder, ResponseError, Result};
use derive_more::{Display, Error};
use futures::StreamExt;
use futures_util::io::AsyncWriteExt;
use futures_lite::io::AsyncWriteExt;
use tokio::fs::File;
use uuid::Uuid;

Expand Down
2 changes: 1 addition & 1 deletion examples/cli_compress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mod inner {
use std::path::{Path, PathBuf};

use anyhow::{anyhow, bail, Result};
use futures_util::io::AsyncReadExt;
use futures_lite::io::AsyncReadExt;
use tokio::fs::File;

async fn run() -> Result<()> {
Expand Down
2 changes: 1 addition & 1 deletion examples/file_extraction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async fn unzip_file(archive: File, out_dir: &Path) {
.open(&path)
.await
.expect("Failed to create extracted file");
futures_util::io::copy(&mut entry_reader, &mut writer.compat_write())
futures_lite::io::copy(&mut entry_reader, &mut writer.compat_write())
.await
.expect("Failed to copy to extracted file");

Expand Down
2 changes: 1 addition & 1 deletion src/base/read/io/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//! of a better algorithm for this (and have tested/verified its performance).

#[cfg(doc)]
use futures_util::io::BufReader;
use futures_lite::io::BufReader;

use crate::error::{Result as ZipResult, ZipError};
use crate::spec::consts::{EOCDR_LENGTH, EOCDR_SIGNATURE, SIGNATURE_LENGTH};
Expand Down
4 changes: 2 additions & 2 deletions src/base/read/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! ```no_run
//! # use async_zip::base::read::mem::ZipFileReader;
//! # use async_zip::error::Result;
//! # use futures_util::io::AsyncReadExt;
//! # use futures_lite::io::AsyncReadExt;
//! #
//! async fn run() -> Result<()> {
//! let reader = ZipFileReader::new(Vec::new()).await?;
Expand All @@ -43,7 +43,7 @@
//! ```no_run
//! # use async_zip::base::read::mem::ZipFileReader;
//! # use async_zip::error::Result;
//! # use futures_util::io::AsyncReadExt;
//! # use futures_lite::io::AsyncReadExt;
//! #
//! async fn run() -> Result<()> {
//! let reader = ZipFileReader::new(Vec::new()).await?;
Expand Down
2 changes: 1 addition & 1 deletion src/base/read/seek.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! ```no_run
//! # use async_zip::base::read::seek::ZipFileReader;
//! # use async_zip::error::Result;
//! # use futures_util::io::AsyncReadExt;
//! # use futures_lite::io::AsyncReadExt;
//! # use tokio::fs::File;
//! # use tokio_util::compat::TokioAsyncReadCompatExt;
//! #
Expand Down
2 changes: 1 addition & 1 deletion src/base/read/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//!
//! # Example
//! ```no_run
//! # use futures_util::io::Cursor;
//! # use futures_lite::io::Cursor;
//! # use async_zip::error::Result;
//! # use async_zip::base::read::stream::ZipFileReader;
//! #
Expand Down
2 changes: 1 addition & 1 deletion src/base/write/entry_whole.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::spec::{
};
use crate::StringEncoding;
#[cfg(any(feature = "deflate", feature = "bzip2", feature = "zstd", feature = "lzma", feature = "xz"))]
use futures_util::io::Cursor;
use futures_lite::io::Cursor;

use crate::spec::consts::{NON_ZIP64_MAX_NUM_FILES, NON_ZIP64_MAX_SIZE};
#[cfg(any(feature = "deflate", feature = "bzip2", feature = "zstd", feature = "lzma", feature = "xz"))]
Expand Down
2 changes: 1 addition & 1 deletion src/base/write/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//! # use async_zip::{Compression, ZipEntryBuilder, base::write::ZipFileWriter};
//! # use std::io::Cursor;
//! # use async_zip::error::ZipError;
//! # use futures_util::io::AsyncWriteExt;
//! # use futures_lite::io::AsyncWriteExt;
//! # use tokio_util::compat::TokioAsyncWriteCompatExt;
//! #
//! # async fn run() -> Result<(), ZipError> {
Expand Down
2 changes: 1 addition & 1 deletion src/spec/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ mod tests {
0x50, 0x4B, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x6F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
0x00, 0x00,
];
let mut cursor = futures_util::io::Cursor::new(eocdl);
let mut cursor = futures_lite::io::Cursor::new(eocdl);
let zip64eocdl = Zip64EndOfCentralDirectoryLocator::try_from_reader(&mut cursor).await.unwrap().unwrap();
assert_eq!(
zip64eocdl,
Expand Down
2 changes: 1 addition & 1 deletion src/tests/read/compression/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ macro_rules! compressed_test_helper {
#[cfg(test)]
#[tokio::test]
async fn $name() {
use futures_util::io::{AsyncReadExt, Cursor};
use futures_lite::io::{AsyncReadExt, Cursor};

let data = $data;
let data_raw = $data_raw;
Expand Down
6 changes: 3 additions & 3 deletions src/tests/read/locator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn search_two_byte_test() {

#[tokio::test]
async fn locator_empty_test() {
use futures_util::io::Cursor;
use futures_lite::io::Cursor;

let data = &include_bytes!("empty.zip");
let mut cursor = Cursor::new(data);
Expand All @@ -41,7 +41,7 @@ async fn locator_empty_test() {

#[tokio::test]
async fn locator_empty_max_comment_test() {
use futures_util::io::Cursor;
use futures_lite::io::Cursor;

let data = &include_bytes!("empty-with-max-comment.zip");
let mut cursor = Cursor::new(data);
Expand All @@ -53,7 +53,7 @@ async fn locator_empty_max_comment_test() {

#[tokio::test]
async fn locator_buffer_boundary_test() {
use futures_util::io::Cursor;
use futures_lite::io::Cursor;

let data = &include_bytes!("empty-buffer-boundary.zip");
let mut cursor = Cursor::new(data);
Expand Down
2 changes: 1 addition & 1 deletion src/tests/read/zip64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright (c) 2023 Cognite AS
// MIT License (https://github.com/Majored/rs-async-zip/blob/main/LICENSE)

use futures_util::io::AsyncReadExt;
use futures_lite::io::AsyncReadExt;

use crate::tests::init_logger;

Expand Down
2 changes: 1 addition & 1 deletion src/tests/write/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2022 Harry [Majored] [hello@majored.pw]
// MIT License (https://github.com/Majored/rs-async-zip/blob/main/LICENSE)

use futures_util::io::AsyncWrite;
use futures_lite::io::AsyncWrite;
use std::io::Error;
use std::pin::Pin;
use std::task::{Context, Poll};
Expand Down
4 changes: 2 additions & 2 deletions src/tests/write/offset/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use crate::base::write::io::offset::AsyncOffsetWriter;

#[tokio::test]
async fn basic() {
use futures_util::io::AsyncWriteExt;
use futures_util::io::Cursor;
use futures_lite::io::AsyncWriteExt;
use futures_lite::io::Cursor;

let mut writer = AsyncOffsetWriter::new(Cursor::new(Vec::new()));
assert_eq!(writer.offset(), 0);
Expand Down
4 changes: 2 additions & 2 deletions src/tests/write/zip64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::{Compression, ZipEntryBuilder};
use std::io::Read;

use crate::spec::header::ExtraField;
use futures_util::io::AsyncWriteExt;
use futures_lite::io::AsyncWriteExt;

// Useful constants for writing a large file.
const BATCH_SIZE: usize = 100_000;
Expand Down Expand Up @@ -100,7 +100,7 @@ async fn test_write_large_zip64_file() {
/// Test writing a file, and reading it with async-zip
#[tokio::test]
async fn test_write_large_zip64_file_self_read() {
use futures_util::io::AsyncReadExt;
use futures_lite::io::AsyncReadExt;

init_logger();

Expand Down
6 changes: 3 additions & 3 deletions src/tokio/read/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! ```no_run
//! # use async_zip::tokio::read::fs::ZipFileReader;
//! # use async_zip::error::Result;
//! # use futures_util::io::AsyncReadExt;
//! # use futures_lite::io::AsyncReadExt;
//! #
//! async fn run() -> Result<()> {
//! let reader = ZipFileReader::new("./foo.zip").await?;
Expand All @@ -43,7 +43,7 @@
//! ```no_run
//! # use async_zip::tokio::read::fs::ZipFileReader;
//! # use async_zip::error::Result;
//! # use futures_util::io::AsyncReadExt;
//! # use futures_lite::io::AsyncReadExt;
//! #
//! async fn run() -> Result<()> {
//! let reader = ZipFileReader::new("./foo.zip").await?;
Expand Down Expand Up @@ -77,7 +77,7 @@ use crate::file::ZipFile;
use std::path::{Path, PathBuf};
use std::sync::Arc;

use futures_util::io::BufReader;
use futures_lite::io::BufReader;
use tokio::fs::File;
use tokio_util::compat::{Compat, TokioAsyncReadCompatExt};

Expand Down
2 changes: 1 addition & 1 deletion tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use async_zip::base::read::seek;
use async_zip::base::write::ZipFileWriter;
use async_zip::Compression;
use async_zip::ZipEntryBuilder;
use futures_util::io::AsyncWriteExt;
use futures_lite::io::AsyncWriteExt;
use tokio::fs::File;
use tokio_util::compat::TokioAsyncReadCompatExt;

Expand Down
2 changes: 1 addition & 1 deletion tests/compress_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// MIT License (https://github.com/Majored/rs-async-zip/blob/main/LICENSE)

use async_zip::{Compression, ZipEntryBuilder, ZipString};
use futures_util::AsyncWriteExt;
use futures_lite::AsyncWriteExt;

mod common;

Expand Down

0 comments on commit 442152a

Please sign in to comment.