1
Fork 0

array pattern

This commit is contained in:
Bastian Kauschke 2020-09-17 10:01:24 +02:00
parent 3435683fd5
commit bfb221b21e

View file

@ -2300,18 +2300,18 @@ fn split_grouped_constructors<'p, 'tcx>(
split_ctors.extend( split_ctors.extend(
borders borders
.array_windows() .array_windows()
.filter_map(|&[fst, snd]| match (fst, snd) { .filter_map(|&pair| match pair {
(Border::JustBefore(n), Border::JustBefore(m)) => { [Border::JustBefore(n), Border::JustBefore(m)] => {
if n < m { if n < m {
Some(IntRange { range: n..=(m - 1), ty, span }) Some(IntRange { range: n..=(m - 1), ty, span })
} else { } else {
None None
} }
} }
(Border::JustBefore(n), Border::AfterMax) => { [Border::JustBefore(n), Border::AfterMax] => {
Some(IntRange { range: n..=u128::MAX, ty, span }) Some(IntRange { range: n..=u128::MAX, ty, span })
} }
(Border::AfterMax, _) => None, [Border::AfterMax, _] => None,
}) })
.map(IntRange), .map(IntRange),
); );