@@ -103,12 +103,14 @@ fn expand(cx: ext_ctxt,
103
103
vec:: flat_map ( in_items) { |in_item|
104
104
alt in_item. node {
105
105
ast:: item_ty ( ty, tps, _) {
106
- [ filter_attrs ( in_item) ] /~ + ty_fns ( cx, in_item. ident , ty, tps)
106
+ vec:: append ( [ filter_attrs ( in_item) ] /~,
107
+ ty_fns ( cx, in_item. ident , ty, tps) )
107
108
}
108
109
109
110
ast:: item_enum ( variants, tps, _) {
110
- [ filter_attrs ( in_item) ] /~ + enum_fns ( cx, in_item. ident ,
111
- in_item. span , variants, tps)
111
+ vec:: append ( [ filter_attrs ( in_item) ] /~,
112
+ enum_fns ( cx, in_item. ident ,
113
+ in_item. span , variants, tps) )
112
114
}
113
115
114
116
_ {
@@ -126,7 +128,8 @@ impl helpers for ext_ctxt {
126
128
helper_name : str ) -> @ast:: path {
127
129
let head = vec:: init ( base_path. idents ) ;
128
130
let tail = vec:: last ( base_path. idents ) ;
129
- self . path ( base_path. span , head + [ @( helper_name + "_" + * tail) ] /~)
131
+ self . path ( base_path. span ,
132
+ vec:: append ( head, [ @( helper_name + "_" + * tail) ] /~) )
130
133
}
131
134
132
135
fn path ( span : span , strs : [ ast:: ident ] /~) -> @ast:: path {
@@ -301,7 +304,7 @@ fn ser_path(cx: ext_ctxt, tps: ser_tps_map, path: @ast::path,
301
304
[ cx. stmt (
302
305
cx. expr (
303
306
path. span ,
304
- ast:: expr_call ( callee, [ s, v] /~ + ty_args, false ) ) ) ] /~
307
+ ast:: expr_call ( callee, vec :: append ( [ s, v] /~, ty_args) , false ) ) ) ] /~
305
308
}
306
309
307
310
fn ser_variant ( cx: ext_ctxt,
@@ -502,15 +505,15 @@ fn mk_ser_fn(cx: ext_ctxt, span: span, name: ast::ident,
502
505
503
506
504
507
let ser_inputs: [ ast:: arg ] /~ =
505
- [ { mode: ast:: expl ( ast:: by_ref) ,
506
- ty: cx. ty_path ( span, [ @"__S"] /~, [ ] /~) ,
507
- ident: @"__s",
508
- id: cx. next_id ( ) } ,
509
- { mode: ast:: expl ( ast:: by_ref) ,
510
- ty: v_ty,
511
- ident: @"__v",
512
- id: cx. next_id ( ) } ] /~
513
- + tp_inputs;
508
+ vec :: append ( [ { mode: ast:: expl ( ast:: by_ref) ,
509
+ ty: cx. ty_path ( span, [ @"__S"] /~, [ ] /~) ,
510
+ ident: @"__s",
511
+ id: cx. next_id ( ) } ,
512
+ { mode: ast:: expl ( ast:: by_ref) ,
513
+ ty: v_ty,
514
+ ident: @"__v",
515
+ id: cx. next_id ( ) } ] /~,
516
+ tp_inputs) ;
514
517
515
518
let tps_map = map:: str_hash ( ) ;
516
519
vec:: iter2 ( tps, tp_inputs) { |tp, arg|
@@ -531,10 +534,10 @@ fn mk_ser_fn(cx: ext_ctxt, span: span, name: ast::ident,
531
534
[ ] /~) ) ] /~;
532
535
533
536
let ser_tps: [ ast:: ty_param ] /~ =
534
- [ { ident: @"__S",
535
- id: cx. next_id ( ) ,
536
- bounds: ser_bnds} ] /~ +
537
- vec:: map ( tps) { |tp| cx. clone_ty_param ( tp) } ;
537
+ vec :: append ( [ { ident: @"__S",
538
+ id: cx. next_id ( ) ,
539
+ bounds: ser_bnds} ] /~,
540
+ vec:: map ( tps) { |tp| cx. clone_ty_param ( tp) } ) ;
538
541
539
542
let ser_output: @ast:: ty = @{ id: cx. next_id ( ) ,
540
543
node: ast:: ty_nil,
@@ -575,7 +578,8 @@ fn deser_path(cx: ext_ctxt, tps: deser_tps_map, path: @ast::path,
575
578
cx. lambda ( cx. expr_blk ( dv_expr) )
576
579
} ;
577
580
578
- cx. expr ( path. span , ast:: expr_call ( callee, [ d] /~ + ty_args, false ) )
581
+ cx. expr ( path. span , ast:: expr_call ( callee, vec:: append ( [ d] /~, ty_args) ,
582
+ false ) )
579
583
}
580
584
581
585
fn deser_lambda ( cx : ext_ctxt , tps : deser_tps_map , ty : @ast:: ty ,
@@ -712,11 +716,11 @@ fn mk_deser_fn(cx: ext_ctxt, span: span,
712
716
#debug[ "tp_inputs = %?" , tp_inputs] ;
713
717
714
718
let deser_inputs: [ ast:: arg ] /~ =
715
- [ { mode: ast:: expl ( ast:: by_ref) ,
716
- ty: cx. ty_path ( span, [ @"__D"] /~, [ ] /~) ,
717
- ident: @"__d",
718
- id: cx. next_id ( ) } ] /~
719
- + tp_inputs;
719
+ vec :: append ( [ { mode: ast:: expl ( ast:: by_ref) ,
720
+ ty: cx. ty_path ( span, [ @"__D"] /~, [ ] /~) ,
721
+ ident: @"__d",
722
+ id: cx. next_id ( ) } ] /~,
723
+ tp_inputs) ;
720
724
721
725
let tps_map = map:: str_hash ( ) ;
722
726
vec:: iter2 ( tps, tp_inputs) { |tp, arg|
@@ -740,7 +744,9 @@ fn mk_deser_fn(cx: ext_ctxt, span: span,
740
744
id: cx. next_id ( ) ,
741
745
bounds: deser_bnds} ] /~ + vec:: map ( tps) { |tp|
742
746
let cloned = cx. clone_ty_param ( tp) ;
743
- { bounds: @( * cloned. bounds + [ ast:: bound_copy] /~) with cloned}
747
+ { bounds : @( vec:: append ( * cloned. bounds ,
748
+ [ ast:: bound_copy] /~) )
749
+ with cloned}
744
750
} ;
745
751
746
752
let deser_blk = cx. expr_blk ( f ( cx, tps_map, #ast ( expr) { __d} ) ) ;
0 commit comments