clean up naming

This commit is contained in:
Aleksey Kladov 2019-09-25 15:58:40 +03:00
parent 98639d835c
commit efeae82f52
2 changed files with 2 additions and 2 deletions

View file

@ -44,7 +44,7 @@ impl Make<ast::Expr> {
}
impl Make<ast::NameRef> {
pub fn new(text: &str) -> ast::NameRef {
pub fn from(text: &str) -> ast::NameRef {
ast_node_from_file_text(&format!("fn f() {{ {}; }}", text))
}
}

View file

@ -60,7 +60,7 @@ pub(crate) fn diagnostics(db: &RootDatabase, file_id: FileId) -> Vec<Diagnostic>
let mut ast_editor = AstEditor::new(node);
for f in d.missed_fields.iter() {
let field = Make::<ast::RecordField>::from(
Make::<ast::NameRef>::new(&f.to_string()),
Make::<ast::NameRef>::from(&f.to_string()),
Some(Make::<ast::Expr>::unit()),
);
ast_editor.append_field(&field);