Skip to content

Commit

Permalink
clippy:: append_instead_of_extend
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Jul 25, 2021
1 parent d709e6e commit aa74c75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Expand Up @@ -46,7 +46,7 @@ pub fn merge_codegen_units<'tcx>(
// Record that `second_smallest` now contains all the stuff that was in
// `smallest` before.
let mut consumed_cgu_names = cgu_contents.remove(&smallest.name()).unwrap();
cgu_contents.get_mut(&second_smallest.name()).unwrap().extend(consumed_cgu_names.drain(..));
cgu_contents.get_mut(&second_smallest.name()).unwrap().append(&mut consumed_cgu_names);

debug!(
"CodegenUnit {} merged into CodegenUnit {}",
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_mir/src/transform/inline.rs
Expand Up @@ -614,8 +614,8 @@ impl Inliner<'tcx> {
.vars_and_temps_iter()
.map(|local| callee_body.local_decls[local].clone()),
);
caller_body.source_scopes.extend(callee_body.source_scopes.drain(..));
caller_body.var_debug_info.extend(callee_body.var_debug_info.drain(..));
caller_body.source_scopes.extend(&mut callee_body.source_scopes.drain(..));
caller_body.var_debug_info.append(&mut callee_body.var_debug_info);
caller_body.basic_blocks_mut().extend(callee_body.basic_blocks_mut().drain(..));

caller_body[callsite.block].terminator = Some(Terminator {
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_traits/src/dropck_outlives.rs
Expand Up @@ -90,8 +90,8 @@ fn dropck_outlives<'tcx>(

// "outlives" represent types/regions that may be touched
// by a destructor.
result.kinds.extend(constraints.outlives.drain(..));
result.overflows.extend(constraints.overflows.drain(..));
result.kinds.append(&mut constraints.outlives);
result.overflows.append(&mut constraints.overflows);

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

0 comments on commit aa74c75

Please sign in to comment.