Skip to content

max_width is off by one for use statements #6727

@lmmx

Description

@lmmx

I was surprised to notice that rustfmt is off by one when it comes to handling use item identifiers, from what I can see.

It is not explicitly stated in the Configurations.md file but the max_width (default: 100) is expected to behave as <= but in practice it operates as <. Lines with use identifier lists of length 100 are wrapped, those at 99 are not.

I note there are other issues in a similar vein like #6180, but this doesn't seem to have been reported.

Image

I used wc -L here to show the max line length.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageThis issue or PR needs triaging to determine its status. Remove label once sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions