Make clippy happy (again)

This commit is contained in:
Clément Renault 2023-02-09 13:21:20 +01:00
parent 4570d5bf3a
commit 764df24b7d
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4
2 changed files with 5 additions and 6 deletions

View File

@ -214,8 +214,7 @@ impl SearchRules {
map.iter()
.filter(|(pattern, _)| pattern.matches_str(index))
.max_by_key(|(pattern, _)| (pattern.is_exact(), pattern.len()))
.map(|(_, rule)| rule.clone())
.flatten()
.and_then(|(_, rule)| rule.clone())
}
}
}

View File

@ -445,7 +445,7 @@ async fn access_authorized_index_patterns() {
// use created key.
let key = response["key"].as_str().unwrap();
server.use_api_key(&key);
server.use_api_key(key);
// refer to products_1 and products with modified api key.
let index_1 = server.index("products_1");
@ -515,7 +515,7 @@ async fn raise_error_non_authorized_index_patterns() {
// use created key.
let key = response["key"].as_str().unwrap();
server.use_api_key(&key);
server.use_api_key(key);
// refer to products_1 and products_2 with modified api key.
let product_1_index = server.index("products_1");
@ -582,7 +582,7 @@ async fn pattern_indexes() {
let (response, code) = server.add_api_key(content).await;
assert_eq!(201, code, "{:?}", &response);
let key = response["key"].as_str().expect("Key is not string");
server.use_api_key(&key);
server.use_api_key(key);
// Create Index products_1 using generated api key
let products_1 = server.index("products_1");
@ -859,7 +859,7 @@ async fn lazy_create_index_from_pattern() {
// use created key.
let key = response["key"].as_str().unwrap();
server.use_api_key(&key);
server.use_api_key(key);
// try to create a index via add documents route
let index = server.index("products_1");