Skip to content

Commit f643d45

Browse files
committed
add record_expr_field_list constructor method
1 parent eabb84b commit f643d45

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

crates/syntax/src/ast/syntax_factory/constructors.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,6 +1470,22 @@ impl SyntaxFactory {
14701470
ast
14711471
}
14721472

1473+
pub fn record_expr_field_list(
1474+
&self,
1475+
fields: impl IntoIterator<Item = ast::RecordExprField>,
1476+
) -> ast::RecordExprFieldList {
1477+
let (fields, input) = iterator_input(fields);
1478+
let ast = make::record_expr_field_list(fields).clone_for_update();
1479+
1480+
if let Some(mut mapping) = self.mappings() {
1481+
let mut builder = SyntaxMappingBuilder::new(ast.syntax().clone());
1482+
builder.map_children(input, ast.fields().map(|f| f.syntax().clone()));
1483+
builder.finish(&mut mapping);
1484+
}
1485+
1486+
ast
1487+
}
1488+
14731489
pub fn record_expr_field(
14741490
&self,
14751491
name: ast::NameRef,

0 commit comments

Comments
 (0)