aboutsummaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-03-14 12:00:23 +0100
committerAlex Auvolat <alex@adnab.me>2022-03-14 12:27:49 +0100
commitba6b56ae68d5842d814769418d484093865261aa (patch)
tree2620aadaa46718680ba6e66946ca487839335f56 /src/api
parent0af314b295f70fdf107524b08063f4d36fb4eeb6 (diff)
downloadgarage-fix-resync.tar.gz
garage-fix-resync.zip
Fix some new clippy lintsfix-resync
Diffstat (limited to 'src/api')
-rw-r--r--src/api/s3_cors.rs7
-rw-r--r--src/api/s3_list.rs6
-rw-r--r--src/api/s3_website.rs3
-rw-r--r--src/api/signature/payload.rs2
4 files changed, 6 insertions, 12 deletions
diff --git a/src/api/s3_cors.rs b/src/api/s3_cors.rs
index e3deaeda..ab77e23a 100644
--- a/src/api/s3_cors.rs
+++ b/src/api/s3_cors.rs
@@ -200,12 +200,7 @@ pub fn find_matching_cors_rule<'a>(
None => vec![],
};
return Ok(cors_config.iter().find(|rule| {
- cors_rule_matches(
- rule,
- origin,
- &req.method().to_string(),
- request_headers.iter(),
- )
+ cors_rule_matches(rule, origin, req.method().as_ref(), request_headers.iter())
}));
}
}
diff --git a/src/api/s3_list.rs b/src/api/s3_list.rs
index 92998159..5852fc1b 100644
--- a/src/api/s3_list.rs
+++ b/src/api/s3_list.rs
@@ -1042,12 +1042,12 @@ mod tests {
query.common.prefix = "a/".to_string();
assert_eq!(
- common_prefix(&objs.get(0).unwrap(), &query.common),
+ common_prefix(objs.get(0).unwrap(), &query.common),
Some("a/b/")
);
query.common.prefix = "a/b/".to_string();
- assert_eq!(common_prefix(&objs.get(0).unwrap(), &query.common), None);
+ assert_eq!(common_prefix(objs.get(0).unwrap(), &query.common), None);
}
#[test]
@@ -1272,7 +1272,7 @@ mod tests {
Version {
bucket_id: uuid,
key: "a".to_string(),
- uuid: uuid,
+ uuid,
deleted: false.into(),
blocks: crdt::Map::<VersionBlockKey, VersionBlock>::from_iter(blocks),
parts_etags: crdt::Map::<u64, String>::from_iter(etags),
diff --git a/src/api/s3_website.rs b/src/api/s3_website.rs
index 9d1da905..b464dd45 100644
--- a/src/api/s3_website.rs
+++ b/src/api/s3_website.rs
@@ -259,8 +259,7 @@ impl RoutingRuleInner {
let has_prefix = self
.condition
.as_ref()
- .map(|c| c.prefix.as_ref())
- .flatten()
+ .and_then(|c| c.prefix.as_ref())
.is_some();
self.redirect.validate(has_prefix)
}
diff --git a/src/api/signature/payload.rs b/src/api/signature/payload.rs
index 85687a23..88b58922 100644
--- a/src/api/signature/payload.rs
+++ b/src/api/signature/payload.rs
@@ -51,7 +51,7 @@ pub async fn check_payload_signature(
let canonical_request = canonical_request(
request.method(),
- &request.uri().path().to_string(),
+ request.uri().path(),
&canonical_query_string(request.uri()),
&headers,
&authorization.signed_headers,