From 63d36da51231afd08ee35c62cdee3578269e4a51 Mon Sep 17 00:00:00 2001 From: Chip Black Date: Thu, 13 Feb 2025 16:09:12 -0600 Subject: [PATCH] fmt --- crates/aranya-policy-ast/src/util.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/crates/aranya-policy-ast/src/util.rs b/crates/aranya-policy-ast/src/util.rs index 1666f08..ef500f6 100644 --- a/crates/aranya-policy-ast/src/util.rs +++ b/crates/aranya-policy-ast/src/util.rs @@ -15,7 +15,10 @@ impl FactDefinition { impl FieldDefinition { /// Is this a hashable type (int, bool, string, or id)? pub fn is_hashable(&self) -> bool { - matches!(self.field_type, VType::Int | VType::Bool | VType::String | VType::Id) + matches!( + self.field_type, + VType::Int | VType::Bool | VType::String | VType::Id + ) } } @@ -23,13 +26,16 @@ impl Expression { /// Is this a literal expression? pub fn is_literal(&self) -> bool { match self { - Expression::Int(_) | Expression::String(_) | Expression::Bool(_) | Expression::EnumReference(_) => true, + Expression::Int(_) + | Expression::String(_) + | Expression::Bool(_) + | Expression::EnumReference(_) => true, Expression::Optional(o) => match o { Some(e) => e.is_literal(), None => true, - } + }, Expression::NamedStruct(s) => s.fields.iter().all(|(_, e)| e.is_literal()), _ => false, } } -} \ No newline at end of file +}