mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-04 19:29:07 +00:00
clean up naming
This commit is contained in:
parent
98639d835c
commit
efeae82f52
@ -44,7 +44,7 @@ impl Make<ast::Expr> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Make<ast::NameRef> {
|
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))
|
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);
|
let mut ast_editor = AstEditor::new(node);
|
||||||
for f in d.missed_fields.iter() {
|
for f in d.missed_fields.iter() {
|
||||||
let field = Make::<ast::RecordField>::from(
|
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()),
|
Some(Make::<ast::Expr>::unit()),
|
||||||
);
|
);
|
||||||
ast_editor.append_field(&field);
|
ast_editor.append_field(&field);
|
||||||
|
Loading…
Reference in New Issue
Block a user