1- use std:: collections:: HashMap ;
1+ #[ cfg( test) ]
2+ use std:: fmt:: { self , Debug , Formatter } ;
23
34use proc_macro2:: TokenStream as TokenStream2 ;
45use quote:: { ToTokens , quote} ;
@@ -12,15 +13,14 @@ use input::{EnumVariantFormatInput, StructFormatInput};
1213
1314use crate :: util:: traits:: IteratorExt ;
1415
15- #[ derive( Debug ) ]
1616pub ( crate ) enum FormatData {
1717 Struct {
1818 display_input : StructFormatInput ,
1919 } ,
2020
2121 Enum {
2222 default_display_input : Option < LitStr > ,
23- variant_display_inputs : HashMap < Variant , EnumVariantFormatInput > ,
23+ variant_display_inputs : Vec < ( Variant , EnumVariantFormatInput ) > ,
2424 } ,
2525
2626 EmptyEnum ,
@@ -59,7 +59,7 @@ impl FormatData {
5959 Self :: get_format_input ( attr)
6060 . map ( |input| ( variant. clone ( ) , input) )
6161 } )
62- . collect_hashmap_and_combine_syn_errors ( ) ;
62+ . collect_vec_and_combine_syn_errors ( ) ;
6363
6464 if let Some ( attr) = default_display_attr {
6565 let default_display_input =
@@ -143,6 +143,13 @@ impl FormatData {
143143 }
144144}
145145
146+ #[ cfg( test) ]
147+ impl Debug for FormatData {
148+ fn fmt ( & self , _: & mut Formatter < ' _ > ) -> fmt:: Result {
149+ Ok ( ( ) )
150+ }
151+ }
152+
146153impl ToTokens for FormatData {
147154 fn to_tokens ( & self , tokens : & mut TokenStream2 ) {
148155 match self {
0 commit comments