From 8206939fed0e2307455d46620ee114f74ab35d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Wed, 26 May 2021 18:34:50 +0300 Subject: clippy::redundant_clone fixes --- crates/hir_ty/src/infer/pat.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'crates/hir_ty/src/infer/pat.rs') diff --git a/crates/hir_ty/src/infer/pat.rs b/crates/hir_ty/src/infer/pat.rs index 9c8e3b6ae..83e0a7a9e 100644 --- a/crates/hir_ty/src/infer/pat.rs +++ b/crates/hir_ty/src/infer/pat.rs @@ -196,7 +196,7 @@ impl<'a> InferenceContext<'a> { let inner_ty = if let Some(subpat) = subpat { self.infer_pat(*subpat, &expected, default_bm) } else { - expected.clone() + expected }; let inner_ty = self.insert_type_vars_shallow(inner_ty); @@ -266,10 +266,9 @@ impl<'a> InferenceContext<'a> { // use a new type variable if we got error type here let ty = self.insert_type_vars_shallow(ty); if !self.unify(&ty, &expected) { - self.result.type_mismatches.insert( - pat.into(), - TypeMismatch { expected: expected.clone(), actual: ty.clone() }, - ); + self.result + .type_mismatches + .insert(pat.into(), TypeMismatch { expected: expected, actual: ty.clone() }); } self.write_pat_ty(pat, ty.clone()); ty -- cgit v1.2.3