Skip to content

Misalignment with or pattern arguments. #4885

Closed
@fbernier

Description

@fbernier

The following code:

fn is_meta_character(c: char) -> bool {
    matches!(
        c,
        '\\' | '.' | '+' | '(' | ')' | '|' | '[' | ']' | '{' | '}' | '^' |
        '$'  | '#' | '&' | '-' | '~' | '*' | '?'
    )
}

gets formatted into

fn is_meta_character(c: char) -> bool {
    matches!(
        c,
        '\\' | '.'
            | '+'
            | '('
            | ')'
            | '|'
            | '['
            | ']'
            | '{'
            | '}'
            | '^'
            | '$'
            | '#'
            | '&'
            | '-'
            | '~'
            | '*'
            | '?'
    )
}

I see two issues with this. First, horizontal bars are misaligned, and second it's a big waste of vertical space. I did not have time to gather more info as of now but will update this issue if I get back to it.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions