@@ -92,8 +92,8 @@ fn fn_target_info(
92
92
call : & CallExpr ,
93
93
fn_name : & str ,
94
94
) -> Option < TargetInfo > {
95
- let mut target_module = None ;
96
- let mut adt_name = None ;
95
+ let target_module;
96
+ let adt_name = None ;
97
97
let ( target, file, insert_offset) = match path. qualifier ( ) {
98
98
Some ( qualifier) => match ctx. sema . resolve_path ( & qualifier) {
99
99
Some ( hir:: PathResolution :: Def ( hir:: ModuleDef :: Module ( module) ) ) => {
@@ -108,11 +108,11 @@ fn fn_target_info(
108
108
}
109
109
}
110
110
111
- assoc_fn_target ( ctx, call, adt, & mut target_module , fn_name, & mut adt_name ) ?
111
+ return assoc_fn_target_info ( ctx, call, adt, fn_name) ;
112
112
}
113
113
Some ( hir:: PathResolution :: SelfType ( impl_) ) => {
114
114
let adt = impl_. self_ty ( ctx. db ( ) ) . as_adt ( ) ?;
115
- assoc_fn_target ( ctx, call, adt, & mut target_module , fn_name, & mut adt_name ) ?
115
+ return assoc_fn_target_info ( ctx, call, adt, fn_name) ;
116
116
}
117
117
_ => {
118
118
return None ;
@@ -412,6 +412,18 @@ fn get_method_target(
412
412
Some ( ( target. clone ( ) , get_insert_offset ( & target) ) )
413
413
}
414
414
415
+ fn assoc_fn_target_info (
416
+ ctx : & AssistContext < ' _ > ,
417
+ call : & CallExpr ,
418
+ adt : hir:: Adt ,
419
+ fn_name : & str ,
420
+ ) -> Option < TargetInfo > {
421
+ let mut target_module = None ;
422
+ let mut adt_name = None ;
423
+ let ( target, file, insert_offset) =
424
+ assoc_fn_target ( ctx, call, adt, & mut target_module, fn_name, & mut adt_name) ?;
425
+ Some ( TargetInfo { target_module, adt_name, target, file, insert_offset } )
426
+ }
415
427
fn assoc_fn_target (
416
428
ctx : & AssistContext < ' _ > ,
417
429
call : & CallExpr ,
0 commit comments