From 4acadbdca61e77368061a0c53125e164912ab5d5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 30 Sep 2019 10:08:28 +0300 Subject: cleanup editor --- crates/ra_assists/src/assists/add_missing_impl_members.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'crates/ra_assists') diff --git a/crates/ra_assists/src/assists/add_missing_impl_members.rs b/crates/ra_assists/src/assists/add_missing_impl_members.rs index c2e3eb06b..6fd1c3753 100644 --- a/crates/ra_assists/src/assists/add_missing_impl_members.rs +++ b/crates/ra_assists/src/assists/add_missing_impl_members.rs @@ -75,10 +75,13 @@ fn add_missing_impl_members_inner( ctx.add_action(AssistId(assist_id), label, |edit| { let n_existing_items = impl_item_list.impl_items().count(); - let items = missing_items.into_iter().map(|it| match it { - ast::ImplItem::FnDef(def) => edit::strip_attrs_and_docs(add_body(def).into()), - _ => edit::strip_attrs_and_docs(it), - }); + let items = missing_items + .into_iter() + .map(|it| match it { + ast::ImplItem::FnDef(def) => ast::ImplItem::FnDef(add_body(def)), + _ => it, + }) + .map(|it| edit::strip_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(); -- cgit v1.2.3