Skip to content

Leave whitespace for logically grouped comments alone #1283

Open
@ppannuto

Description

@ppannuto

Is seems that rustfmt is identifies an ending | (or perhaps simply not ;) as a continued block and doesn't mess with the whitespace, but it will change the formatting of the last entry:

Before

fn reduced_example(scaler: usize) {
    let control = (1 << 16) |     // Clock enable
                  (scaler << 8) | // Set PSEL to based on period
                  (1 << 7)  |     // Flash calibration done (set to default)
                  (1 << 1)  |     // Disable after reset
                  (1 << 0);       // Enable
}

After

fn reduced_example(scaler: usize) {
    let control = (1 << 16) |     // Clock enable
                  (scaler << 8) | // Set PSEL to based on period
                  (1 << 7)  |     // Flash calibration done (set to default)
                  (1 << 1)  |     // Disable after reset
                  (1 << 0); // Enable
}

I believe this is a similar but distinct case from #1275

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions