Skip to content

"left behind trailing whitespace" in long patterns #5559

Open
@RReverser

Description

@RReverser

Code like this:

fn put_telescope_synctocoordinates(
    PutTelescopeSynctocoordinatesPathParams {
                    
                        device_number,
                    
                }: PutTelescopeSynctocoordinatesPathParams,
) {
}

triggers "left behind trailing whitespace".

I suppose it's because rustfmt tries to put entire param - both pattern and type - on the same line, fails in doing so as that exceeds the max width, and gives up. Instead, it should probably fallback to something like

fn put_telescope_synctocoordinates(
    PutTelescopeSynctocoordinatesPathParams {
      device_number,
    }: PutTelescopeSynctocoordinatesPathParams,
) {
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions