@@ -21,7 +21,6 @@ use util::ppaux::ty_to_str;
2121
2222use std:: cmp;
2323use std:: iter;
24- use std:: vec;
2524use syntax:: ast:: * ;
2625use syntax:: ast_util:: { unguarded_pat, walk_pat} ;
2726use syntax:: codemap:: { DUMMY_SP , Span } ;
@@ -560,11 +559,10 @@ fn specialize(cx: &MatchCheckCtxt,
560559 Pat { id : pat_id, node : n, span : pat_span} =>
561560 match n {
562561 PatWild => {
563- Some ( vec :: append ( Vec :: from_elem ( arity, wild ( ) ) , r. tail ( ) ) )
562+ Some ( Vec :: from_elem ( arity, wild ( ) ) . append ( r. tail ( ) ) )
564563 }
565564 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 ( ) ) )
568566 }
569567 PatIdent ( _, _, _) => {
570568 let opt_def = cx. tcx . def_map . borrow ( ) . find_copy ( & pat_id) ;
@@ -615,12 +613,7 @@ fn specialize(cx: &MatchCheckCtxt,
615613 }
616614 }
617615 _ => {
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 ( ) ) )
624617 }
625618 }
626619 }
@@ -667,7 +660,7 @@ fn specialize(cx: &MatchCheckCtxt,
667660 Some ( args) => args. iter ( ) . map ( |x| * x) . collect ( ) ,
668661 None => Vec :: from_elem ( arity, wild ( ) )
669662 } ;
670- Some ( vec :: append ( args , r. tail ( ) ) )
663+ Some ( args . append ( r. tail ( ) ) )
671664 }
672665 DefVariant ( _, _, _) => None ,
673666
@@ -680,7 +673,7 @@ fn specialize(cx: &MatchCheckCtxt,
680673 }
681674 None => new_args = Vec :: from_elem ( arity, wild ( ) )
682675 }
683- Some ( vec :: append ( new_args , r. tail ( ) ) )
676+ Some ( new_args . append ( r. tail ( ) ) )
684677 }
685678 _ => None
686679 }
@@ -697,8 +690,8 @@ fn specialize(cx: &MatchCheckCtxt,
697690 Some ( f) => f. pat ,
698691 _ => wild ( )
699692 }
700- } ) . collect ( ) ;
701- Some ( vec :: append ( args , r. tail ( ) ) )
693+ } ) . collect :: < Vec < _ > > ( ) ;
694+ Some ( args . append ( r. tail ( ) ) )
702695 } else {
703696 None
704697 }
@@ -728,16 +721,16 @@ fn specialize(cx: &MatchCheckCtxt,
728721 Some ( f) => f. pat ,
729722 _ => wild ( )
730723 }
731- } ) . collect ( ) ;
732- Some ( vec :: append ( args , r. tail ( ) ) )
724+ } ) . collect :: < Vec < _ > > ( ) ;
725+ Some ( args . append ( r. tail ( ) ) )
733726 }
734727 }
735728 }
736729 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 ( ) ) )
738731 }
739732 PatUniq ( a) | PatRegion ( a) => {
740- Some ( vec :: append ( vec ! ( a) , r. tail ( ) ) )
733+ Some ( ( vec ! ( a) ) . append ( r. tail ( ) ) )
741734 }
742735 PatLit ( expr) => {
743736 let e_v = eval_const_expr ( cx. tcx , expr) ;
0 commit comments