mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-12-04 00:54:52 +00:00
Rename impl edit method to be more explicit
This commit is contained in:
parent
532be0e780
commit
7d90bb1f47
2 changed files with 2 additions and 2 deletions
|
|
@ -165,7 +165,7 @@ fn add_missing_impl_members_inner(
|
||||||
.map(|it| edit::remove_attrs_and_docs(&it));
|
.map(|it| edit::remove_attrs_and_docs(&it));
|
||||||
|
|
||||||
let new_impl_item_list = impl_item_list.append_items(items);
|
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 =
|
let first_new_item =
|
||||||
new_impl_def.assoc_item_list().unwrap().assoc_items().nth(n_existing_items).unwrap();
|
new_impl_def.assoc_item_list().unwrap().assoc_items().nth(n_existing_items).unwrap();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ where
|
||||||
|
|
||||||
impl ast::Impl {
|
impl ast::Impl {
|
||||||
#[must_use]
|
#[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();
|
let mut to_insert: ArrayVec<[SyntaxElement; 2]> = ArrayVec::new();
|
||||||
if let Some(old_items) = self.assoc_item_list() {
|
if let Some(old_items) = self.assoc_item_list() {
|
||||||
let to_replace: SyntaxElement = old_items.syntax().clone().into();
|
let to_replace: SyntaxElement = old_items.syntax().clone().into();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue