about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
-rw-r--r--compiler/rustc_pattern_analysis/src/constructor.rs16
1 files changed, 6 insertions, 10 deletions
diff --git a/compiler/rustc_pattern_analysis/src/constructor.rs b/compiler/rustc_pattern_analysis/src/constructor.rs
index 24824682b74..483986969d1 100644
--- a/compiler/rustc_pattern_analysis/src/constructor.rs
+++ b/compiler/rustc_pattern_analysis/src/constructor.rs
@@ -694,18 +694,14 @@ impl<Cx: TypeCx> Clone for Constructor<Cx> {
     fn clone(&self) -> Self {
         match self {
             Constructor::Struct => Constructor::Struct,
-            Constructor::Variant(idx) => Constructor::Variant(idx.clone()),
+            Constructor::Variant(idx) => Constructor::Variant(*idx),
             Constructor::Ref => Constructor::Ref,
-            Constructor::Slice(slice) => Constructor::Slice(slice.clone()),
+            Constructor::Slice(slice) => Constructor::Slice(*slice),
             Constructor::UnionField => Constructor::UnionField,
-            Constructor::Bool(b) => Constructor::Bool(b.clone()),
-            Constructor::IntRange(range) => Constructor::IntRange(range.clone()),
-            Constructor::F32Range(lo, hi, end) => {
-                Constructor::F32Range(lo.clone(), hi.clone(), end.clone())
-            }
-            Constructor::F64Range(lo, hi, end) => {
-                Constructor::F64Range(lo.clone(), hi.clone(), end.clone())
-            }
+            Constructor::Bool(b) => Constructor::Bool(*b),
+            Constructor::IntRange(range) => Constructor::IntRange(*range),
+            Constructor::F32Range(lo, hi, end) => Constructor::F32Range(lo.clone(), *hi, *end),
+            Constructor::F64Range(lo, hi, end) => Constructor::F64Range(lo.clone(), *hi, *end),
             Constructor::Str(value) => Constructor::Str(value.clone()),
             Constructor::Opaque(inner) => Constructor::Opaque(inner.clone()),
             Constructor::Or => Constructor::Or,