You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When forgetting to use the # specifier in the case below, the variable variant_name_str would always match to the 1st variant of the enum even though the string was directing to the 2nd variant (and variant_name_str was only defined in the scope of the proc macro fn, nowhere else). Strangely, the print statement seemed to work correctly, printing out the string variable of the passed in variant:
Strange Behavior When Lacking the Specifier # in
quote! {...}
quote = "1.0.37"
proc-macro2 = "1.0.86"
I am decoding structs in enum variants based off the variant name as a lowercase string, these are the types I am dealing with:
When forgetting to use the
#
specifier in the case below, the variablevariant_name_str
would always match to the 1st variant of the enum even though the string was directing to the 2nd variant (andvariant_name_str
was only defined in the scope of the proc macro fn, nowhere else). Strangely, the print statement seemed to work correctly, printing out the string variable of the passed in variant:giving:

when adding the
#
specifier, however, the matching worked as expected:giving:

Full Code:
The text was updated successfully, but these errors were encountered: