@@ -92,8 +92,8 @@ fn fn_target_info(
9292 call : & CallExpr ,
9393 fn_name : & str ,
9494) -> Option < TargetInfo > {
95- let mut target_module = None ;
96- let mut adt_name = None ;
95+ let target_module;
96+ let adt_name = None ;
9797 let ( target, file, insert_offset) = match path. qualifier ( ) {
9898 Some ( qualifier) => match ctx. sema . resolve_path ( & qualifier) {
9999 Some ( hir:: PathResolution :: Def ( hir:: ModuleDef :: Module ( module) ) ) => {
@@ -108,11 +108,11 @@ fn fn_target_info(
108108 }
109109 }
110110
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) ;
112112 }
113113 Some ( hir:: PathResolution :: SelfType ( impl_) ) => {
114114 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) ;
116116 }
117117 _ => {
118118 return None ;
@@ -412,6 +412,18 @@ fn get_method_target(
412412 Some ( ( target. clone ( ) , get_insert_offset ( & target) ) )
413413}
414414
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+ }
415427fn assoc_fn_target (
416428 ctx : & AssistContext < ' _ > ,
417429 call : & CallExpr ,
0 commit comments