refactor(xatu): rename binding value expression

This commit is contained in:
2026-09-19 23:26:59 -04:00
parent acb91e9435
commit a7f1cdc556
4 changed files with 5 additions and 5 deletions

View File

@@ -34,7 +34,7 @@ pub enum NodeData {
#[derive(Debug, Clone, PartialEq, Eq)] #[derive(Debug, Clone, PartialEq, Eq)]
pub struct Binding { pub struct Binding {
pub key: Ident, pub key: Ident,
pub value: BindingValue, pub value: Expr,
} }
#[derive(Debug, Clone, PartialEq, Eq)] #[derive(Debug, Clone, PartialEq, Eq)]
@@ -43,7 +43,7 @@ pub struct Ident {
} }
#[derive(Debug, Clone, PartialEq, Eq)] #[derive(Debug, Clone, PartialEq, Eq)]
pub enum BindingValue { pub enum Expr {
Ident(Ident), Ident(Ident),
Selector(Selector), Selector(Selector),
} }

View File

@@ -73,7 +73,7 @@ impl TryFrom<rnix::ast::AttrpathValue> for ast::Binding {
} }
} }
impl TryFrom<rnix::ast::Expr> for ast::BindingValue { impl TryFrom<rnix::ast::Expr> for ast::Expr {
type Error = (); type Error = ();
fn try_from(expr: rnix::ast::Expr) -> Result<Self, Self::Error> { fn try_from(expr: rnix::ast::Expr) -> Result<Self, Self::Error> {

View File

@@ -15,7 +15,7 @@ impl NodeRule for ManualInherit {
fn check(node: &Self::Node) -> Option<&'static str> { fn check(node: &Self::Node) -> Option<&'static str> {
match &node.value { 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") Some("Use `inherit` for this assignment")
} }
_ => None, _ => None,

View File

@@ -15,7 +15,7 @@ impl NodeRule for ManualInheritFrom {
fn check(node: &Self::Node) -> Option<&'static str> { fn check(node: &Self::Node) -> Option<&'static str> {
match &node.value { 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") Some("Use `inherit` for this selected attribute")
} }
_ => None, _ => None,