aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists')
-rw-r--r--crates/ra_assists/src/assists/add_missing_impl_members.rs11
1 files changed, 7 insertions, 4 deletions
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(
75 75
76 ctx.add_action(AssistId(assist_id), label, |edit| { 76 ctx.add_action(AssistId(assist_id), label, |edit| {
77 let n_existing_items = impl_item_list.impl_items().count(); 77 let n_existing_items = impl_item_list.impl_items().count();
78 let items = missing_items.into_iter().map(|it| match it { 78 let items = missing_items
79 ast::ImplItem::FnDef(def) => edit::strip_attrs_and_docs(add_body(def).into()), 79 .into_iter()
80 _ => edit::strip_attrs_and_docs(it), 80 .map(|it| match it {
81 }); 81 ast::ImplItem::FnDef(def) => ast::ImplItem::FnDef(add_body(def)),
82 _ => it,
83 })
84 .map(|it| edit::strip_attrs_and_docs(&it));
82 let new_impl_item_list = impl_item_list.append_items(items); 85 let new_impl_item_list = impl_item_list.append_items(items);
83 let cursor_position = { 86 let cursor_position = {
84 let first_new_item = new_impl_item_list.impl_items().nth(n_existing_items).unwrap(); 87 let first_new_item = new_impl_item_list.impl_items().nth(n_existing_items).unwrap();