aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/handlers
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-03-27 10:38:31 +0000
committerGitHub <[email protected]>2020-03-27 10:38:31 +0000
commitf9cf86475c042a41f2e3b59baf96b456e0ff521b (patch)
tree983e95c067bf9d8b81240576924cae0357d07185 /crates/ra_assists/src/handlers
parent31528620a8fca9ea79947d53b796460d0928dd95 (diff)
parentcbb53cf55ca350bbcada5fc759b0119d932e879d (diff)
Merge #3741
3741: More general ctor for ifs r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/handlers')
-rw-r--r--crates/ra_assists/src/handlers/early_return.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_assists/src/handlers/early_return.rs b/crates/ra_assists/src/handlers/early_return.rs
index f3167b4e5..ea6c56f8c 100644
--- a/crates/ra_assists/src/handlers/early_return.rs
+++ b/crates/ra_assists/src/handlers/early_return.rs
@@ -104,7 +104,7 @@ pub(crate) fn convert_to_guarded_return(ctx: AssistCtx) -> Option<Assist> {
104 let then_branch = 104 let then_branch =
105 make::block_expr(once(make::expr_stmt(early_expression).into()), None); 105 make::block_expr(once(make::expr_stmt(early_expression).into()), None);
106 let cond = invert_boolean_expression(cond_expr); 106 let cond = invert_boolean_expression(cond_expr);
107 let e = make::expr_if(cond, then_branch); 107 let e = make::expr_if(make::condition(cond, None), then_branch);
108 if_indent_level.increase_indent(e) 108 if_indent_level.increase_indent(e)
109 }; 109 };
110 replace(new_expr.syntax(), &then_block, &parent_block, &if_expr) 110 replace(new_expr.syntax(), &then_block, &parent_block, &if_expr)