Skip to content

Commit

Permalink
Even more pedantic clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Bartlett committed Dec 13, 2024
1 parent 59802db commit 834ce2c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/private/sources/policy/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ pub mod test {

let result = policy_source.fetch(policy_store_id).await.unwrap();

assert!(result.get(&policy_id_2).is_none());
assert!(!result.contains_key(&policy_id_2));
assert_eq!(
result.get(&policy_id_1).unwrap().clone(),
Policy::try_from(static_definition).unwrap()
Expand Down
2 changes: 1 addition & 1 deletion src/private/sources/template/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ pub mod test {
.await
.unwrap();

assert!(result.get(&policy_template_id_2).is_none());
assert!(!result.contains_key(&policy_template_id_2));

let Template(template_result) = result.get(&policy_template_id).unwrap();
let Template(template_copy) = Template::try_from(updated_output).unwrap();
Expand Down
8 changes: 4 additions & 4 deletions src/private/types/policy_store_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,10 @@ mod input {
#[test]
fn json_none() {
let json = json!({});
let p: PolicyStoreFiltersInput =
let filters: PolicyStoreFiltersInput =
serde_json::from_value(json).expect("Unable to parse intended format");
assert!(
matches!(p, PolicyStoreFiltersInput{principal:a,resource:b,policy_type:c,policy_template_id:d} if a.is_none() && b.is_none() && c.is_none() && d.is_none())
matches!(filters, PolicyStoreFiltersInput{principal,resource,policy_type,policy_template_id} if principal.is_none() && resource.is_none() && policy_type.is_none() && policy_template_id.is_none())
);
}

Expand Down Expand Up @@ -461,10 +461,10 @@ mod input {
#[test]
fn cli_none() {
let cli = "";
let p: PolicyStoreFiltersInput =
let filters: PolicyStoreFiltersInput =
PolicyStoreFiltersInput::from_str(cli).expect("Unable to parse intended format");
assert!(
matches!(p, PolicyStoreFiltersInput{principal:a,resource:b,policy_type:c,policy_template_id:d} if a.is_none() && b.is_none() && c.is_none() && d.is_none())
matches!(filters, PolicyStoreFiltersInput{principal,resource,policy_type,policy_template_id} if principal.is_none() && resource.is_none() && policy_type.is_none() && policy_template_id.is_none())
);
}
}
Expand Down

0 comments on commit 834ce2c

Please sign in to comment.