From 7d90bb1f47e1ab6f0ac1d7a042d7161295cf9320 Mon Sep 17 00:00:00 2001 From: Matt Hooper Date: Mon, 21 Sep 2020 10:01:50 +0100 Subject: Rename impl edit method to be more explicit --- crates/assists/src/handlers/add_missing_impl_members.rs | 2 +- crates/syntax/src/ast/edit.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'crates') diff --git a/crates/assists/src/handlers/add_missing_impl_members.rs b/crates/assists/src/handlers/add_missing_impl_members.rs index 01cf95222..8df1d786b 100644 --- a/crates/assists/src/handlers/add_missing_impl_members.rs +++ b/crates/assists/src/handlers/add_missing_impl_members.rs @@ -165,7 +165,7 @@ fn add_missing_impl_members_inner( .map(|it| edit::remove_attrs_and_docs(&it)); let new_impl_item_list = impl_item_list.append_items(items); - let new_impl_def = impl_def.with_items(new_impl_item_list); + let new_impl_def = impl_def.with_assoc_item_list(new_impl_item_list); let first_new_item = new_impl_def.assoc_item_list().unwrap().assoc_items().nth(n_existing_items).unwrap(); diff --git a/crates/syntax/src/ast/edit.rs b/crates/syntax/src/ast/edit.rs index ceeb0fb4b..dda0a0319 100644 --- a/crates/syntax/src/ast/edit.rs +++ b/crates/syntax/src/ast/edit.rs @@ -95,7 +95,7 @@ where impl ast::Impl { #[must_use] - pub fn with_items(&self, items: ast::AssocItemList) -> ast::Impl { + pub fn with_assoc_item_list(&self, items: ast::AssocItemList) -> ast::Impl { let mut to_insert: ArrayVec<[SyntaxElement; 2]> = ArrayVec::new(); if let Some(old_items) = self.assoc_item_list() { let to_replace: SyntaxElement = old_items.syntax().clone().into(); -- cgit v1.2.3