From 392874038d2ac78796bd8bdceaee6ce18e11c648 Mon Sep 17 00:00:00 2001 From: mo khan Date: Wed, 9 Jul 2025 17:40:28 -0600 Subject: refactor: use map_or instead of match expression --- src/authorization/cedar_authorizer.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/authorization/cedar_authorizer.rs') 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)?); } } -- cgit v1.2.3