Skip to content

Commit aa74c75

Browse files
committed
clippy:: append_instead_of_extend
1 parent d709e6e commit aa74c75

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

compiler/rustc_mir/src/monomorphize/partitioning/merging.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub fn merge_codegen_units<'tcx>(
4646
// Record that `second_smallest` now contains all the stuff that was in
4747
// `smallest` before.
4848
let mut consumed_cgu_names = cgu_contents.remove(&smallest.name()).unwrap();
49-
cgu_contents.get_mut(&second_smallest.name()).unwrap().extend(consumed_cgu_names.drain(..));
49+
cgu_contents.get_mut(&second_smallest.name()).unwrap().append(&mut consumed_cgu_names);
5050

5151
debug!(
5252
"CodegenUnit {} merged into CodegenUnit {}",

compiler/rustc_mir/src/transform/inline.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,8 +614,8 @@ impl Inliner<'tcx> {
614614
.vars_and_temps_iter()
615615
.map(|local| callee_body.local_decls[local].clone()),
616616
);
617-
caller_body.source_scopes.extend(callee_body.source_scopes.drain(..));
618-
caller_body.var_debug_info.extend(callee_body.var_debug_info.drain(..));
617+
caller_body.source_scopes.extend(&mut callee_body.source_scopes.drain(..));
618+
caller_body.var_debug_info.append(&mut callee_body.var_debug_info);
619619
caller_body.basic_blocks_mut().extend(callee_body.basic_blocks_mut().drain(..));
620620

621621
caller_body[callsite.block].terminator = Some(Terminator {

compiler/rustc_traits/src/dropck_outlives.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ fn dropck_outlives<'tcx>(
9090

9191
// "outlives" represent types/regions that may be touched
9292
// by a destructor.
93-
result.kinds.extend(constraints.outlives.drain(..));
94-
result.overflows.extend(constraints.overflows.drain(..));
93+
result.kinds.append(&mut constraints.outlives);
94+
result.overflows.append(&mut constraints.overflows);
9595

9696
// If we have even one overflow, we should stop trying to evaluate further --
9797
// chances are, the subsequent overflows for this evaluation won't provide useful

0 commit comments

Comments
 (0)