Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
durch committed Mar 4, 2022
1 parent d7f3ee7 commit 7e5ecb7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
8 changes: 4 additions & 4 deletions s3/src/bucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ use crate::serde_types::{
BucketLocationResult, CompleteMultipartUploadData, HeadObjectResult,
InitiateMultipartUploadResponse, ListBucketResult, ListMultipartUploadsResult, Part,
};
use crate::utils::error_from_response_data;
use anyhow::anyhow;
use anyhow::Result;
use http::header::HeaderName;
use http::HeaderMap;
use crate::utils::error_from_response_data;

pub const CHUNK_SIZE: usize = 8_388_608; // 8 Mebibytes, min is 5 (5_242_880);

Expand Down Expand Up @@ -758,7 +758,7 @@ impl Bucket {
if first_chunk.len() < CHUNK_SIZE {
let (data, code) = self.put_object(s3_path, first_chunk.as_slice()).await?;
if code >= 300 {
return Err(error_from_response_data(data, code))
return Err(error_from_response_data(data, code));
}
return Ok(code);
}
Expand All @@ -767,7 +767,7 @@ impl Bucket {
let request = RequestImpl::new(self, s3_path, command);
let (data, code) = request.response_data(false).await?;
if code >= 300 {
return Err(error_from_response_data(data, code))
return Err(error_from_response_data(data, code));
}

let msg: InitiateMultipartUploadResponse =
Expand Down Expand Up @@ -828,7 +828,7 @@ impl Bucket {
let request = RequestImpl::new(self, s3_path, command);
let (data, code) = request.response_data(false)?;
if code >= 300 {
return Err(error_from_response_data(data, code))
return Err(error_from_response_data(data, code));
}
let msg: InitiateMultipartUploadResponse =
serde_xml::from_str(std::str::from_utf8(data.as_slice())?)?;
Expand Down
5 changes: 1 addition & 4 deletions s3/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,7 @@ pub(crate) fn error_from_response_data(data: Vec<u8>, code: u16) -> anyhow::Erro
code
)
};
anyhow::Error::new(std::io::Error::new(
std::io::ErrorKind::InvalidData,
err,
))
anyhow::Error::new(std::io::Error::new(std::io::ErrorKind::InvalidData, err))
}

#[cfg(test)]
Expand Down

0 comments on commit 7e5ecb7

Please sign in to comment.