diff options
Diffstat (limited to 'crates/ra_assists/src/move_guard.rs')
-rw-r--r-- | crates/ra_assists/src/move_guard.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_assists/src/move_guard.rs b/crates/ra_assists/src/move_guard.rs index 127c9e068..699221e33 100644 --- a/crates/ra_assists/src/move_guard.rs +++ b/crates/ra_assists/src/move_guard.rs | |||
@@ -65,9 +65,9 @@ pub(crate) fn move_arm_cond_to_match_guard(mut ctx: AssistCtx<impl HirDatabase>) | |||
65 | "move condition to match guard", | 65 | "move condition to match guard", |
66 | |edit| { | 66 | |edit| { |
67 | edit.target(if_expr.syntax().text_range()); | 67 | edit.target(if_expr.syntax().text_range()); |
68 | let then_only_expr = then_block.statements().next().is_none(); | 68 | let then_only_expr = then_block.block().and_then(|it| it.statements().next()).is_none(); |
69 | 69 | ||
70 | match &then_block.expr() { | 70 | match &then_block.block().and_then(|it| it.expr()) { |
71 | Some(then_expr) if then_only_expr => { | 71 | Some(then_expr) if then_only_expr => { |
72 | edit.replace(if_expr.syntax().text_range(), then_expr.syntax().text()) | 72 | edit.replace(if_expr.syntax().text_range(), then_expr.syntax().text()) |
73 | } | 73 | } |