]> git.lizzy.rs Git - rust.git/commitdiff
More formatting improvements
authorvarkor <github@varkor.com>
Mon, 13 Aug 2018 15:23:14 +0000 (16:23 +0100)
committervarkor <github@varkor.com>
Thu, 16 Aug 2018 19:09:05 +0000 (20:09 +0100)
src/librustc_mir/hair/pattern/_match.rs
src/librustc_mir/hair/pattern/check_match.rs

index 87afa82b6bd23343de567d737ad7b5588d4dc655..b464b9cb0bf03a809d253d36578962e88a8b7630 100644 (file)
@@ -1148,7 +1148,7 @@ fn is_useful_specialized<'p, 'a:'p, 'tcx: 'a>(
                     .collect()
             ),
             result => result
-        },
+        }
         None => NotUseful
     }
 }
@@ -1167,16 +1167,13 @@ fn pat_constructors<'tcx>(cx: &mut MatchCheckCtxt,
                           -> Option<Vec<Constructor<'tcx>>>
 {
     match *pat.kind {
-        PatternKind::Binding { .. } | PatternKind::Wild =>
-            None,
-        PatternKind::Leaf { .. } | PatternKind::Deref { .. } =>
-            Some(vec![Single]),
-        PatternKind::Variant { adt_def, variant_index, .. } =>
-            Some(vec![Variant(adt_def.variants[variant_index].did)]),
-        PatternKind::Constant { value } =>
-            Some(vec![ConstantValue(value)]),
-        PatternKind::Range { lo, hi, end } =>
-            Some(vec![ConstantRange(lo, hi, end)]),
+        PatternKind::Binding { .. } | PatternKind::Wild => None,
+        PatternKind::Leaf { .. } | PatternKind::Deref { .. } => Some(vec![Single]),
+        PatternKind::Variant { adt_def, variant_index, .. } => {
+            Some(vec![Variant(adt_def.variants[variant_index].did)])
+        }
+        PatternKind::Constant { value } => Some(vec![ConstantValue(value)]),
+        PatternKind::Range { lo, hi, end } => Some(vec![ConstantRange(lo, hi, end)]),
         PatternKind::Array { .. } => match pcx.ty.sty {
             ty::TyArray(_, length) => Some(vec![
                 Slice(length.unwrap_usize(cx.tcx))
@@ -1390,7 +1387,7 @@ fn specialize<'p, 'a: 'p, 'tcx: 'a>(
     let head: Option<Vec<&Pattern>> = match *pat.kind {
         PatternKind::Binding { .. } | PatternKind::Wild => {
             Some(wild_patterns.to_owned())
-        },
+        }
 
         PatternKind::Variant { adt_def, variant_index, ref subpatterns, .. } => {
             let ref variant = adt_def.variants[variant_index];
index 3a1e29dfe97b0ac4ab483fbb19da41715be41bfa..7f6298fd1717391e461ef2fa44dafbf33b8e22d4 100644 (file)
@@ -391,7 +391,7 @@ fn check_arms<'a, 'tcx>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
                                     printed_if_let_err = true;
                                 }
                             }
-                        },
+                        }
 
                         hir::MatchSource::WhileLetDesugar => {
                             // check which arm we're on.