aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api_light/src/assists/replace_if_let_with_match.rs
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-01-26 21:41:27 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-01-26 21:41:27 +0000
commite40d8d40321b191ee82b8b07910f8a0898c8914c (patch)
tree7adcdf5fd1a09bdb18776e210a4686342979cbe6 /crates/ra_ide_api_light/src/assists/replace_if_let_with_match.rs
parent99b032b0f6b3f718ee9500655f1149dc33eac610 (diff)
parent619af1e22cb71b981fde4cedbf6ebce9b3488028 (diff)
Merge #683
683: fix AST for if expressions r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api_light/src/assists/replace_if_let_with_match.rs')
-rw-r--r--crates/ra_ide_api_light/src/assists/replace_if_let_with_match.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_ide_api_light/src/assists/replace_if_let_with_match.rs b/crates/ra_ide_api_light/src/assists/replace_if_let_with_match.rs
index d64c34d54..71880b919 100644
--- a/crates/ra_ide_api_light/src/assists/replace_if_let_with_match.rs
+++ b/crates/ra_ide_api_light/src/assists/replace_if_let_with_match.rs
@@ -11,7 +11,10 @@ pub fn replace_if_let_with_match(ctx: AssistCtx) -> Option<Assist> {
11 let pat = cond.pat()?; 11 let pat = cond.pat()?;
12 let expr = cond.expr()?; 12 let expr = cond.expr()?;
13 let then_block = if_expr.then_branch()?; 13 let then_block = if_expr.then_branch()?;
14 let else_block = if_expr.else_branch()?; 14 let else_block = match if_expr.else_branch()? {
15 ast::ElseBranchFlavor::Block(it) => it,
16 ast::ElseBranchFlavor::IfExpr(_) => return None,
17 };
15 18
16 ctx.build("replace with match", |edit| { 19 ctx.build("replace with match", |edit| {
17 let match_expr = build_match_expr(expr, pat, then_block, else_block); 20 let match_expr = build_match_expr(expr, pat, then_block, else_block);