diff options
Diffstat (limited to 'crates/ra_assists/src/handlers/generate_new.rs')
-rw-r--r-- | crates/ra_assists/src/handlers/generate_new.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_assists/src/handlers/generate_new.rs b/crates/ra_assists/src/handlers/generate_new.rs index 4dff0ae4d..340f9b103 100644 --- a/crates/ra_assists/src/handlers/generate_new.rs +++ b/crates/ra_assists/src/handlers/generate_new.rs | |||
@@ -1,7 +1,8 @@ | |||
1 | use hir::Adt; | 1 | use hir::Adt; |
2 | use ra_syntax::{ | 2 | use ra_syntax::{ |
3 | ast::{ | 3 | ast::{ |
4 | self, AstNode, NameOwner, StructKind, TypeAscriptionOwner, TypeParamsOwner, VisibilityOwner, | 4 | self, AstNode, GenericParamsOwner, NameOwner, StructKind, TypeAscriptionOwner, |
5 | VisibilityOwner, | ||
5 | }, | 6 | }, |
6 | T, | 7 | T, |
7 | }; | 8 | }; |
@@ -91,7 +92,7 @@ pub(crate) fn generate_new(acc: &mut Assists, ctx: &AssistContext) -> Option<()> | |||
91 | // Generates the surrounding `impl Type { <code> }` including type and lifetime | 92 | // Generates the surrounding `impl Type { <code> }` including type and lifetime |
92 | // parameters | 93 | // parameters |
93 | fn generate_impl_text(strukt: &ast::StructDef, code: &str) -> String { | 94 | fn generate_impl_text(strukt: &ast::StructDef, code: &str) -> String { |
94 | let type_params = strukt.type_param_list(); | 95 | let type_params = strukt.generic_param_list(); |
95 | let mut buf = String::with_capacity(code.len()); | 96 | let mut buf = String::with_capacity(code.len()); |
96 | buf.push_str("\n\nimpl"); | 97 | buf.push_str("\n\nimpl"); |
97 | if let Some(type_params) = &type_params { | 98 | if let Some(type_params) = &type_params { |