diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-02 10:57:45 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-02 10:57:45 +0100 |
commit | 75bc0249463b72971200e482d69dad88d4e76ae3 (patch) | |
tree | cf12a19a548f77af306bd8eeb4ba6a74175e1790 /crates/ra_assists/src/handlers/move_guard.rs | |
parent | 235728319fb545670e49db996e9c2cd94b8b34eb (diff) | |
parent | b73dbbfbf2cad646eb3f8e3342a1c390a874dc53 (diff) |
Merge #4257
4257: ast::EffectExpr r=matklad a=matklad
closes #4230
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/handlers/move_guard.rs')
-rw-r--r-- | crates/ra_assists/src/handlers/move_guard.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_assists/src/handlers/move_guard.rs b/crates/ra_assists/src/handlers/move_guard.rs index d5ccdd91c..b084dd9ee 100644 --- a/crates/ra_assists/src/handlers/move_guard.rs +++ b/crates/ra_assists/src/handlers/move_guard.rs | |||
@@ -113,9 +113,9 @@ pub(crate) fn move_arm_cond_to_match_guard(ctx: AssistCtx) -> Option<Assist> { | |||
113 | "Move condition to match guard", | 113 | "Move condition to match guard", |
114 | |edit| { | 114 | |edit| { |
115 | edit.target(if_expr.syntax().text_range()); | 115 | edit.target(if_expr.syntax().text_range()); |
116 | let then_only_expr = then_block.block().and_then(|it| it.statements().next()).is_none(); | 116 | let then_only_expr = then_block.statements().next().is_none(); |
117 | 117 | ||
118 | match &then_block.block().and_then(|it| it.expr()) { | 118 | match &then_block.expr() { |
119 | Some(then_expr) if then_only_expr => { | 119 | Some(then_expr) if then_only_expr => { |
120 | edit.replace(if_expr.syntax().text_range(), then_expr.syntax().text()) | 120 | edit.replace(if_expr.syntax().text_range(), then_expr.syntax().text()) |
121 | } | 121 | } |