Unnamed repository; edit this file 'description' to name the repository.
ide-assists: remove unnecessary clones in two assists
Divyesh 6 weeks ago
parent a1b86d6 · commit 5c47b6b
-rw-r--r--crates/ide-assists/src/handlers/convert_bool_then.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/crates/ide-assists/src/handlers/convert_bool_then.rs b/crates/ide-assists/src/handlers/convert_bool_then.rs
index d2c4ed9b5a..236436989e 100644
--- a/crates/ide-assists/src/handlers/convert_bool_then.rs
+++ b/crates/ide-assists/src/handlers/convert_bool_then.rs
@@ -102,11 +102,7 @@ pub(crate) fn convert_if_to_bool_then(acc: &mut Assists, ctx: &AssistContext<'_>
ast::Expr::BlockExpr(block) => unwrap_trivial_block(block),
e => e,
};
- let cond = if invert_cond {
- invert_boolean_expression(&make, cond)
- } else {
- cond.clone_for_update()
- };
+ let cond = if invert_cond { invert_boolean_expression(&make, cond) } else { cond };
let parenthesize = matches!(
cond,