aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Hooper <[email protected]>2020-09-21 10:01:50 +0100
committerMatt Hooper <[email protected]>2020-09-21 10:01:50 +0100
commit7d90bb1f47e1ab6f0ac1d7a042d7161295cf9320 (patch)
tree13f53d85a2fa40bf67f23fd55ba750d37ae0bbf1
parent532be0e780e1f27e4669c8c032d364504c89b02e (diff)
Rename impl edit method to be more explicit
-rw-r--r--crates/assists/src/handlers/add_missing_impl_members.rs2
-rw-r--r--crates/syntax/src/ast/edit.rs2
2 files changed, 2 insertions, 2 deletions
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(
165 .map(|it| edit::remove_attrs_and_docs(&it)); 165 .map(|it| edit::remove_attrs_and_docs(&it));
166 166
167 let new_impl_item_list = impl_item_list.append_items(items); 167 let new_impl_item_list = impl_item_list.append_items(items);
168 let new_impl_def = impl_def.with_items(new_impl_item_list); 168 let new_impl_def = impl_def.with_assoc_item_list(new_impl_item_list);
169 let first_new_item = 169 let first_new_item =
170 new_impl_def.assoc_item_list().unwrap().assoc_items().nth(n_existing_items).unwrap(); 170 new_impl_def.assoc_item_list().unwrap().assoc_items().nth(n_existing_items).unwrap();
171 171
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
95 95
96impl ast::Impl { 96impl ast::Impl {
97 #[must_use] 97 #[must_use]
98 pub fn with_items(&self, items: ast::AssocItemList) -> ast::Impl { 98 pub fn with_assoc_item_list(&self, items: ast::AssocItemList) -> ast::Impl {
99 let mut to_insert: ArrayVec<[SyntaxElement; 2]> = ArrayVec::new(); 99 let mut to_insert: ArrayVec<[SyntaxElement; 2]> = ArrayVec::new();
100 if let Some(old_items) = self.assoc_item_list() { 100 if let Some(old_items) = self.assoc_item_list() {
101 let to_replace: SyntaxElement = old_items.syntax().clone().into(); 101 let to_replace: SyntaxElement = old_items.syntax().clone().into();