Make as Variant
optional for #[messages(...)]
attribtue
#168
Labels
enhancement
New feature or request
as Variant
optional for #[messages(...)]
attribtue
#168
The
as Variant
part of the#[messages(...)]
attribute is used only to generate variant names of glue enum, which does not matter in 99.9% of cases - I can only imagine it is relevant when we would have two modules with very similar names producing the same identifier when converted to CamelCase (or maybe the same name when we use path here). And I think that theas Variant
is not used by trait impl at all!We should make the whole
as Variant
part optional, and if it is missing, we want to build it by converting the module to the CamelCase variant (for path maybe even some name created by CamelCasing all path parts and then merging them with__
? I'm unsure if cargo/clippy would complain, but we can always silence this particular warning with#[allow]
I think).Additionally, I would add a warning if
as Variant
is used with the same identifier as it would be generated from the module name.The text was updated successfully, but these errors were encountered: