Skip to content

Commit b7e613c

Browse files
committed
fix: update introduce_named_generic to use type_param directly
Signed-off-by: Tarek <tareknaser360@gmail.com>
1 parent 9157761 commit b7e613c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

crates/ide-assists/src/handlers/introduce_named_generic.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,10 @@ pub(crate) fn introduce_named_generic(acc: &mut Assists, ctx: &AssistContext<'_>
5050
let new_ty = make.ty(&type_param_name);
5151

5252
editor.replace(impl_trait_type.syntax(), new_ty.syntax());
53-
let generic_param = syntax::ast::GenericParam::from(type_param);
54-
editor.syntax_editor_add_generic_param(fn_, generic_param.clone());
53+
editor.syntax_editor_add_generic_param(fn_, type_param.clone().into());
5554

5655
if let Some(cap) = ctx.config.snippet_cap {
57-
editor.add_annotation(generic_param.syntax(), builder.make_tabstop_before(cap));
56+
editor.add_annotation(type_param.syntax(), builder.make_tabstop_before(cap));
5857
}
5958

6059
editor.add_mappings(make.finish_with_mappings());

0 commit comments

Comments
 (0)