@@ -6,12 +6,18 @@ use std::collections::BTreeMap as Map;
66use crate :: empty;
77use crate :: prim_str:: PrimStr ;
88
9- #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
109#[ cfg_attr(
11- feature = "serde" ,
10+ any( feature = "serde" , feature = "lib-simd-json" ) ,
11+ derive( Serialize , Deserialize )
12+ ) ]
13+ #[ cfg_attr(
14+ any( feature = "serde" , feature = "lib-simd-json" ) ,
1215 serde( deny_unknown_fields, rename_all = "camelCase" )
1316) ]
14- #[ cfg_attr( feature = "lib-simd-json" , derive( simd_json_derive:: Serialize ) ) ]
17+ #[ cfg_attr(
18+ feature = "lib-simd-json" ,
19+ derive( simd_json_derive:: Serialize , simd_json_derive:: Deserialize )
20+ ) ]
1521pub struct CitmCatalog {
1622 pub area_names : Map < IdStr , String > ,
1723 pub audience_sub_category_names : Map < IdStr , String > ,
@@ -29,12 +35,18 @@ pub struct CitmCatalog {
2935pub type Id = u32 ;
3036pub type IdStr = PrimStr < u32 > ;
3137
32- #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
3338#[ cfg_attr(
34- feature = "serde" ,
39+ any( feature = "serde" , feature = "lib-simd-json" ) ,
40+ derive( Serialize , Deserialize )
41+ ) ]
42+ #[ cfg_attr(
43+ any( feature = "serde" , feature = "lib-simd-json" ) ,
3544 serde( deny_unknown_fields, rename_all = "camelCase" )
3645) ]
37- #[ cfg_attr( feature = "lib-simd-json" , derive( simd_json_derive:: Serialize ) ) ]
46+ #[ cfg_attr(
47+ feature = "lib-simd-json" ,
48+ derive( simd_json_derive:: Serialize , simd_json_derive:: Deserialize )
49+ ) ]
3850pub struct Event {
3951 pub description : ( ) ,
4052 pub id : Id ,
@@ -46,12 +58,18 @@ pub struct Event {
4658 pub topic_ids : Vec < Id > ,
4759}
4860
49- #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5061#[ cfg_attr(
51- feature = "serde" ,
62+ any( feature = "serde" , feature = "lib-simd-json" ) ,
63+ derive( Serialize , Deserialize )
64+ ) ]
65+ #[ cfg_attr(
66+ any( feature = "serde" , feature = "lib-simd-json" ) ,
5267 serde( deny_unknown_fields, rename_all = "camelCase" )
5368) ]
54- #[ cfg_attr( feature = "lib-simd-json" , derive( simd_json_derive:: Serialize ) ) ]
69+ #[ cfg_attr(
70+ feature = "lib-simd-json" ,
71+ derive( simd_json_derive:: Serialize , simd_json_derive:: Deserialize )
72+ ) ]
5573pub struct Performance {
5674 pub event_id : Id ,
5775 pub id : Id ,
@@ -64,35 +82,53 @@ pub struct Performance {
6482 pub venue_code : String ,
6583}
6684
67- #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
6885#[ cfg_attr(
69- feature = "serde" ,
86+ any( feature = "serde" , feature = "lib-simd-json" ) ,
87+ derive( Serialize , Deserialize )
88+ ) ]
89+ #[ cfg_attr(
90+ any( feature = "serde" , feature = "lib-simd-json" ) ,
7091 serde( deny_unknown_fields, rename_all = "camelCase" )
7192) ]
72- #[ cfg_attr( feature = "lib-simd-json" , derive( simd_json_derive:: Serialize ) ) ]
93+ #[ cfg_attr(
94+ feature = "lib-simd-json" ,
95+ derive( simd_json_derive:: Serialize , simd_json_derive:: Deserialize )
96+ ) ]
7397pub struct Price {
7498 pub amount : u32 ,
7599 pub audience_sub_category_id : Id ,
76100 pub seat_category_id : Id ,
77101}
78102
79- #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
80103#[ cfg_attr(
81- feature = "serde" ,
104+ any( feature = "serde" , feature = "lib-simd-json" ) ,
105+ derive( Serialize , Deserialize )
106+ ) ]
107+ #[ cfg_attr(
108+ any( feature = "serde" , feature = "lib-simd-json" ) ,
82109 serde( deny_unknown_fields, rename_all = "camelCase" )
83110) ]
84- #[ cfg_attr( feature = "lib-simd-json" , derive( simd_json_derive:: Serialize ) ) ]
111+ #[ cfg_attr(
112+ feature = "lib-simd-json" ,
113+ derive( simd_json_derive:: Serialize , simd_json_derive:: Deserialize )
114+ ) ]
85115pub struct SeatCategory {
86116 pub areas : Vec < Area > ,
87117 pub seat_category_id : Id ,
88118}
89119
90- #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
91120#[ cfg_attr(
92- feature = "serde" ,
121+ any( feature = "serde" , feature = "lib-simd-json" ) ,
122+ derive( Serialize , Deserialize )
123+ ) ]
124+ #[ cfg_attr(
125+ any( feature = "serde" , feature = "lib-simd-json" ) ,
93126 serde( deny_unknown_fields, rename_all = "camelCase" )
94127) ]
95- #[ cfg_attr( feature = "lib-simd-json" , derive( simd_json_derive:: Serialize ) ) ]
128+ #[ cfg_attr(
129+ feature = "lib-simd-json" ,
130+ derive( simd_json_derive:: Serialize , simd_json_derive:: Deserialize )
131+ ) ]
96132pub struct Area {
97133 pub area_id : Id ,
98134 pub block_ids : empty:: Array ,
0 commit comments