diff options
author | Aleksey Kladov <[email protected]> | 2021-01-05 12:45:46 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2021-01-05 12:51:13 +0000 |
commit | f9707cde6801f13cc4c20e3e08cee07ef23b8563 (patch) | |
tree | 56be395be11c1315ace19c50ad528c0af5ac0a16 /crates/assists/src/handlers/infer_function_return_type.rs | |
parent | 5c10f2f705d6757b9821387a5be759789b7ee480 (diff) |
Rename expr -> tail_expr
Diffstat (limited to 'crates/assists/src/handlers/infer_function_return_type.rs')
-rw-r--r-- | crates/assists/src/handlers/infer_function_return_type.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/assists/src/handlers/infer_function_return_type.rs b/crates/assists/src/handlers/infer_function_return_type.rs index aa584eb03..f499cdfdc 100644 --- a/crates/assists/src/handlers/infer_function_return_type.rs +++ b/crates/assists/src/handlers/infer_function_return_type.rs | |||
@@ -89,7 +89,7 @@ fn extract_tail(ctx: &AssistContext) -> Option<(FnType, ast::Expr, InsertOrRepla | |||
89 | let body = closure.body()?; | 89 | let body = closure.body()?; |
90 | let body_start = body.syntax().first_token()?.text_range().start(); | 90 | let body_start = body.syntax().first_token()?.text_range().start(); |
91 | let (tail_expr, wrap_expr) = match body { | 91 | let (tail_expr, wrap_expr) = match body { |
92 | ast::Expr::BlockExpr(block) => (block.expr()?, false), | 92 | ast::Expr::BlockExpr(block) => (block.tail_expr()?, false), |
93 | body => (body, true), | 93 | body => (body, true), |
94 | }; | 94 | }; |
95 | 95 | ||
@@ -101,7 +101,7 @@ fn extract_tail(ctx: &AssistContext) -> Option<(FnType, ast::Expr, InsertOrRepla | |||
101 | let action = ret_ty_to_action(func.ret_type(), rparen_pos)?; | 101 | let action = ret_ty_to_action(func.ret_type(), rparen_pos)?; |
102 | 102 | ||
103 | let body = func.body()?; | 103 | let body = func.body()?; |
104 | let tail_expr = body.expr()?; | 104 | let tail_expr = body.tail_expr()?; |
105 | 105 | ||
106 | let ret_range_end = body.l_curly_token()?.text_range().start(); | 106 | let ret_range_end = body.l_curly_token()?.text_range().start(); |
107 | let ret_range = TextRange::new(rparen_pos, ret_range_end); | 107 | let ret_range = TextRange::new(rparen_pos, ret_range_end); |