mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 01:17:27 +00:00
clean up naming
This commit is contained in:
parent
98639d835c
commit
efeae82f52
2 changed files with 2 additions and 2 deletions
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue