From 9bf2cd609c772a4ddccd7af67e8da9a3cb6e110f Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 24 Mar 2020 12:56:07 +0100 Subject: Align naming --- crates/ra_assists/src/handlers/add_missing_impl_members.rs | 2 +- crates/ra_ide/src/completion/complete_trait_impl.rs | 2 +- crates/ra_syntax/src/ast/edit.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'crates') diff --git a/crates/ra_assists/src/handlers/add_missing_impl_members.rs b/crates/ra_assists/src/handlers/add_missing_impl_members.rs index e5920b6f6..722f207e2 100644 --- a/crates/ra_assists/src/handlers/add_missing_impl_members.rs +++ b/crates/ra_assists/src/handlers/add_missing_impl_members.rs @@ -151,7 +151,7 @@ fn add_missing_impl_members_inner( ast::ImplItem::FnDef(def) => ast::ImplItem::FnDef(add_body(def)), _ => it, }) - .map(|it| edit::strip_attrs_and_docs(&it)); + .map(|it| edit::remove_attrs_and_docs(&it)); let new_impl_item_list = impl_item_list.append_items(items); let cursor_position = { let first_new_item = new_impl_item_list.impl_items().nth(n_existing_items).unwrap(); diff --git a/crates/ra_ide/src/completion/complete_trait_impl.rs b/crates/ra_ide/src/completion/complete_trait_impl.rs index 7fefa2c7a..ded1ff3bc 100644 --- a/crates/ra_ide/src/completion/complete_trait_impl.rs +++ b/crates/ra_ide/src/completion/complete_trait_impl.rs @@ -193,7 +193,7 @@ fn add_const_impl( } fn make_const_compl_syntax(const_: &ast::ConstDef) -> String { - let const_ = edit::strip_attrs_and_docs(const_); + let const_ = edit::remove_attrs_and_docs(const_); let const_start = const_.syntax().text_range().start(); let const_end = const_.syntax().text_range().end(); diff --git a/crates/ra_syntax/src/ast/edit.rs b/crates/ra_syntax/src/ast/edit.rs index 68dae008f..324327162 100644 --- a/crates/ra_syntax/src/ast/edit.rs +++ b/crates/ra_syntax/src/ast/edit.rs @@ -296,11 +296,11 @@ impl ast::UseTree { } #[must_use] -pub fn strip_attrs_and_docs(node: &N) -> N { - N::cast(strip_attrs_and_docs_inner(node.syntax().clone())).unwrap() +pub fn remove_attrs_and_docs(node: &N) -> N { + N::cast(remove_attrs_and_docs_inner(node.syntax().clone())).unwrap() } -fn strip_attrs_and_docs_inner(mut node: SyntaxNode) -> SyntaxNode { +fn remove_attrs_and_docs_inner(mut node: SyntaxNode) -> SyntaxNode { while let Some(start) = node.children_with_tokens().find(|it| it.kind() == ATTR || it.kind() == COMMENT) { -- cgit v1.2.3