diff --git a/src/xatu/ast.rs b/src/xatu/ast.rs index d0cce40..1deb464 100644 --- a/src/xatu/ast.rs +++ b/src/xatu/ast.rs @@ -45,11 +45,11 @@ pub struct Ident { #[derive(Debug, Clone, PartialEq, Eq)] pub enum Expr { Ident(Ident), - Selector(Selector), + Select(Select), } #[derive(Debug, Clone, PartialEq, Eq)] -pub struct Selector { +pub struct Select { pub receiver: String, pub attr: Ident, } diff --git a/src/xatu/parser.rs b/src/xatu/parser.rs index 015e815..61545c3 100644 --- a/src/xatu/parser.rs +++ b/src/xatu/parser.rs @@ -79,7 +79,7 @@ impl TryFrom for ast::Expr { fn try_from(expr: rnix::ast::Expr) -> Result { match expr { rnix::ast::Expr::Ident(ident) => Ok(Self::Ident(ident.into())), - rnix::ast::Expr::Select(select) => Ok(Self::Selector(select.try_into()?)), + rnix::ast::Expr::Select(select) => Ok(Self::Select(select.try_into()?)), _ => Err(()), } } @@ -93,7 +93,7 @@ impl From for ast::Ident { } } -impl TryFrom for ast::Selector { +impl TryFrom for ast::Select { type Error = (); fn try_from(select: rnix::ast::Select) -> Result { diff --git a/src/xatu/rules/manual_inherit_from.rs b/src/xatu/rules/manual_inherit_from.rs index 31832e9..5d8717a 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::Expr::Selector(selector) if node.key == selector.attr => { + ast::Expr::Select(select) if node.key == select.attr => { Some("Use `inherit` for this selected attribute") } _ => None,