aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-03-27 10:38:00 +0000
committerAleksey Kladov <[email protected]>2020-03-27 10:38:00 +0000
commitcbb53cf55ca350bbcada5fc759b0119d932e879d (patch)
tree8e553c230d6dafcebfdd5ae69af99e0eddc4e156 /crates/ra_assists
parentd953df319b3057e446b05eac0dcc88a4a5bb4b60 (diff)
More general ctor for ifs
Diffstat (limited to 'crates/ra_assists')
-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)