Skip to content

Normalize semicolon inside/outside blocks for () returning expressions #7322

Closed
@ojeda

Description

@ojeda

What it does

For () returning expressions, check that the semicolon is inside/outside the block.

Either way it is fine, but consistency is best. Having the semicolon inside may be slightly nicer and more similar to, say, conditionals and loop bodies.

Categories (optional)

  • Kind: clippy::style

Drawbacks

It is subjective, so perhaps we should offer both ways, one enabled by default.

Example

unsafe { f(x) };

Could be written as:

unsafe { f(x); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsL-pedanticLint: Belongs in the pedantic lint groupgood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions