Skip to content

Remove semicolon after break/continue/return by default? #993

Closed
@alexcrichton

Description

@alexcrichton

Right now it looks like rustfmt always inserts a semicolon after break, return, and continue expressions. Given that it is semantically invalid to include code after these expressions, why not make it syntactically invalid as well? That is, the only typical need for inserting a semicolon is to change some type to () or to allow writing another statement, but in the case of these expressions there's no need to do either (and you save a character to boot).

Maybe this is better waiting for the RFC process, though?

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