11use proc_macro2:: TokenStream ;
2- use quote:: quote;
32use std:: default:: Default ;
4- use syn:: { parse_quote, DeriveInput , Ident , LitStr , Path , Visibility } ;
3+ use syn:: { parse_quote, DeriveInput , Ident , LitStr , Meta , Path , Visibility } ;
54
65use super :: case_style:: CaseStyle ;
76use super :: metadata:: { DeriveInputExt , EnumDiscriminantsMeta , EnumMeta } ;
@@ -20,14 +19,13 @@ pub struct StrumTypeProperties {
2019 pub crate_module_path : Option < Path > ,
2120 pub discriminant_derives : Vec < Path > ,
2221 pub discriminant_name : Option < Ident > ,
23- pub discriminant_others : Vec < TokenStream > ,
22+ pub discriminant_others : Vec < Meta > ,
2423 pub discriminant_vis : Option < Visibility > ,
2524 pub use_phf : bool ,
2625 pub prefix : Option < LitStr > ,
2726 pub suffix : Option < LitStr > ,
2827 pub enum_repr : Option < TokenStream > ,
2928 pub const_into_str : bool ,
30- pub discriminant_docs : Vec < LitStr > ,
3129}
3230
3331impl HasTypeProperties for DeriveInput {
@@ -150,11 +148,8 @@ impl HasTypeProperties for DeriveInput {
150148 vis_kw = Some ( kw) ;
151149 output. discriminant_vis = Some ( vis) ;
152150 }
153- EnumDiscriminantsMeta :: Doc { doc, .. } => {
154- output. discriminant_docs . push ( doc) ;
155- }
156- EnumDiscriminantsMeta :: Other { path, nested } => {
157- output. discriminant_others . push ( quote ! { #path( #nested) } ) ;
151+ EnumDiscriminantsMeta :: Other { passthrough_meta } => {
152+ output. discriminant_others . push ( passthrough_meta) ;
158153 }
159154 }
160155 }
0 commit comments