-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Removed superfluous comma #28376
Removed superfluous comma #28376
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
It's correct, in fact. You can have trailing commas on the last item in structs and enums. This can be helpful when adding new items -- you only have you add one line, not edit one, too. This makes diffs nicer. |
yes, and this is in fact considered good style. Rust will accept either. Thank you for sending a PR though! |
Interesting. This is something that Rubocop complains about for Ruby code. I can agree that it makes diffs nicer, but it makes the code uglier. 😉 Is there some tool similar to Rubocop for Rust btw? I mean, some form of basic linter/"best practices" checkup tool? And also, what are the agreed "best practices" for Rust? Is there something like Ruby style guide for Rust? |
There is this work-in-progress style guide: I'm not sure there is a linter for style based issues yet. Some part are Per Lundberg notifications@github.com schrieb am Mo., 14. Sep. 2015 um
|
And for those wondering where rustfmt is, here be the link. |
This must be a mistake, no?