Skip to content

Commit

Permalink
fix: avoid conflicts in case of consecutive underscores
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Dec 25, 2023
1 parent ffe8873 commit 145ea7b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions strum_macros/src/macros/from_repr.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use heck::ToShoutySnakeCase;
use proc_macro2::{Span, TokenStream};
use quote::{format_ident, quote};
use syn::{Data, DeriveInput, Fields, Type};
Expand Down Expand Up @@ -73,7 +72,7 @@ pub fn from_repr_inner(ast: &DeriveInput) -> syn::Result<TokenStream> {
}
};

let const_var_str = format!("{}_DISCRIMINANT", variant.ident).to_shouty_snake_case();
let const_var_str = format!("{}_DISCRIMINANT", variant.ident);
let const_var_ident = format_ident!("{}", const_var_str);

let const_val_expr = match &variant.discriminant {
Expand Down

0 comments on commit 145ea7b

Please sign in to comment.