mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
cleaned up record field builder
This commit is contained in:
parent
69689625ce
commit
25fca04753
2 changed files with 4 additions and 7 deletions
|
@ -59,7 +59,9 @@ pub(crate) fn diagnostics(db: &RootDatabase, file_id: FileId) -> Vec<Diagnostic>
|
|||
let node = d.ast(db);
|
||||
let mut ast_editor = AstEditor::new(node);
|
||||
for f in d.missed_fields.iter() {
|
||||
ast_editor.append_field(&AstBuilder::<RecordField>::from_name(f));
|
||||
let name_ref = AstBuilder::<ast::NameRef>::new(&f.to_string());
|
||||
let unit = AstBuilder::<ast::Expr>::unit();
|
||||
ast_editor.append_field(&AstBuilder::<RecordField>::from_pieces(name_ref, Some(unit)));
|
||||
}
|
||||
|
||||
let mut builder = TextEditBuilder::default();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue