aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/handlers
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-07-14 12:33:37 +0100
committerJonas Schievink <[email protected]>2020-07-14 12:33:37 +0100
commit85f5cbc9dc7027f922198f6c2d06cf382aad6970 (patch)
treefd73b03c195602955cd71af8d3d8a49007f94009 /crates/ra_assists/src/handlers
parent0f654b06ab093e7bb057cfd68b27925803b003d8 (diff)
Move remove_bounds to edit.rs
Diffstat (limited to 'crates/ra_assists/src/handlers')
-rw-r--r--crates/ra_assists/src/handlers/add_missing_impl_members.rs10
1 files changed, 1 insertions, 9 deletions
diff --git a/crates/ra_assists/src/handlers/add_missing_impl_members.rs b/crates/ra_assists/src/handlers/add_missing_impl_members.rs
index 124cead6c..f185e61e5 100644
--- a/crates/ra_assists/src/handlers/add_missing_impl_members.rs
+++ b/crates/ra_assists/src/handlers/add_missing_impl_members.rs
@@ -159,7 +159,7 @@ fn add_missing_impl_members_inner(
159 .map(|it| match it { 159 .map(|it| match it {
160 ast::AssocItem::FnDef(def) => ast::AssocItem::FnDef(add_body(def)), 160 ast::AssocItem::FnDef(def) => ast::AssocItem::FnDef(add_body(def)),
161 ast::AssocItem::TypeAliasDef(def) => { 161 ast::AssocItem::TypeAliasDef(def) => {
162 ast::AssocItem::TypeAliasDef(remove_bounds(def)) 162 ast::AssocItem::TypeAliasDef(def.remove_bounds())
163 } 163 }
164 _ => it, 164 _ => it,
165 }) 165 })
@@ -191,14 +191,6 @@ fn add_missing_impl_members_inner(
191 }) 191 })
192} 192}
193 193
194fn remove_bounds(ty_def: ast::TypeAliasDef) -> ast::TypeAliasDef {
195 if let Some(name) = ty_def.name() {
196 make::type_alias_def(name, None, ty_def.type_ref())
197 } else {
198 ty_def
199 }
200}
201
202fn add_body(fn_def: ast::FnDef) -> ast::FnDef { 194fn add_body(fn_def: ast::FnDef) -> ast::FnDef {
203 if fn_def.body().is_some() { 195 if fn_def.body().is_some() {
204 return fn_def; 196 return fn_def;