From 09d3b7d7a2ae23a0463fadee9ae8cb6a0fa2c4bf Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 5 Aug 2020 19:29:24 +0200 Subject: align names in make --- crates/ra_syntax/src/ast/edit.rs | 2 +- crates/ra_syntax/src/ast/make.rs | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'crates/ra_syntax') diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs index 667a9294f..5ed123f91 100644 --- a/crates/ra_syntax/src/ast/edit.rs +++ b/crates/ra_syntax/src/ast/edit.rs @@ -621,7 +621,7 @@ fn single_node(element: impl Into) -> RangeInclusive ast::NameRef { ast_from_text(&format!("fn f() {{ {}; }}", text)) } -pub fn type_ref(text: &str) -> ast::Type { +pub fn ty(text: &str) -> ast::Type { ast_from_text(&format!("impl {} for D {{}};", text)) } @@ -60,11 +60,11 @@ pub fn use_tree_list(use_trees: impl IntoIterator) -> ast:: ast_from_text(&format!("use {{{}}};", use_trees)) } -pub fn use_item(use_tree: ast::UseTree) -> ast::Use { +pub fn use_(use_tree: ast::UseTree) -> ast::Use { ast_from_text(&format!("use {};", use_tree)) } -pub fn record_field(name: ast::NameRef, expr: Option) -> ast::RecordExprField { +pub fn record_expr_field(name: ast::NameRef, expr: Option) -> ast::RecordExprField { return match expr { Some(expr) => from_text(&format!("{}: {}", name, expr)), None => from_text(&name.to_string()), @@ -75,7 +75,7 @@ pub fn record_field(name: ast::NameRef, expr: Option) -> ast::RecordE } } -pub fn record_field_def(name: ast::NameRef, ty: ast::Type) -> ast::RecordField { +pub fn record_field(name: ast::NameRef, ty: ast::Type) -> ast::RecordField { ast_from_text(&format!("struct S {{ {}: {}, }}", name, ty)) } @@ -148,7 +148,7 @@ pub fn condition(expr: ast::Expr, pattern: Option) -> ast::Condition { } } -pub fn bind_pat(name: ast::Name) -> ast::IdentPat { +pub fn ident_pat(name: ast::Name) -> ast::IdentPat { return from_text(name.text()); fn from_text(text: &str) -> ast::IdentPat { @@ -156,7 +156,7 @@ pub fn bind_pat(name: ast::Name) -> ast::IdentPat { } } -pub fn placeholder_pat() -> ast::WildcardPat { +pub fn wildcard_pat() -> ast::WildcardPat { return from_text("_"); fn from_text(text: &str) -> ast::WildcardPat { @@ -288,7 +288,7 @@ pub fn visibility_pub_crate() -> ast::Visibility { ast_from_text("pub(crate) struct S") } -pub fn fn_def( +pub fn fn_( visibility: Option, fn_name: ast::Name, type_params: Option, -- cgit v1.2.3