aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-09-25 13:09:03 +0100
committerAleksey Kladov <[email protected]>2019-09-25 13:09:03 +0100
commit25fca0475343170b8398f5c87c76c455205ed3c4 (patch)
tree6d756bd77bda4649a5e6ebc748e761d7551752f6 /crates/ra_ide_api
parent69689625ce4465f2d008d6543553d0d91d53dca4 (diff)
cleaned up record field builder
Diffstat (limited to 'crates/ra_ide_api')
-rw-r--r--crates/ra_ide_api/src/diagnostics.rs4
1 files changed, 3 insertions, 1 deletions
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<Diagnostic>
59 let node = d.ast(db); 59 let node = d.ast(db);
60 let mut ast_editor = AstEditor::new(node); 60 let mut ast_editor = AstEditor::new(node);
61 for f in d.missed_fields.iter() { 61 for f in d.missed_fields.iter() {
62 ast_editor.append_field(&AstBuilder::<RecordField>::from_name(f)); 62 let name_ref = AstBuilder::<ast::NameRef>::new(&f.to_string());
63 let unit = AstBuilder::<ast::Expr>::unit();
64 ast_editor.append_field(&AstBuilder::<RecordField>::from_pieces(name_ref, Some(unit)));
63 } 65 }
64 66
65 let mut builder = TextEditBuilder::default(); 67 let mut builder = TextEditBuilder::default();