Skip to content

Commit 9603dab

Browse files
Merge pull request #21781 from CodeLoopdroid/feature/clone-subtree
Migrate two assists to clone_subtree to ease SyntaxEditor transition
2 parents a1b86d6 + 5c47b6b commit 9603dab

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

crates/ide-assists/src/handlers/convert_bool_then.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,7 @@ pub(crate) fn convert_if_to_bool_then(acc: &mut Assists, ctx: &AssistContext<'_>
102102
ast::Expr::BlockExpr(block) => unwrap_trivial_block(block),
103103
e => e,
104104
};
105-
let cond = if invert_cond {
106-
invert_boolean_expression(&make, cond)
107-
} else {
108-
cond.clone_for_update()
109-
};
105+
let cond = if invert_cond { invert_boolean_expression(&make, cond) } else { cond };
110106

111107
let parenthesize = matches!(
112108
cond,

0 commit comments

Comments
 (0)