From a7f1cdc55622d2539e5418e89f11b60a7e6c13fb Mon Sep 17 00:00:00 2001 From: alexion Date: Sat, 19 Sep 2026 23:26:59 -0400 Subject: [PATCH] refactor(xatu): rename binding value expression --- src/xatu/ast.rs | 4 ++-- src/xatu/parser.rs | 2 +- src/xatu/rules/manual_inherit.rs | 2 +- src/xatu/rules/manual_inherit_from.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/xatu/ast.rs b/src/xatu/ast.rs index 2380c0c..d0cce40 100644 --- a/src/xatu/ast.rs +++ b/src/xatu/ast.rs @@ -34,7 +34,7 @@ pub enum NodeData { #[derive(Debug, Clone, PartialEq, Eq)] pub struct Binding { pub key: Ident, - pub value: BindingValue, + pub value: Expr, } #[derive(Debug, Clone, PartialEq, Eq)] @@ -43,7 +43,7 @@ pub struct Ident { } #[derive(Debug, Clone, PartialEq, Eq)] -pub enum BindingValue { +pub enum Expr { Ident(Ident), Selector(Selector), } diff --git a/src/xatu/parser.rs b/src/xatu/parser.rs index 6a7ae75..015e815 100644 --- a/src/xatu/parser.rs +++ b/src/xatu/parser.rs @@ -73,7 +73,7 @@ impl TryFrom for ast::Binding { } } -impl TryFrom for ast::BindingValue { +impl TryFrom for ast::Expr { type Error = (); fn try_from(expr: rnix::ast::Expr) -> Result { diff --git a/src/xatu/rules/manual_inherit.rs b/src/xatu/rules/manual_inherit.rs index 3bca2ea..76c71c7 100644 --- a/src/xatu/rules/manual_inherit.rs +++ b/src/xatu/rules/manual_inherit.rs @@ -15,7 +15,7 @@ impl NodeRule for ManualInherit { fn check(node: &Self::Node) -> Option<&'static str> { match &node.value { - ast::BindingValue::Ident(value) if node.key == *value => { + ast::Expr::Ident(value) if node.key == *value => { Some("Use `inherit` for this assignment") } _ => None, diff --git a/src/xatu/rules/manual_inherit_from.rs b/src/xatu/rules/manual_inherit_from.rs index 02d0042..31832e9 100644 --- a/src/xatu/rules/manual_inherit_from.rs +++ b/src/xatu/rules/manual_inherit_from.rs @@ -15,7 +15,7 @@ impl NodeRule for ManualInheritFrom { fn check(node: &Self::Node) -> Option<&'static str> { match &node.value { - ast::BindingValue::Selector(selector) if node.key == selector.attr => { + ast::Expr::Selector(selector) if node.key == selector.attr => { Some("Use `inherit` for this selected attribute") } _ => None,