Skip to content

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

Description

@ShevekUK

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions