-
Notifications
You must be signed in to change notification settings - Fork 1k
Certain match expressions are unnecessarily indented and placed on next line #6865
Copy link
Copy link
Closed as duplicate of#3626
Closed as duplicate of#3626
Copy link
Labels
A-call-chainsArea: method call chainsArea: method call chainsA-expressionsArea: expressionsArea: expressionsA-matchesArea: match arms, patterns, blocks, etcArea: match arms, patterns, blocks, etcC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICES-has-mcveStatus: a Minimal Complete and Verifiable Example has been found for this issueStatus: a Minimal Complete and Verifiable Example has been found for this issue
Metadata
Metadata
Assignees
Labels
A-call-chainsArea: method call chainsArea: method call chainsA-expressionsArea: expressionsArea: expressionsA-matchesArea: match arms, patterns, blocks, etcArea: match arms, patterns, blocks, etcC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICES-has-mcveStatus: a Minimal Complete and Verifiable Example has been found for this issueStatus: a Minimal Complete and Verifiable Example has been found for this issue
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
I tried to format this code:
Expected behavior
I expected the code to stay the same, because none of the lines exceed the length limit of 100.
Actual behavior
Instead, Rustfmt formats the code like this:
The only difference compared to the input is that the match expression has been indented and placed on the next line. I think this is clearly worse than the input.
Configuration
Default configuration (blank rustfmt.toml).
Reproduction Steps
Run
rustfmton the sample code with default options.Meta
rustfmt --version: