diff --git a/src/api/error.rs b/src/api/error.rs index 955faed1..8602cfdc 100644 --- a/src/api/error.rs +++ b/src/api/error.rs @@ -206,11 +206,7 @@ where fn ok_or_bad_request>(self, reason: M) -> Result { match self { Ok(x) => Ok(x), - Err(e) => Err(Error::BadRequest(format!( - "{}: {}", - reason.as_ref(), - e.to_string() - ))), + Err(e) => Err(Error::BadRequest(format!("{}: {}", reason.as_ref(), e))), } } } diff --git a/src/api/s3_copy.rs b/src/api/s3_copy.rs index f8b3550e..93947b78 100644 --- a/src/api/s3_copy.rs +++ b/src/api/s3_copy.rs @@ -487,7 +487,7 @@ impl CopyPreconditionHeaders { .get("x-amz-copy-source-if-modified-since") .map(|x| x.to_str()) .transpose()? - .map(|x| httpdate::parse_http_date(x)) + .map(httpdate::parse_http_date) .transpose() .ok_or_bad_request("Invalid date in x-amz-copy-source-if-modified-since")?, copy_source_if_none_match: req @@ -505,7 +505,7 @@ impl CopyPreconditionHeaders { .get("x-amz-copy-source-if-unmodified-since") .map(|x| x.to_str()) .transpose()? - .map(|x| httpdate::parse_http_date(x)) + .map(httpdate::parse_http_date) .transpose() .ok_or_bad_request("Invalid date in x-amz-copy-source-if-unmodified-since")?, }) diff --git a/src/api/s3_list.rs b/src/api/s3_list.rs index f991b07d..c3bc6938 100644 --- a/src/api/s3_list.rs +++ b/src/api/s3_list.rs @@ -121,7 +121,7 @@ pub async fn handle_list( key: uriencode_maybe(key, query.common.urlencode_resp), last_modified: s3_xml::Value(msec_to_rfc3339(info.last_modified)), size: s3_xml::IntValue(info.size as i64), - etag: s3_xml::Value(format!("\"{}\"", info.etag.to_string())), + etag: s3_xml::Value(format!("\"{}\"", info.etag)), storage_class: s3_xml::Value("STANDARD".to_string()), }) .collect(), diff --git a/src/model/helper/error.rs b/src/model/helper/error.rs index b9b515f3..30b2ba32 100644 --- a/src/model/helper/error.rs +++ b/src/model/helper/error.rs @@ -31,11 +31,7 @@ where fn ok_or_bad_request>(self, reason: M) -> Result { match self { Ok(x) => Ok(x), - Err(e) => Err(Error::BadRequest(format!( - "{}: {}", - reason.as_ref(), - e.to_string() - ))), + Err(e) => Err(Error::BadRequest(format!("{}: {}", reason.as_ref(), e))), } } }