needless clones

This commit is contained in:
Oliver Schneider
2016-09-13 13:03:54 +02:00
parent 903bb97c17
commit c57233abca
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -20,8 +20,8 @@ pub fn get_vtable(&mut self, trait_ref: ty::PolyTraitRef<'tcx>) -> EvalResult<'t
debug!("get_vtable(trait_ref={:?})", trait_ref);
let methods: Vec<_> = traits::supertraits(tcx, trait_ref.clone()).flat_map(|trait_ref| {
match self.fulfill_obligation(trait_ref.clone()) {
let methods: Vec<_> = traits::supertraits(tcx, trait_ref).flat_map(|trait_ref| {
match self.fulfill_obligation(trait_ref) {
// Should default trait error here?
traits::VtableDefaultImpl(_) |
traits::VtableBuiltin(_) => {
+1 -1
View File
@@ -314,7 +314,7 @@ pub fn get_closure(&self, id: AllocId) -> EvalResult<'tcx, (DefId, ClosureSubsts
Some(&FunctionDefinition {
def_id,
kind: FunctionKind::Closure { ref substs, ref ty }
}) => Ok((def_id, substs.clone(), ty.clone())),
}) => Ok((def_id, *substs, ty.clone())),
Some(&FunctionDefinition {
kind: FunctionKind::Function { .. }, ..
}) => Err(EvalError::CalledClosureAsFunction),