3705: Align naming r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2020-03-24 11:56:43 +00:00 committed by GitHub
commit 7c2cc85806
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -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();

View file

@ -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();

View file

@ -296,11 +296,11 @@ impl ast::UseTree {
}
#[must_use]
pub fn strip_attrs_and_docs<N: ast::AttrsOwner>(node: &N) -> N {
N::cast(strip_attrs_and_docs_inner(node.syntax().clone())).unwrap()
pub fn remove_attrs_and_docs<N: ast::AttrsOwner>(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)
{