@@ -21,7 +21,6 @@ use util::ppaux::ty_to_str;
21
21
22
22
use std:: cmp;
23
23
use std:: iter;
24
- use std:: vec;
25
24
use syntax:: ast:: * ;
26
25
use syntax:: ast_util:: { unguarded_pat, walk_pat} ;
27
26
use syntax:: codemap:: { DUMMY_SP , Span } ;
@@ -560,11 +559,10 @@ fn specialize(cx: &MatchCheckCtxt,
560
559
Pat { id : pat_id, node : n, span : pat_span} =>
561
560
match n {
562
561
PatWild => {
563
- Some ( vec :: append ( Vec :: from_elem ( arity, wild ( ) ) , r. tail ( ) ) )
562
+ Some ( Vec :: from_elem ( arity, wild ( ) ) . append ( r. tail ( ) ) )
564
563
}
565
564
PatWildMulti => {
566
- Some ( vec:: append ( Vec :: from_elem ( arity, wild_multi ( ) ) ,
567
- r. tail ( ) ) )
565
+ Some ( Vec :: from_elem ( arity, wild_multi ( ) ) . append ( r. tail ( ) ) )
568
566
}
569
567
PatIdent ( _, _, _) => {
570
568
let opt_def = cx. tcx . def_map . borrow ( ) . find_copy ( & pat_id) ;
@@ -615,12 +613,7 @@ fn specialize(cx: &MatchCheckCtxt,
615
613
}
616
614
}
617
615
_ => {
618
- Some (
619
- vec:: append (
620
- Vec :: from_elem ( arity, wild ( ) ) ,
621
- r. tail ( )
622
- )
623
- )
616
+ Some ( Vec :: from_elem ( arity, wild ( ) ) . append ( r. tail ( ) ) )
624
617
}
625
618
}
626
619
}
@@ -667,7 +660,7 @@ fn specialize(cx: &MatchCheckCtxt,
667
660
Some ( args) => args. iter ( ) . map ( |x| * x) . collect ( ) ,
668
661
None => Vec :: from_elem ( arity, wild ( ) )
669
662
} ;
670
- Some ( vec :: append ( args , r. tail ( ) ) )
663
+ Some ( args . append ( r. tail ( ) ) )
671
664
}
672
665
DefVariant ( _, _, _) => None ,
673
666
@@ -680,7 +673,7 @@ fn specialize(cx: &MatchCheckCtxt,
680
673
}
681
674
None => new_args = Vec :: from_elem ( arity, wild ( ) )
682
675
}
683
- Some ( vec :: append ( new_args , r. tail ( ) ) )
676
+ Some ( new_args . append ( r. tail ( ) ) )
684
677
}
685
678
_ => None
686
679
}
@@ -697,8 +690,8 @@ fn specialize(cx: &MatchCheckCtxt,
697
690
Some ( f) => f. pat ,
698
691
_ => wild ( )
699
692
}
700
- } ) . collect ( ) ;
701
- Some ( vec :: append ( args , r. tail ( ) ) )
693
+ } ) . collect :: < Vec < _ > > ( ) ;
694
+ Some ( args . append ( r. tail ( ) ) )
702
695
} else {
703
696
None
704
697
}
@@ -728,16 +721,16 @@ fn specialize(cx: &MatchCheckCtxt,
728
721
Some ( f) => f. pat ,
729
722
_ => wild ( )
730
723
}
731
- } ) . collect ( ) ;
732
- Some ( vec :: append ( args , r. tail ( ) ) )
724
+ } ) . collect :: < Vec < _ > > ( ) ;
725
+ Some ( args . append ( r. tail ( ) ) )
733
726
}
734
727
}
735
728
}
736
729
PatTup ( args) => {
737
- Some ( vec :: append ( args. iter ( ) . map ( |x| * x) . collect ( ) , r. tail ( ) ) )
730
+ Some ( args. iter ( ) . map ( |x| * x) . collect :: < Vec < _ > > ( ) . append ( r. tail ( ) ) )
738
731
}
739
732
PatUniq ( a) | PatRegion ( a) => {
740
- Some ( vec :: append ( vec ! ( a) , r. tail ( ) ) )
733
+ Some ( ( vec ! ( a) ) . append ( r. tail ( ) ) )
741
734
}
742
735
PatLit ( expr) => {
743
736
let e_v = eval_const_expr ( cx. tcx , expr) ;
0 commit comments