Skip to content

Commit 0ad3509

Browse files
committed
Remove extraneous .clone()s in unnecessary wrapper diagnostic fix
I must've been tired while writing this or something.
1 parent d589319 commit 0ad3509

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/ide-diagnostics/src/handlers/type_mismatch.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,27 +239,27 @@ fn remove_unnecessary_wrapper(
239239
let old = builder.make_mut(ret_expr);
240240
let new = make::expr_return(None).clone_for_update();
241241

242-
ted::replace(old.syntax().clone(), new.syntax().clone());
242+
ted::replace(old.syntax(), new.syntax());
243243
}
244244
Either::Right(stmt_list) => {
245245
if stmt_list.statements().count() == 0 {
246246
let block = stmt_list.syntax().parent().and_then(ast::BlockExpr::cast)?;
247247
let old = builder.make_mut(block);
248248
let new = make::expr_empty_block().clone_for_update();
249249

250-
ted::replace(old.syntax().clone(), new.syntax().clone());
250+
ted::replace(old.syntax(), new.syntax());
251251
} else {
252252
let old = builder.make_syntax_mut(stmt_list.syntax().parent()?);
253253
let new = make::block_expr(stmt_list.statements(), None).clone_for_update();
254254

255-
ted::replace(old.clone(), new.syntax().clone());
255+
ted::replace(old, new.syntax());
256256
}
257257
}
258258
}
259259
}
260260
_ => {
261261
let call_mut = builder.make_mut(call_expr);
262-
ted::replace(call_mut.syntax().clone(), inner_arg.syntax().clone_for_update());
262+
ted::replace(call_mut.syntax(), inner_arg.clone_for_update().syntax());
263263
}
264264
}
265265

0 commit comments

Comments
 (0)