-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Incorrect camel case warning #57319
Comments
Ah, good catch: it's been noted in the style guide that "upper camel case" is a better term, as it's not so ambiguous (the term "camel case" is variably used for
This should be very straightforward to fix — you're welcome to open a pull request fixing this! (If you search for the message, you should find the location to make the change.) |
@varkor Do we want to specify Pascal Case which always exclusively refers to upper camel case to be least ambiguous? Or do we want to stick to "upper camel case?" |
There was actually a whole discussion on this topic earlier this year and it was decided that "upper camel case" was clearer (though it seems no-one thought to change the compiler lints), so let's go with that. |
Great, will make a PR tonight, thanks. |
specify "upper camel case" in style lint Also, fix an issue where internal upper case letters were converted to lower case. Fixes rust-lang#57319.
Run the following program using Stable or Nightly:
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=a8e0392ac3ef8c62c5cc66fddabeb564
The compiler tells us:
This is incorrect/confusing in 3 ways:
1.) userData is in fact camelCase.
2.) UserData would be PascalCase and this is the convention I've seen
3.) Userdata is neither... So even if for some strange reason we're considering PascalCase as camel case, the recommendation is neither.
The text was updated successfully, but these errors were encountered: