Make variant name for derived enums upper case by default

This commit is contained in:
theduke 2017-07-05 08:24:50 +02:00
parent 8a27cb3cb5
commit c27d2c7a23

View file

@ -99,7 +99,7 @@ pub fn impl_enum(ast: &syn::DeriveInput) -> Tokens {
let var_ident = &variant.ident; let var_ident = &variant.ident;
// Build value. // Build value.
let name = var_attrs.name.unwrap_or(variant.ident.to_string()); let name = var_attrs.name.unwrap_or(variant.ident.as_ref().to_uppercase());
let descr = match var_attrs.description { let descr = match var_attrs.description {
Some(s) => quote!{ Some(#s.to_string()) }, Some(s) => quote!{ Some(#s.to_string()) },
None => quote!{ None }, None => quote!{ None },