Skip to content

Commit

Permalink
chore: reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
ethe committed Sep 30, 2024
1 parent f469e8b commit e68ea05
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 25 deletions.
2 changes: 1 addition & 1 deletion fusio/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
4 changes: 1 addition & 3 deletions fusio/src/impls/disk/monoio/mod.rs
Original file line number Diff line number Diff line change
@@ -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<B> {
Expand Down
3 changes: 1 addition & 2 deletions fusio/src/impls/remotes/aws/error.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
11 changes: 3 additions & 8 deletions fusio/src/impls/remotes/aws/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -190,10 +188,7 @@ impl Fs for AmazonS3 {
.uri(url.as_str())
.body(Empty::<Bytes>::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)
Expand Down
6 changes: 2 additions & 4 deletions fusio/src/impls/remotes/aws/s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down
3 changes: 1 addition & 2 deletions fusio/src/impls/remotes/aws/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions fusio/src/impls/remotes/http/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 2 additions & 3 deletions fusio/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,7 @@ impl<W: Write> 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)]
Expand Down Expand Up @@ -294,6 +292,7 @@ mod tests {
}
}

#[allow(unused)]
async fn test_local_fs<S>(fs: S) -> Result<(), Error>
where
S: crate::fs::Fs,
Expand Down

0 comments on commit e68ea05

Please sign in to comment.