Simplify creating TableLitElem
This commit is contained in:
parent
45caafdc38
commit
c191486864
5 changed files with 29 additions and 45 deletions
|
|
@ -144,6 +144,18 @@ impl HasSpan for TableLitElem {
|
|||
}
|
||||
}
|
||||
|
||||
impl TableLitElem {
|
||||
pub fn named(name: Ident, value: Box<Expr>, span: Span) -> Self {
|
||||
Self::Named {
|
||||
name,
|
||||
s0: Space::empty(span),
|
||||
s1: Space::empty(span),
|
||||
value,
|
||||
span,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// `'{ a, foo: b }`
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct TableLit(pub BoundedSeparated<TableLitElem>);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue