Skip to content

Commit 9e9e023

Browse files
committed
More formatting improvements
1 parent 400cb14 commit 9e9e023

File tree

2 files changed

+10
-13
lines changed

2 files changed

+10
-13
lines changed

src/librustc_mir/hair/pattern/_match.rs

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ fn is_useful_specialized<'p, 'a:'p, 'tcx: 'a>(
11481148
.collect()
11491149
),
11501150
result => result
1151-
},
1151+
}
11521152
None => NotUseful
11531153
}
11541154
}
@@ -1167,16 +1167,13 @@ fn pat_constructors<'tcx>(cx: &mut MatchCheckCtxt,
11671167
-> Option<Vec<Constructor<'tcx>>>
11681168
{
11691169
match *pat.kind {
1170-
PatternKind::Binding { .. } | PatternKind::Wild =>
1171-
None,
1172-
PatternKind::Leaf { .. } | PatternKind::Deref { .. } =>
1173-
Some(vec![Single]),
1174-
PatternKind::Variant { adt_def, variant_index, .. } =>
1175-
Some(vec![Variant(adt_def.variants[variant_index].did)]),
1176-
PatternKind::Constant { value } =>
1177-
Some(vec![ConstantValue(value)]),
1178-
PatternKind::Range { lo, hi, end } =>
1179-
Some(vec![ConstantRange(lo, hi, end)]),
1170+
PatternKind::Binding { .. } | PatternKind::Wild => None,
1171+
PatternKind::Leaf { .. } | PatternKind::Deref { .. } => Some(vec![Single]),
1172+
PatternKind::Variant { adt_def, variant_index, .. } => {
1173+
Some(vec![Variant(adt_def.variants[variant_index].did)])
1174+
}
1175+
PatternKind::Constant { value } => Some(vec![ConstantValue(value)]),
1176+
PatternKind::Range { lo, hi, end } => Some(vec![ConstantRange(lo, hi, end)]),
11801177
PatternKind::Array { .. } => match pcx.ty.sty {
11811178
ty::TyArray(_, length) => Some(vec![
11821179
Slice(length.unwrap_usize(cx.tcx))
@@ -1390,7 +1387,7 @@ fn specialize<'p, 'a: 'p, 'tcx: 'a>(
13901387
let head: Option<Vec<&Pattern>> = match *pat.kind {
13911388
PatternKind::Binding { .. } | PatternKind::Wild => {
13921389
Some(wild_patterns.to_owned())
1393-
},
1390+
}
13941391

13951392
PatternKind::Variant { adt_def, variant_index, ref subpatterns, .. } => {
13961393
let ref variant = adt_def.variants[variant_index];

src/librustc_mir/hair/pattern/check_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ fn check_arms<'a, 'tcx>(cx: &mut MatchCheckCtxt<'a, 'tcx>,
391391
printed_if_let_err = true;
392392
}
393393
}
394-
},
394+
}
395395

396396
hir::MatchSource::WhileLetDesugar => {
397397
// check which arm we're on.

0 commit comments

Comments
 (0)