needless clones

This commit is contained in:
Oliver Schneider 2016-09-13 13:03:54 +02:00
parent 903bb97c17
commit c57233abca
No known key found for this signature in database
GPG key ID: 56D6EEA0FC67AC46
2 changed files with 3 additions and 3 deletions

View file

@ -20,8 +20,8 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
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(_) => {

View file

@ -314,7 +314,7 @@ impl<'a, 'tcx> Memory<'a, 'tcx> {
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),