Skip to content

Commit 5ae4500

Browse files
committed
remove redundant clones in librustc_mir_build and librustc_data_structures
1 parent 79cd224 commit 5ae4500

File tree

2 files changed

+3
-3
lines changed
  • src
    • librustc_data_structures/obligation_forest
    • librustc_mir_build/build/matches

2 files changed

+3
-3
lines changed

src/librustc_data_structures/obligation_forest/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ impl<O: ForestObligation> ObligationForest<O> {
314314
return Ok(());
315315
}
316316

317-
match self.active_cache.entry(obligation.as_cache_key().clone()) {
317+
match self.active_cache.entry(obligation.as_cache_key()) {
318318
Entry::Occupied(o) => {
319319
let node = &mut self.nodes[*o.get()];
320320
if let Some(parent_index) = parent {
@@ -385,7 +385,7 @@ impl<O: ForestObligation> ObligationForest<O> {
385385
self.error_cache
386386
.entry(node.obligation_tree_id)
387387
.or_default()
388-
.insert(node.obligation.as_cache_key().clone());
388+
.insert(node.obligation.as_cache_key());
389389
}
390390

391391
/// Performs a pass through the obligation list. This must

src/librustc_mir_build/build/matches/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
649649
}
650650
}
651651
PatKind::Or { ref pats } => {
652-
self.visit_bindings(&pats[0], pattern_user_ty.clone(), f);
652+
self.visit_bindings(&pats[0], pattern_user_ty, f);
653653
}
654654
}
655655
}

0 commit comments

Comments
 (0)