aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/add_impl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_assists/src/add_impl.rs')
-rw-r--r--crates/ra_assists/src/add_impl.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_assists/src/add_impl.rs b/crates/ra_assists/src/add_impl.rs
index b292f188d..fa1c85890 100644
--- a/crates/ra_assists/src/add_impl.rs
+++ b/crates/ra_assists/src/add_impl.rs
@@ -1,7 +1,7 @@
1use join_to_string::join; 1use join_to_string::join;
2use hir::db::HirDatabase; 2use hir::db::HirDatabase;
3use ra_syntax::{ 3use ra_syntax::{
4 ast::{self, AstNode, AstToken, NameOwner, TypeParamsOwner}, 4 ast::{self, AstNode, NameOwner, TypeParamsOwner},
5 TextUnit, 5 TextUnit,
6}; 6};
7 7
@@ -22,8 +22,10 @@ pub(crate) fn add_impl(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> {
22 buf.push_str(" "); 22 buf.push_str(" ");
23 buf.push_str(name.text().as_str()); 23 buf.push_str(name.text().as_str());
24 if let Some(type_params) = type_params { 24 if let Some(type_params) = type_params {
25 let lifetime_params = 25 let lifetime_params = type_params
26 type_params.lifetime_params().filter_map(|it| it.lifetime()).map(|it| it.text()); 26 .lifetime_params()
27 .filter_map(|it| it.lifetime_token())
28 .map(|it| it.text());
27 let type_params = 29 let type_params =
28 type_params.type_params().filter_map(|it| it.name()).map(|it| it.text()); 30 type_params.type_params().filter_map(|it| it.name()).map(|it| it.text());
29 join(lifetime_params.chain(type_params)).surround_with("<", ">").to_buf(&mut buf); 31 join(lifetime_params.chain(type_params)).surround_with("<", ">").to_buf(&mut buf);