@@ -335,11 +335,11 @@ fn gen_node_with_inner_gen<'a>(node: Node<'a>, context: &mut Context<'a>, inner_
335
335
// decorators in these cases will have starts before their parent so they need to be handled specially
336
336
if let Node :: ExportDecl ( decl) = node {
337
337
if let Decl :: Class ( class_decl) = & decl. decl {
338
- items. extend ( gen_decorators ( & class_decl. class . decorators , false , context) ) ;
338
+ items. extend ( gen_decorators ( class_decl. class . decorators , false , context) ) ;
339
339
}
340
340
} else if let Node :: ExportDefaultDecl ( decl) = node {
341
341
if let DefaultDecl :: Class ( class_expr) = & decl. decl {
342
- items. extend ( gen_decorators ( & class_expr. class . decorators , false , context) ) ;
342
+ items. extend ( gen_decorators ( class_expr. class . decorators , false , context) ) ;
343
343
}
344
344
}
345
345
@@ -386,8 +386,8 @@ fn gen_node_with_inner_gen<'a>(node: Node<'a>, context: &mut Context<'a>, inner_
386
386
387
387
fn get_has_ignore_comment < ' a > ( leading_comments : & CommentsIterator < ' a > , node : Node < ' a > , context : & mut Context < ' a > ) -> bool {
388
388
let comments = match node. parent ( ) {
389
- Some ( Node :: JSXElement ( jsx_element) ) => get_comments_for_jsx_children ( & jsx_element. children , & node. start ( ) , context) ,
390
- Some ( Node :: JSXFragment ( jsx_fragment) ) => get_comments_for_jsx_children ( & jsx_fragment. children , & node. start ( ) , context) ,
389
+ Some ( Node :: JSXElement ( jsx_element) ) => get_comments_for_jsx_children ( jsx_element. children , & node. start ( ) , context) ,
390
+ Some ( Node :: JSXFragment ( jsx_fragment) ) => get_comments_for_jsx_children ( jsx_fragment. children , & node. start ( ) , context) ,
391
391
_ => leading_comments. clone ( ) ,
392
392
} ;
393
393
@@ -438,7 +438,7 @@ fn gen_class_method<'a>(node: &'a ClassMethod<'a>, context: &mut Context<'a>) ->
438
438
ClassOrObjectMethod {
439
439
node : node. into ( ) ,
440
440
parameters_range : node. get_parameters_range ( context) ,
441
- decorators : Some ( & node. function . decorators ) ,
441
+ decorators : Some ( node. function . decorators ) ,
442
442
accessibility : node. accessibility ( ) ,
443
443
is_static : node. is_static ( ) ,
444
444
is_async : node. function . is_async ( ) ,
@@ -465,7 +465,7 @@ fn gen_auto_accessor<'a>(node: &AutoAccessor<'a>, context: &mut Context<'a>) ->
465
465
value : node. value ,
466
466
type_ann : node. type_ann ,
467
467
is_static : node. is_static ( ) ,
468
- decorators : & node. decorators ,
468
+ decorators : node. decorators ,
469
469
computed : false ,
470
470
is_auto_accessor : true ,
471
471
is_declare : false ,
@@ -485,7 +485,7 @@ fn gen_private_method<'a>(node: &PrivateMethod<'a>, context: &mut Context<'a>) -
485
485
ClassOrObjectMethod {
486
486
node : node. into ( ) ,
487
487
parameters_range : node. get_parameters_range ( context) ,
488
- decorators : Some ( & node. function . decorators ) ,
488
+ decorators : Some ( node. function . decorators ) ,
489
489
accessibility : node. accessibility ( ) ,
490
490
is_static : node. is_static ( ) ,
491
491
is_async : node. function . is_async ( ) ,
@@ -512,7 +512,7 @@ fn gen_class_prop<'a>(node: &ClassProp<'a>, context: &mut Context<'a>) -> PrintI
512
512
value : node. value ,
513
513
type_ann : node. type_ann ,
514
514
is_static : node. is_static ( ) ,
515
- decorators : & node. decorators ,
515
+ decorators : node. decorators ,
516
516
computed : matches ! ( node. key, PropName :: Computed ( _) ) ,
517
517
is_auto_accessor : false ,
518
518
is_declare : node. declare ( ) ,
@@ -560,7 +560,7 @@ fn gen_decorator<'a>(node: &Decorator<'a>, context: &mut Context<'a>) -> PrintIt
560
560
561
561
fn gen_parameter_prop < ' a > ( node : & TsParamProp < ' a > , context : & mut Context < ' a > ) -> PrintItems {
562
562
let mut items = PrintItems :: new ( ) ;
563
- items. extend ( gen_decorators ( & node. decorators , true , context) ) ;
563
+ items. extend ( gen_decorators ( node. decorators , true , context) ) ;
564
564
if let Some ( accessibility) = node. accessibility ( ) {
565
565
items. push_string ( format ! ( "{} " , accessibility_to_str( accessibility) ) ) ;
566
566
}
@@ -589,7 +589,7 @@ fn gen_private_prop<'a>(node: &PrivateProp<'a>, context: &mut Context<'a>) -> Pr
589
589
value : node. value ,
590
590
type_ann : node. type_ann ,
591
591
is_static : node. is_static ( ) ,
592
- decorators : & node. decorators ,
592
+ decorators : node. decorators ,
593
593
computed : false ,
594
594
is_auto_accessor : false ,
595
595
is_declare : false ,
@@ -610,7 +610,7 @@ struct GenClassPropCommon<'a, 'b> {
610
610
pub value : Option < Expr < ' a > > ,
611
611
pub type_ann : Option < & ' a TsTypeAnn < ' a > > ,
612
612
pub is_static : bool ,
613
- pub decorators : & ' b Vec < & ' a Decorator < ' a > > ,
613
+ pub decorators : & ' b [ & ' a Decorator < ' a > ] ,
614
614
pub computed : bool ,
615
615
pub is_declare : bool ,
616
616
pub accessibility : Option < Accessibility > ,
@@ -805,7 +805,7 @@ fn gen_class_decl<'a>(node: &ClassDecl<'a>, context: &mut Context<'a>) -> PrintI
805
805
ClassDeclOrExpr {
806
806
node : node. into ( ) ,
807
807
member_node : node. class . into ( ) ,
808
- decorators : & node. class . decorators ,
808
+ decorators : node. class . decorators ,
809
809
is_class_expr : false ,
810
810
is_declare : node. declare ( ) ,
811
811
is_abstract : node. class . is_abstract ( ) ,
@@ -824,7 +824,7 @@ fn gen_class_decl<'a>(node: &ClassDecl<'a>, context: &mut Context<'a>) -> PrintI
824
824
struct ClassDeclOrExpr < ' a > {
825
825
node : Node < ' a > ,
826
826
member_node : Node < ' a > ,
827
- decorators : & ' a Vec < & ' a Decorator < ' a > > ,
827
+ decorators : & ' a [ & ' a Decorator < ' a > ] ,
828
828
is_class_expr : bool ,
829
829
is_declare : bool ,
830
830
is_abstract : bool ,
@@ -1023,7 +1023,7 @@ fn gen_export_named_decl<'a>(node: &NamedExport<'a>, context: &mut Context<'a>)
1023
1023
let mut namespace_export: Option < & ExportNamespaceSpecifier > = None ;
1024
1024
let mut named_exports: Vec < & ExportNamedSpecifier > = Vec :: new ( ) ;
1025
1025
1026
- for specifier in & node. specifiers {
1026
+ for specifier in node. specifiers {
1027
1027
match specifier {
1028
1028
ExportSpecifier :: Default ( node) => default_export = Some ( node) ,
1029
1029
ExportSpecifier :: Namespace ( node) => namespace_export = Some ( node) ,
@@ -1197,7 +1197,7 @@ fn gen_function_decl_or_expr<'a>(node: FunctionDeclOrExprNode<'a>, context: &mut
1197
1197
1198
1198
fn gen_param < ' a > ( node : & Param < ' a > , context : & mut Context < ' a > ) -> PrintItems {
1199
1199
let mut items = PrintItems :: new ( ) ;
1200
- items. extend ( gen_decorators ( & node. decorators , true , context) ) ;
1200
+ items. extend ( gen_decorators ( node. decorators , true , context) ) ;
1201
1201
items. extend ( gen_node ( node. pat . into ( ) , context) ) ;
1202
1202
items
1203
1203
}
@@ -1208,7 +1208,7 @@ fn gen_import_decl<'a>(node: &ImportDecl<'a>, context: &mut Context<'a>) -> Prin
1208
1208
let mut namespace_import: Option < & ImportStarAsSpecifier > = None ;
1209
1209
let mut named_imports: Vec < & ImportNamedSpecifier > = Vec :: new ( ) ;
1210
1210
1211
- for specifier in & node. specifiers {
1211
+ for specifier in node. specifiers {
1212
1212
match specifier {
1213
1213
ImportSpecifier :: Default ( node) => default_import = Some ( node) ,
1214
1214
ImportSpecifier :: Namespace ( node) => namespace_import = Some ( node) ,
@@ -1451,7 +1451,7 @@ fn gen_using_decl<'a>(node: &UsingDecl<'a>, context: &mut Context<'a>) -> PrintI
1451
1451
}
1452
1452
items. push_str ( "using " ) ;
1453
1453
1454
- items. extend ( gen_var_declarators ( node. into ( ) , & node. decls , context) ) ;
1454
+ items. extend ( gen_var_declarators ( node. into ( ) , node. decls , context) ) ;
1455
1455
1456
1456
if context. config . semi_colons . is_true ( ) {
1457
1457
items. push_str ( ";" ) ;
@@ -2167,7 +2167,7 @@ fn gen_call_or_opt_expr<'a>(node: CallOrOptCallExpr<'a>, context: &mut Context<'
2167
2167
fn gen_test_library_call_expr < ' a > ( node : & CallExpr < ' a > , context : & mut Context < ' a > ) -> PrintItems {
2168
2168
let mut items = PrintItems :: new ( ) ;
2169
2169
items. extend ( gen_test_library_callee ( & node. callee , context) ) ;
2170
- items. extend ( gen_test_library_arguments ( & node. args , context) ) ;
2170
+ items. extend ( gen_test_library_arguments ( node. args , context) ) ;
2171
2171
return items;
2172
2172
2173
2173
fn gen_test_library_callee < ' a , ' b > ( callee : & ' b Callee < ' a > , context : & mut Context < ' a > ) -> PrintItems {
@@ -2257,7 +2257,7 @@ fn gen_class_expr<'a>(node: &ClassExpr<'a>, context: &mut Context<'a>) -> PrintI
2257
2257
ClassDeclOrExpr {
2258
2258
node : node. into ( ) ,
2259
2259
member_node : node. class . into ( ) ,
2260
- decorators : & node. class . decorators ,
2260
+ decorators : node. class . decorators ,
2261
2261
is_class_expr : true ,
2262
2262
is_declare : false ,
2263
2263
is_abstract : node. class . is_abstract ( ) ,
@@ -4310,7 +4310,7 @@ fn gen_method_prop<'a>(node: &MethodProp<'a>, context: &mut Context<'a>) -> Prin
4310
4310
struct ClassOrObjectMethod < ' a > {
4311
4311
node : Node < ' a > ,
4312
4312
parameters_range : Option < SourceRange > ,
4313
- decorators : Option < & ' a Vec < & ' a Decorator < ' a > > > ,
4313
+ decorators : Option < & ' a [ & ' a Decorator < ' a > ] > ,
4314
4314
accessibility : Option < Accessibility > ,
4315
4315
is_static : bool ,
4316
4316
is_async : bool ,
@@ -5313,7 +5313,7 @@ fn gen_var_decl<'a>(node: &VarDecl<'a>, context: &mut Context<'a>) -> PrintItems
5313
5313
VarDeclKind :: Var => "var " ,
5314
5314
} ) ;
5315
5315
5316
- items. extend ( gen_var_declarators ( node. into ( ) , & node. decls , context) ) ;
5316
+ items. extend ( gen_var_declarators ( node. into ( ) , node. decls , context) ) ;
5317
5317
5318
5318
if requires_semi_colon ( node, context) {
5319
5319
items. push_str ( ";" ) ;
@@ -5812,7 +5812,7 @@ fn gen_intersection_type<'a>(node: &TsIntersectionType<'a>, context: &mut Contex
5812
5812
gen_union_or_intersection_type (
5813
5813
UnionOrIntersectionType {
5814
5814
node : node. into ( ) ,
5815
- types : & node. types ,
5815
+ types : node. types ,
5816
5816
is_union : false ,
5817
5817
} ,
5818
5818
context,
@@ -6196,7 +6196,7 @@ fn gen_union_type<'a>(node: &TsUnionType<'a>, context: &mut Context<'a>) -> Prin
6196
6196
gen_union_or_intersection_type (
6197
6197
UnionOrIntersectionType {
6198
6198
node : node. into ( ) ,
6199
- types : & node. types ,
6199
+ types : node. types ,
6200
6200
is_union : true ,
6201
6201
} ,
6202
6202
context,
@@ -6205,7 +6205,7 @@ fn gen_union_type<'a>(node: &TsUnionType<'a>, context: &mut Context<'a>) -> Prin
6205
6205
6206
6206
struct UnionOrIntersectionType < ' a , ' b > {
6207
6207
pub node : Node < ' a > ,
6208
- pub types : & ' b Vec < TsType < ' a > > ,
6208
+ pub types : & ' b [ TsType < ' a > ] ,
6209
6209
pub is_union : bool ,
6210
6210
}
6211
6211
0 commit comments