From cbb53cf55ca350bbcada5fc759b0119d932e879d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 27 Mar 2020 11:38:00 +0100 Subject: More general ctor for ifs --- crates/ra_assists/src/handlers/early_return.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_assists') 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 { let then_branch = make::block_expr(once(make::expr_stmt(early_expression).into()), None); let cond = invert_boolean_expression(cond_expr); - let e = make::expr_if(cond, then_branch); + let e = make::expr_if(make::condition(cond, None), then_branch); if_indent_level.increase_indent(e) }; replace(new_expr.syntax(), &then_block, &parent_block, &if_expr) -- cgit v1.2.3