summaryrefslogtreecommitdiff
path: root/src/authorization/cedar_authorizer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/authorization/cedar_authorizer.rs')
-rw-r--r--src/authorization/cedar_authorizer.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/authorization/cedar_authorizer.rs b/src/authorization/cedar_authorizer.rs
index f86bcf03..6d729772 100644
--- a/src/authorization/cedar_authorizer.rs
+++ b/src/authorization/cedar_authorizer.rs
@@ -43,11 +43,9 @@ impl CedarAuthorizer {
}
if path.is_file() {
- if let Some(extension) = path.extension() {
- if extension == "cedar" {
- let content = fs::read_to_string(&path)?;
- return Ok(cedar_policy::PolicySet::from_str(&content)?);
- }
+ if path.extension().map_or(false, |ext| ext == "cedar") {
+ let content = fs::read_to_string(&path)?;
+ return Ok(cedar_policy::PolicySet::from_str(&content)?);
}
}