Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: apply clippy lints #416

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions s3/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ pub enum Command<'a> {
},
}

impl<'a> Command<'a> {
impl Command<'_> {
pub fn http_verb(&self) -> HttpMethod {
match *self {
Command::GetObject
Expand Down Expand Up @@ -224,11 +224,9 @@ impl<'a> Command<'a> {
}
}
Command::PutBucketLifecycle { configuration } => {
quick_xml::se::to_string(configuration)?.as_bytes().len()
}
Command::PutBucketCors { configuration, .. } => {
configuration.to_string().as_bytes().len()
quick_xml::se::to_string(configuration)?.len()
}
Command::PutBucketCors { configuration, .. } => configuration.to_string().len(),
Command::HeadObject => 0,
Command::DeleteObject => 0,
Command::DeleteObjectTagging => 0,
Expand Down
4 changes: 2 additions & 2 deletions s3/src/request/async_std_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub struct SurfRequest<'a> {
}

#[maybe_async]
impl<'a> Request for SurfRequest<'a> {
impl Request for SurfRequest<'_> {
type Response = surf::Response;
type HeaderMap = HeaderMap;

Expand Down Expand Up @@ -171,7 +171,7 @@ impl<'a> Request for SurfRequest<'a> {
}
}

impl<'a> SurfRequest<'a> {
impl SurfRequest<'_> {
pub async fn new<'b>(
bucket: &'b Bucket,
path: &'b str,
Expand Down
9 changes: 3 additions & 6 deletions s3/src/request/blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub struct AttoRequest<'a> {
pub sync: bool,
}

impl<'a> Request for AttoRequest<'a> {
impl Request for AttoRequest<'_> {
type Response = attohttpc::Response;
type HeaderMap = attohttpc::header::HeaderMap;

Expand All @@ -48,10 +48,7 @@ impl<'a> Request for AttoRequest<'a> {

fn response(&self) -> Result<Self::Response, S3Error> {
// Build headers
let headers = match self.headers() {
Ok(headers) => headers,
Err(e) => return Err(e),
};
let headers = self.headers()?;

let mut session = attohttpc::Session::new();

Expand Down Expand Up @@ -128,7 +125,7 @@ impl<'a> Request for AttoRequest<'a> {
}
}

impl<'a> AttoRequest<'a> {
impl AttoRequest<'_> {
pub fn new<'b>(
bucket: &'b Bucket,
path: &'b str,
Expand Down
2 changes: 1 addition & 1 deletion s3/src/request/tokio_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub struct ReqwestRequest<'a> {
}

#[maybe_async]
impl<'a> Request for ReqwestRequest<'a> {
impl Request for ReqwestRequest<'_> {
type Response = reqwest::Response;
type HeaderMap = reqwest::header::HeaderMap;

Expand Down
6 changes: 3 additions & 3 deletions s3/src/serde_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ impl fmt::Display for CompleteMultipartUploadData {

impl CompleteMultipartUploadData {
pub fn len(&self) -> usize {
self.to_string().as_bytes().len()
self.to_string().len()
}

pub fn is_empty(&self) -> bool {
self.to_string().as_bytes().len() == 0
self.to_string().len() == 0
}
}

Expand Down Expand Up @@ -235,7 +235,7 @@ pub struct ListBucketResult {
/// Specifies whether (true) or not (false) all of the results were returned.
/// If the number of results exceeds that specified by MaxKeys, all of the results
/// might not be returned.

///
/// When the response is truncated (that is, the IsTruncated element value in the response
/// is true), you can use the key name in in 'next_continuation_token' as a marker in the
/// subsequent request to get next set of objects. Amazon S3 lists objects in UTF-8 character
Expand Down