diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-31 14:54:19 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-31 14:54:19 +0100 |
commit | ad239f6197bda31f7a9b904b5ccb25c93cbc701a (patch) | |
tree | 5e4b244c62c61824dbb63246aa9943e3b2398131 /crates/ra_assists/src | |
parent | 3407d6f8a430627be333c32cb4cef02c0c8d11e3 (diff) | |
parent | d4d986c7f850e1f535bb4c22e3a7f7fba5483628 (diff) |
Merge #5623
5623: Item is a Stmt r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src')
-rw-r--r-- | crates/ra_assists/src/handlers/change_return_type_to_result.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crates/ra_assists/src/handlers/change_return_type_to_result.rs b/crates/ra_assists/src/handlers/change_return_type_to_result.rs index 167e162d8..4b73c41da 100644 --- a/crates/ra_assists/src/handlers/change_return_type_to_result.rs +++ b/crates/ra_assists/src/handlers/change_return_type_to_result.rs | |||
@@ -74,6 +74,7 @@ impl TailReturnCollector { | |||
74 | let expr = match &stmt { | 74 | let expr = match &stmt { |
75 | ast::Stmt::ExprStmt(stmt) => stmt.expr(), | 75 | ast::Stmt::ExprStmt(stmt) => stmt.expr(), |
76 | ast::Stmt::LetStmt(stmt) => stmt.initializer(), | 76 | ast::Stmt::LetStmt(stmt) => stmt.initializer(), |
77 | ast::Stmt::Item(_) => continue, | ||
77 | }; | 78 | }; |
78 | if let Some(expr) = &expr { | 79 | if let Some(expr) = &expr { |
79 | self.handle_exprs(expr, collect_break); | 80 | self.handle_exprs(expr, collect_break); |
@@ -94,6 +95,7 @@ impl TailReturnCollector { | |||
94 | let expr_stmt = match &expr_stmt { | 95 | let expr_stmt = match &expr_stmt { |
95 | ast::Stmt::ExprStmt(stmt) => stmt.expr(), | 96 | ast::Stmt::ExprStmt(stmt) => stmt.expr(), |
96 | ast::Stmt::LetStmt(stmt) => stmt.initializer(), | 97 | ast::Stmt::LetStmt(stmt) => stmt.initializer(), |
98 | ast::Stmt::Item(_) => None, | ||
97 | }; | 99 | }; |
98 | if let Some(expr) = &expr_stmt { | 100 | if let Some(expr) = &expr_stmt { |
99 | self.handle_exprs(expr, collect_break); | 101 | self.handle_exprs(expr, collect_break); |