@@ -19,7 +19,7 @@ pub(crate) struct Join {
1919}
2020
2121pub ( super ) enum NestedOrNot {
22- Nested ( Punctuated < Transformation , Token ! [ , ] > ) ,
22+ Nested ( Transformation ) ,
2323 Not ( NoTransformation ) ,
2424}
2525
@@ -76,17 +76,14 @@ impl ToTokens for Join {
7676impl NestedOrNot {
7777 fn map_type_values ( & self ) -> Vec < TokenStream > {
7878 match self {
79- Self :: Nested ( nested) => nested. iter ( ) . map ( Transformation :: map_type) . collect ( ) ,
79+ Self :: Nested ( nested) => vec ! [ nested. map_type( ) ] ,
8080 Self :: Not ( not) => not. map_type_values ( ) ,
8181 }
8282 }
8383
8484 fn accumulator ( & self , accumulator_index : usize ) -> TokenStream {
8585 match self {
86- Self :: Nested ( nested) => nested
87- . iter ( )
88- . flat_map ( |item| item. accumulator ( Some ( accumulator_index) ) )
89- . collect ( ) ,
86+ Self :: Nested ( nested) => nested. accumulator ( Some ( accumulator_index) ) ,
9087 Self :: Not ( not) => not. accumulator ( accumulator_index) ,
9188 }
9289 }
@@ -102,10 +99,7 @@ impl NestedOrNot {
10299
103100 fn presenter ( & self , accumulator : & TokenStream ) -> TokenStream {
104101 match self {
105- Self :: Nested ( nested) => nested
106- . iter ( )
107- . flat_map ( |item| item. presenter ( accumulator) )
108- . collect :: < TokenStream > ( ) ,
102+ Self :: Nested ( nested) => nested. presenter ( accumulator) ,
109103 Self :: Not ( not) => not. presenter ( accumulator) ,
110104 }
111105 }
0 commit comments