Rename ImplItem to AssocItem

This commit is contained in:
Edwin Cheng 2020-05-05 23:56:10 +08:00
parent 756e91732b
commit 92665358cd
12 changed files with 83 additions and 77 deletions

View file

@ -79,7 +79,7 @@ where
impl ast::ItemList {
#[must_use]
pub fn append_items(&self, items: impl IntoIterator<Item = ast::ImplItem>) -> ast::ItemList {
pub fn append_items(&self, items: impl IntoIterator<Item = ast::AssocItem>) -> ast::ItemList {
let mut res = self.clone();
if !self.syntax().text().contains_char('\n') {
res = make_multiline(res);
@ -89,8 +89,8 @@ impl ast::ItemList {
}
#[must_use]
pub fn append_item(&self, item: ast::ImplItem) -> ast::ItemList {
let (indent, position) = match self.impl_items().last() {
pub fn append_item(&self, item: ast::AssocItem) -> ast::ItemList {
let (indent, position) = match self.assoc_items().last() {
Some(it) => (
leading_indent(it.syntax()).unwrap_or_default().to_string(),
InsertPosition::After(it.syntax().clone().into()),