diff options
Diffstat (limited to 'crates/rebel-parse/src/ast/expr.rs')
-rw-r--r-- | crates/rebel-parse/src/ast/expr.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/rebel-parse/src/ast/expr.rs b/crates/rebel-parse/src/ast/expr.rs index 6899903..69c4407 100644 --- a/crates/rebel-parse/src/ast/expr.rs +++ b/crates/rebel-parse/src/ast/expr.rs @@ -200,9 +200,9 @@ impl<'a> Literal<'a> { Ok(()) } Literal::Struct(entries) => { - let mut keys = HashSet::new(); - for StructField { key, value } in entries { - if !keys.insert(key) { + let mut fields = HashSet::new(); + for StructField { name, value } in entries { + if !fields.insert(name) { return Err(ValidationError::DuplicateKey); } value.validate()?; @@ -238,7 +238,7 @@ impl<'a> TryFrom<&token::StrPiece<'a>> for StrPiece<'a> { #[derive(Debug, Clone, PartialEq, Eq)] pub struct StructField<'a> { - pub key: &'a str, + pub name: &'a str, pub value: Expr<'a>, } |