From 25fca0475343170b8398f5c87c76c455205ed3c4 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 25 Sep 2019 15:09:03 +0300 Subject: cleaned up record field builder --- crates/ra_ide_api/src/diagnostics.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/ra_ide_api') diff --git a/crates/ra_ide_api/src/diagnostics.rs b/crates/ra_ide_api/src/diagnostics.rs index 30b95a215..6602fd27e 100644 --- a/crates/ra_ide_api/src/diagnostics.rs +++ b/crates/ra_ide_api/src/diagnostics.rs @@ -59,7 +59,9 @@ pub(crate) fn diagnostics(db: &RootDatabase, file_id: FileId) -> Vec let node = d.ast(db); let mut ast_editor = AstEditor::new(node); for f in d.missed_fields.iter() { - ast_editor.append_field(&AstBuilder::::from_name(f)); + let name_ref = AstBuilder::::new(&f.to_string()); + let unit = AstBuilder::::unit(); + ast_editor.append_field(&AstBuilder::::from_pieces(name_ref, Some(unit))); } let mut builder = TextEditBuilder::default(); -- cgit v1.2.3