remove redundant clones in librustc_mir_build and librustc_data_structures

This commit is contained in:
Matthias Krüger 2020-02-24 14:42:14 +01:00
parent 79cd224e75
commit 5ae4500eff
2 changed files with 3 additions and 3 deletions

View File

@ -314,7 +314,7 @@ impl<O: ForestObligation> ObligationForest<O> {
return Ok(());
}
match self.active_cache.entry(obligation.as_cache_key().clone()) {
match self.active_cache.entry(obligation.as_cache_key()) {
Entry::Occupied(o) => {
let node = &mut self.nodes[*o.get()];
if let Some(parent_index) = parent {
@ -385,7 +385,7 @@ impl<O: ForestObligation> ObligationForest<O> {
self.error_cache
.entry(node.obligation_tree_id)
.or_default()
.insert(node.obligation.as_cache_key().clone());
.insert(node.obligation.as_cache_key());
}
/// Performs a pass through the obligation list. This must

View File

@ -649,7 +649,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
}
}
PatKind::Or { ref pats } => {
self.visit_bindings(&pats[0], pattern_user_ty.clone(), f);
self.visit_bindings(&pats[0], pattern_user_ty, f);
}
}
}