diff --git a/s3/src/command.rs b/s3/src/command.rs index ca0b2b10ea..0054de1054 100644 --- a/s3/src/command.rs +++ b/s3/src/command.rs @@ -171,7 +171,7 @@ pub enum Command<'a> { }, } -impl<'a> Command<'a> { +impl Command<'_> { pub fn http_verb(&self) -> HttpMethod { match *self { Command::GetObject @@ -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, diff --git a/s3/src/request/async_std_backend.rs b/s3/src/request/async_std_backend.rs index 1ac3e22005..7093503482 100644 --- a/s3/src/request/async_std_backend.rs +++ b/s3/src/request/async_std_backend.rs @@ -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; @@ -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, diff --git a/s3/src/request/blocking.rs b/s3/src/request/blocking.rs index 5b2bba0cfc..a88137b080 100644 --- a/s3/src/request/blocking.rs +++ b/s3/src/request/blocking.rs @@ -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; @@ -48,10 +48,7 @@ impl<'a> Request for AttoRequest<'a> { fn response(&self) -> Result { // 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(); @@ -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, diff --git a/s3/src/request/tokio_backend.rs b/s3/src/request/tokio_backend.rs index ffe5813a1f..a66ff11380 100644 --- a/s3/src/request/tokio_backend.rs +++ b/s3/src/request/tokio_backend.rs @@ -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; diff --git a/s3/src/serde_types.rs b/s3/src/serde_types.rs index 8936009ca6..1fe25e7d53 100644 --- a/s3/src/serde_types.rs +++ b/s3/src/serde_types.rs @@ -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 } } @@ -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