@@ -17,21 +17,21 @@ use crate::{
17
17
AssistContext , AssistId , AssistKind , Assists ,
18
18
} ;
19
19
20
- enum FuncExpr < ' a > {
21
- Func ( & ' a ast:: CallExpr ) ,
22
- Method ( & ' a ast:: MethodCallExpr ) ,
20
+ enum FuncExpr {
21
+ Func ( ast:: CallExpr ) ,
22
+ Method ( ast:: MethodCallExpr ) ,
23
23
}
24
24
25
- impl < ' a > FuncExpr < ' a > {
25
+ impl FuncExpr {
26
26
fn arg_list ( & self ) -> Option < ArgList > {
27
- match * self {
27
+ match self {
28
28
FuncExpr :: Func ( fn_call) => fn_call. arg_list ( ) ,
29
29
FuncExpr :: Method ( m_call) => m_call. arg_list ( ) ,
30
30
}
31
31
}
32
32
33
33
fn syntax ( & self ) -> & SyntaxNode {
34
- match * self {
34
+ match self {
35
35
FuncExpr :: Func ( fn_call) => fn_call. syntax ( ) ,
36
36
FuncExpr :: Method ( m_call) => m_call. syntax ( ) ,
37
37
}
@@ -212,12 +212,12 @@ impl FunctionBuilder {
212
212
file = in_file;
213
213
target
214
214
}
215
- None => next_space_for_fn_after_call_site ( FuncExpr :: Func ( call) ) ?,
215
+ None => next_space_for_fn_after_call_site ( FuncExpr :: Func ( call. clone ( ) ) ) ?,
216
216
} ;
217
217
let needs_pub = target_module. is_some ( ) ;
218
218
let target_module = target_module. or_else ( || ctx. sema . scope ( target. syntax ( ) ) . module ( ) ) ?;
219
219
let fn_name = fn_name ( path) ?;
220
- let ( type_params, params) = fn_args ( ctx, target_module, FuncExpr :: Func ( call) ) ?;
220
+ let ( type_params, params) = fn_args ( ctx, target_module, FuncExpr :: Func ( call. clone ( ) ) ) ?;
221
221
222
222
let await_expr = call. syntax ( ) . parent ( ) . and_then ( ast:: AwaitExpr :: cast) ;
223
223
let is_async = await_expr. is_some ( ) ;
@@ -287,7 +287,7 @@ impl FunctionBuilder {
287
287
let needs_pub = !module_is_descendant ( & current_module, & target_module, ctx) ;
288
288
289
289
let fn_name = make:: name ( & name. text ( ) ) ;
290
- let ( type_params, params) = fn_args ( ctx, target_module, FuncExpr :: Method ( call) ) ?;
290
+ let ( type_params, params) = fn_args ( ctx, target_module, FuncExpr :: Method ( call. clone ( ) ) ) ?;
291
291
292
292
let await_expr = call. syntax ( ) . parent ( ) . and_then ( ast:: AwaitExpr :: cast) ;
293
293
let is_async = await_expr. is_some ( ) ;
0 commit comments