Skip to content
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

Rogue commas after match blocks in ch 18-03 #2008

Closed
ShevekUK opened this issue Jul 1, 2019 · 2 comments
Closed

Rogue commas after match blocks in ch 18-03 #2008

ShevekUK opened this issue Jul 1, 2019 · 2 comments

Comments

@ShevekUK
Copy link

ShevekUK commented Jul 1, 2019

Listings 18-15 and 18-16 have inconsistent use of commas after brace-delimited match arms.

In 18-15, the first arm is a block and ends with a comma. The second and fourth arms are also blocks, and end without commas.

Similarly in listing 18-16 the first and second match arms are brace-delimited, but only the first ends with a comma.

I've checked and rustfmt does strip these commas.

As a Rust learner, there are two things I'd point out here:

  • the inconsistency is confusing for learners, who will wonder what the rules are for commas here
  • shouldn't all listings go through rustfmt?

Anyway I'm just a learner but was encouraged to mention this here.

@carols10cents
Copy link
Member

Yes, we are currently working on the infrastructure to apply rustfmt to all examples; that's #1690. Closing this as a duplicate of that! Thank you!

@ShevekUK
Copy link
Author

ShevekUK commented Jul 1, 2019

Thanks for not dismissing this out of hand, and keep up the good work 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants