@@ -61,7 +61,7 @@ fn gen_fn(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<()> {
61
61
}
62
62
63
63
let fn_name = & * name_ref. text ( ) ;
64
- let ( target_module, adt_name, target, file, insert_offset) =
64
+ let TargetInfo { target_module, adt_name, target, file, insert_offset } =
65
65
fn_target_info ( path, ctx, & call, fn_name) ?;
66
66
let function_builder = FunctionBuilder :: from_call ( ctx, & call, fn_name, target_module, target) ?;
67
67
let text_range = call. syntax ( ) . text_range ( ) ;
@@ -78,12 +78,20 @@ fn gen_fn(acc: &mut Assists, ctx: &AssistContext<'_>) -> Option<()> {
78
78
)
79
79
}
80
80
81
+ struct TargetInfo {
82
+ target_module : Option < Module > ,
83
+ adt_name : Option < hir:: Name > ,
84
+ target : GeneratedFunctionTarget ,
85
+ file : FileId ,
86
+ insert_offset : TextSize ,
87
+ }
88
+
81
89
fn fn_target_info (
82
90
path : ast:: Path ,
83
91
ctx : & AssistContext < ' _ > ,
84
92
call : & CallExpr ,
85
93
fn_name : & str ,
86
- ) -> Option < ( Option < Module > , Option < hir :: Name > , GeneratedFunctionTarget , FileId , TextSize ) > {
94
+ ) -> Option < TargetInfo > {
87
95
let mut target_module = None ;
88
96
let mut adt_name = None ;
89
97
let ( target, file, insert_offset) = match path. qualifier ( ) {
@@ -115,7 +123,7 @@ fn fn_target_info(
115
123
get_fn_target ( ctx, & target_module, call. clone ( ) ) ?
116
124
}
117
125
} ;
118
- Some ( ( target_module, adt_name, target, file, insert_offset) )
126
+ Some ( TargetInfo { target_module, adt_name, target, file, insert_offset } )
119
127
}
120
128
121
129
fn gen_method ( acc : & mut Assists , ctx : & AssistContext < ' _ > ) -> Option < ( ) > {
0 commit comments