From c27d2c7a23f7cc07d753cc19010725391ef0923d Mon Sep 17 00:00:00 2001 From: theduke Date: Wed, 5 Jul 2017 08:24:50 +0200 Subject: [PATCH] Make variant name for derived enums upper case by default --- juniper_codegen/src/enums.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/juniper_codegen/src/enums.rs b/juniper_codegen/src/enums.rs index d08396c4..2e254858 100644 --- a/juniper_codegen/src/enums.rs +++ b/juniper_codegen/src/enums.rs @@ -99,7 +99,7 @@ pub fn impl_enum(ast: &syn::DeriveInput) -> Tokens { let var_ident = &variant.ident; // 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 { Some(s) => quote!{ Some(#s.to_string()) }, None => quote!{ None },