mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-10 22:36:53 +00:00
Fix some new clippy lints
This commit is contained in:
+1
-6
@@ -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())
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -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),
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user