@@ -551,16 +551,15 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
551
551
//
552
552
// FIXME(#29623) we could use PatKind::Range to rule
553
553
// things out here, in some cases.
554
- (
555
- & TestKind :: SwitchInt { switch_ty : _, ref options } ,
556
- & PatKind :: Constant { ref value } ,
557
- ) if is_switch_ty ( match_pair. pattern . ty ) => {
554
+ ( TestKind :: SwitchInt { switch_ty : _, options } , PatKind :: Constant { value } )
555
+ if is_switch_ty ( match_pair. pattern . ty ) =>
556
+ {
558
557
let index = options. get_index_of ( value) . unwrap ( ) ;
559
558
self . candidate_without_match_pair ( match_pair_index, candidate) ;
560
559
Some ( index)
561
560
}
562
561
563
- ( & TestKind :: SwitchInt { switch_ty : _, ref options } , & PatKind :: Range ( ref range) ) => {
562
+ ( TestKind :: SwitchInt { switch_ty : _, options } , PatKind :: Range ( range) ) => {
564
563
let not_contained =
565
564
self . values_not_contained_in_range ( & * range, options) . unwrap_or ( false ) ;
566
565
@@ -578,7 +577,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
578
577
579
578
(
580
579
& TestKind :: Len { len : test_len, op : BinOp :: Eq } ,
581
- & PatKind :: Slice { ref prefix, ref slice, ref suffix } ,
580
+ PatKind :: Slice { prefix, slice, suffix } ,
582
581
) => {
583
582
let pat_len = ( prefix. len ( ) + suffix. len ( ) ) as u64 ;
584
583
match ( test_len. cmp ( & pat_len) , slice) {
@@ -615,7 +614,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
615
614
616
615
(
617
616
& TestKind :: Len { len : test_len, op : BinOp :: Ge } ,
618
- & PatKind :: Slice { ref prefix, ref slice, ref suffix } ,
617
+ PatKind :: Slice { prefix, slice, suffix } ,
619
618
) => {
620
619
// the test is `$actual_len >= test_len`
621
620
let pat_len = ( prefix. len ( ) + suffix. len ( ) ) as u64 ;
@@ -651,7 +650,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
651
650
}
652
651
}
653
652
654
- ( & TestKind :: Range ( ref test) , & PatKind :: Range ( ref pat) ) => {
653
+ ( TestKind :: Range ( test) , PatKind :: Range ( pat) ) => {
655
654
use std:: cmp:: Ordering :: * ;
656
655
657
656
if test == pat {
@@ -678,7 +677,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
678
677
no_overlap
679
678
}
680
679
681
- ( & TestKind :: Range ( ref range) , & PatKind :: Constant { value } ) => {
680
+ ( TestKind :: Range ( range) , & PatKind :: Constant { value } ) => {
682
681
if let Some ( false ) = self . const_range_contains ( & * range, value) {
683
682
// `value` is not contained in the testing range,
684
683
// so `value` can be matched only if this test fails.
0 commit comments