-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enum_variant_names lint gives invalid suggestions #739
Comments
Oh, that's a good point. @oli-obk want to fix this? (or I can, pretty simple) |
Well. The hint should be changed, but i still consider the names to be bad. Should rather be the name of the layer instead of the number |
Yeah, in this case the names could be improved (but in the general case, that's not always true) |
(For the record, I plan to completely remove the version of that struct I'm actually using, the poor names are the least of the problems with it...) I agree about the general case, which is the main reason I reported it. |
This is fixed. |
Naming the first one just |
It looks like this only happens when it's a private enum. Once it's made |
That would be because the |
As [per the reference](https://doc.rust-lang.org/reference/identifiers.html), identifiers must start with a letter. So we don't suggest a better variant naming in these cases. Fixes rust-lang#739
Don't emit enum_variant_names if remainder starts with a numeric changelog: Fix false positive in `pub_enum_variant_names` and `enum_variant_names` As [per the reference](https://doc.rust-lang.org/reference/identifiers.html), identifiers must start with a letter. So we don't suggest a better variant naming in case the remainder would start with a numeric. Fixes #739
Don't emit enum_variant_names if remainder starts with a numeric changelog: Fix false positive in `pub_enum_variant_names` and `enum_variant_names` As [per the reference](https://doc.rust-lang.org/reference/identifiers.html), identifiers must start with a letter. So we don't suggest a better variant naming in case the remainder would start with a numeric. Fixes #739
Given:
Clippy gives the following warning/help:
Here, removing the prefix would lead to invalid identifiers.
The text was updated successfully, but these errors were encountered: