about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-12-24 10:16:06 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2020-12-24 12:59:22 +0100
commit6e852cc4ce3b99048d164c58456371c25669c672 (patch)
tree7c0a2e56a0fd8b3caeba59e9e72c9ce282aa931e /compiler
parentc34c015fe2710caf53ba7ae9d1644f9ba65a6f74 (diff)
downloadrust-6e852cc4ce3b99048d164c58456371c25669c672.tar.gz
rust-6e852cc4ce3b99048d164c58456371c25669c672.zip
remove redundant clones (clippy::redundant_clone)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_infer/src/infer/mod.rs2
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_infer/src/infer/mod.rs b/compiler/rustc_infer/src/infer/mod.rs
index 069f708856e..56d9634213a 100644
--- a/compiler/rustc_infer/src/infer/mod.rs
+++ b/compiler/rustc_infer/src/infer/mod.rs
@@ -1317,7 +1317,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
         T: TypeFoldable<'tcx>,
     {
         if !value.needs_infer() {
-            return value.clone(); // Avoid duplicated subst-folding.
+            return value; // Avoid duplicated subst-folding.
         }
         let mut r = resolve::OpportunisticVarResolver::new(self);
         value.fold_with(&mut r)
diff --git a/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs b/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs
index d79dd97a69a..db2fa5730a3 100644
--- a/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs
+++ b/compiler/rustc_mir_build/src/thir/pattern/deconstruct_pat.rs
@@ -328,8 +328,8 @@ struct SplitIntRange {
 }
 
 impl SplitIntRange {
-    fn new(r: IntRange) -> Self {
-        SplitIntRange { range: r.clone(), borders: Vec::new() }
+    fn new(range: IntRange) -> Self {
+        SplitIntRange { range, borders: Vec::new() }
     }
 
     /// Internal use