Skip to content

Commit

Permalink
refactor(jans-cedarling): replace if-else with then_some
Browse files Browse the repository at this point in the history
Signed-off-by: rmarinn <[email protected]>
  • Loading branch information
rmarinn committed Jan 16, 2025
1 parent ab6c365 commit bd58549
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions jans-cedarling/cedarling/src/common/policy_store/claim_mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,10 @@ impl ClaimMappings {
.iter()
.find_map(|(claim_name, mapping)| match mapping {
ClaimMapping::Regex(regex_mapping) => {
if regex_mapping.cedar_policy_type == type_name {
Some((claim_name, mapping))
} else {
None
}
(regex_mapping.cedar_policy_type == type_name).then_some((claim_name, mapping))
},
ClaimMapping::Json { r#type } => {
if r#type == type_name {
Some((claim_name, mapping))
} else {
None
}
(r#type == type_name).then_some((claim_name, mapping))
},
})
}
Expand Down

0 comments on commit bd58549

Please sign in to comment.