aboutsummaryrefslogtreecommitdiff
path: root/src/api/s3/put.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-05-13 19:49:04 +0200
committerAlex Auvolat <alex@adnab.me>2022-05-13 19:49:04 +0200
commitec50ffac42f90496495b054fad568a8553cffb64 (patch)
treeb13bbc3cdc7e22d746a732e03d14814acfbc8927 /src/api/s3/put.rs
parentd7736cb614564d5bf5d501d4cf473ea98889d239 (diff)
downloadgarage-ec50ffac42f90496495b054fad568a8553cffb64.tar.gz
garage-ec50ffac42f90496495b054fad568a8553cffb64.zip
Remove useless string conversions
Diffstat (limited to 'src/api/s3/put.rs')
-rw-r--r--src/api/s3/put.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/api/s3/put.rs b/src/api/s3/put.rs
index 660a8858..8b06ef3f 100644
--- a/src/api/s3/put.rs
+++ b/src/api/s3/put.rs
@@ -184,7 +184,7 @@ fn ensure_checksum_matches(
if let Some(expected_sha256) = content_sha256 {
if expected_sha256 != data_sha256sum {
return Err(Error::bad_request(
- "Unable to validate x-amz-content-sha256".to_string(),
+ "Unable to validate x-amz-content-sha256",
));
} else {
trace!("Successfully validated x-amz-content-sha256");
@@ -192,9 +192,7 @@ fn ensure_checksum_matches(
}
if let Some(expected_md5) = content_md5 {
if expected_md5.trim_matches('"') != base64::encode(data_md5sum) {
- return Err(Error::bad_request(
- "Unable to validate content-md5".to_string(),
- ));
+ return Err(Error::bad_request("Unable to validate content-md5"));
} else {
trace!("Successfully validated content-md5");
}
@@ -513,7 +511,7 @@ pub async fn handle_complete_multipart_upload(
let version = version.ok_or(Error::NoSuchKey)?;
if version.blocks.is_empty() {
- return Err(Error::bad_request("No data was uploaded".to_string()));
+ return Err(Error::bad_request("No data was uploaded"));
}
let headers = match object_version.state {