File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -61,22 +61,24 @@ pub trait EnumGenerator {
61
61
}
62
62
63
63
fn macros ( & self , entity : & Enum , gen : & Generator ) -> Cow < ' static , str > {
64
+ let allows = "#[allow(non_camel_case_types)]\n " ;
65
+
64
66
if entity. source == EnumSource :: Union {
65
- return " #[derive(PartialEq, Debug, UtilsUnionSerDe)]\n " . into ( ) ;
67
+ return format ! ( "{allows} #[derive(PartialEq, Debug, UtilsUnionSerDe)]" ) . into ( ) ;
66
68
}
67
69
68
70
let derives = "#[derive(PartialEq, Debug, YaSerialize, YaDeserialize)]\n " ;
69
71
let tns = gen. target_ns . borrow ( ) ;
70
72
match tns. as_ref ( ) {
71
73
Some ( tn) => match tn. name ( ) {
72
74
Some ( name) => format ! (
73
- "{derives}#[yaserde(prefix = \" {prefix}\" , namespace = \" {prefix}: {uri}\" )]\n " ,
75
+ "{allows}{ derives}#[yaserde(prefix = \" {prefix}\" , namespace = \" {prefix}: {uri}\" )]\n " ,
74
76
derives = derives,
75
77
prefix = name,
76
78
uri = tn. uri( )
77
79
) ,
78
80
None => format ! (
79
- "{derives}#[yaserde(namespace = \" {uri}\" )]\n " ,
81
+ "{allows}{ derives}#[yaserde(namespace = \" {uri}\" )]\n " ,
80
82
derives = derives,
81
83
uri = tn. uri( )
82
84
) ,
You can’t perform that action at this time.
0 commit comments