Skip to content

Incorrect whitespace when match_arm_blocks set to false #4003

Open
@Cy-Tek

Description

@Cy-Tek

When the config option for match_arm_blocks is set to false, the formatter adds additional whitespace which causes errors saying: 'error[internal]: left behind trailing whitespace'

For example:

match pos_iter.peek()
    {
        Some(pos) if pos.0 != 0 =>
            add_paragraphs_to_map(&doc[0..pos.0], 0, current_level, &mut paragraphs),
        None => add_paragraphs_to_map(doc, 0, current_level, &mut paragraphs),
        _ => (),
    }

// becomes

match pos_iter.peek()
    {
        Some(pos) if pos.0 != 0 =>
        
            add_paragraphs_to_map(&doc[0..pos.0], 0, current_level, &mut paragraphs),
        None => add_paragraphs_to_map(doc, 0, current_level, &mut paragraphs),
        _ => (),
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPanic, non-idempotency, invalid code, etc.e-trailing whitespaceerror[internal]: left behind trailing whitespaceonly-with-optionrequires a non-default option value to reproduce

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions