diff --git a/fusio/Cargo.toml b/fusio/Cargo.toml index 2f14887..1ec016b 100644 --- a/fusio/Cargo.toml +++ b/fusio/Cargo.toml @@ -21,7 +21,7 @@ aws = [ ] bytes = ["dep:bytes"] completion-based = [] -default = ["aws", "dyn", "fs", "tokio", "tokio-http"] +default = ["dyn", "fs"] dyn = [] fs = ["tokio?/rt"] http = [ diff --git a/fusio/src/impls/disk/monoio/mod.rs b/fusio/src/impls/disk/monoio/mod.rs index d6c3c92..bef6569 100644 --- a/fusio/src/impls/disk/monoio/mod.rs +++ b/fusio/src/impls/disk/monoio/mod.rs @@ -1,11 +1,9 @@ #[cfg(feature = "fs")] pub mod fs; -use std::future::Future; - use monoio::fs::File; -use crate::{buf::IoBufMut, Error, IoBuf, MaybeSend, Read, Seek, Write}; +use crate::{buf::IoBufMut, Error, IoBuf, Read, Seek, Write}; #[repr(transparent)] struct MonoioBuf { diff --git a/fusio/src/impls/disk/tokio_uring/fs.rs b/fusio/src/impls/disk/tokio_uring/fs.rs index bc72c26..33df38f 100644 --- a/fusio/src/impls/disk/tokio_uring/fs.rs +++ b/fusio/src/impls/disk/tokio_uring/fs.rs @@ -3,8 +3,8 @@ use futures_core::Stream; use tokio_uring::fs::{create_dir_all, remove_file}; use crate::{ + disk::tokio_uring::TokioUringFile, fs::{FileMeta, Fs, OpenOptions, WriteMode}, - local::tokio_uring::TokioUringFile, path::{path_to_local, Path}, Error, }; diff --git a/fusio/src/impls/disk/tokio_uring/mod.rs b/fusio/src/impls/disk/tokio_uring/mod.rs index 946a578..77d3333 100644 --- a/fusio/src/impls/disk/tokio_uring/mod.rs +++ b/fusio/src/impls/disk/tokio_uring/mod.rs @@ -1,11 +1,9 @@ #[cfg(feature = "fs")] pub mod fs; -use std::future::Future; - use tokio_uring::fs::File; -use crate::{Error, IoBuf, IoBufMut, MaybeSend, Read, Seek, Write}; +use crate::{Error, IoBuf, IoBufMut, Read, Seek, Write}; #[repr(transparent)] struct TokioUringBuf { diff --git a/fusio/src/impls/remotes/aws/error.rs b/fusio/src/impls/remotes/aws/error.rs index 716c1df..91f6827 100644 --- a/fusio/src/impls/remotes/aws/error.rs +++ b/fusio/src/impls/remotes/aws/error.rs @@ -1,7 +1,6 @@ use thiserror::Error; -use crate::remotes::aws::credential::AuthorizeError; -use crate::remotes::http::HttpError; +use crate::remotes::{aws::credential::AuthorizeError, http::HttpError}; #[derive(Debug, Error)] pub enum S3Error { diff --git a/fusio/src/impls/remotes/aws/fs.rs b/fusio/src/impls/remotes/aws/fs.rs index 66ea2aa..0bd62ed 100644 --- a/fusio/src/impls/remotes/aws/fs.rs +++ b/fusio/src/impls/remotes/aws/fs.rs @@ -9,15 +9,13 @@ use http_body_util::{BodyExt, Empty}; use serde::{Deserialize, Serialize}; use url::Url; -use super::S3Error; -use super::{credential::AwsCredential, options::S3Options, S3File}; -use crate::remotes::http::HttpError; +use super::{credential::AwsCredential, options::S3Options, S3Error, S3File}; use crate::{ fs::{FileMeta, Fs, OpenOptions, WriteMode}, path::Path, remotes::{ aws::sign::Sign, - http::{DynHttpClient, HttpClient}, + http::{DynHttpClient, HttpClient, HttpError}, }, Error, }; @@ -190,10 +188,7 @@ impl Fs for AmazonS3 { .uri(url.as_str()) .body(Empty::::new()) .map_err(|e| S3Error::from(HttpError::from(e)))?; - request - .sign(&self.options) - .await - .map_err(S3Error::from)?; + request.sign(&self.options).await.map_err(S3Error::from)?; let response = self .client .send_request(request) diff --git a/fusio/src/impls/remotes/aws/s3.rs b/fusio/src/impls/remotes/aws/s3.rs index 6ef2334..d4b88af 100644 --- a/fusio/src/impls/remotes/aws/s3.rs +++ b/fusio/src/impls/remotes/aws/s3.rs @@ -9,15 +9,13 @@ use http::{ use http_body_util::{BodyExt, Empty, Full}; use percent_encoding::utf8_percent_encode; -use super::S3Error; -use super::{options::S3Options, STRICT_PATH_ENCODE_SET}; -use crate::remotes::http::HttpError; +use super::{options::S3Options, S3Error, STRICT_PATH_ENCODE_SET}; use crate::{ buf::IoBufMut, path::Path, remotes::{ aws::sign::Sign, - http::{DynHttpClient, HttpClient}, + http::{DynHttpClient, HttpClient, HttpError}, }, Error, IoBuf, Read, Seek, Write, }; diff --git a/fusio/src/impls/remotes/aws/sign.rs b/fusio/src/impls/remotes/aws/sign.rs index 62e6722..9d49ac5 100644 --- a/fusio/src/impls/remotes/aws/sign.rs +++ b/fusio/src/impls/remotes/aws/sign.rs @@ -5,8 +5,7 @@ use http_body::Body; use http_body_util::BodyExt; use ring::digest::{self, Context}; -use super::credential::AuthorizeError; -use super::{options::S3Options, CHECKSUM_HEADER}; +use super::{credential::AuthorizeError, options::S3Options, CHECKSUM_HEADER}; use crate::remotes::aws::credential::AwsAuthorizer; pub(crate) trait Sign { diff --git a/fusio/src/impls/remotes/http/tokio.rs b/fusio/src/impls/remotes/http/tokio.rs index d1c4af3..da18a51 100644 --- a/fusio/src/impls/remotes/http/tokio.rs +++ b/fusio/src/impls/remotes/http/tokio.rs @@ -3,8 +3,7 @@ use http::{Request, Response}; use http_body::Body; use super::{HttpClient, HttpError}; -use crate::error::BoxedError; -use crate::{MaybeSend, MaybeSync}; +use crate::{error::BoxedError, MaybeSend, MaybeSync}; pub struct TokioClient { client: reqwest::Client, diff --git a/fusio/src/lib.rs b/fusio/src/lib.rs index cab82cc..521215f 100644 --- a/fusio/src/lib.rs +++ b/fusio/src/lib.rs @@ -4,7 +4,7 @@ pub mod dynamic; mod error; #[cfg(feature = "fs")] pub mod fs; -pub mod impls; +mod impls; pub mod path; use std::{future::Future, io::Cursor}; @@ -177,9 +177,7 @@ impl Write for &mut W { #[cfg(test)] mod tests { - use std::future::Future; - - use super::{MaybeSend, Read, Write}; + use super::{Read, Write}; use crate::{buf::IoBufMut, Error, IoBuf, Seek}; #[allow(unused)] @@ -294,6 +292,7 @@ mod tests { } } + #[allow(unused)] async fn test_local_fs(fs: S) -> Result<(), Error> where S: crate::fs::Fs,