Skip to content

Spaces before colons in macro_rules? #2534

Closed
@ghost

Description

Before formatting:

macro_rules! foo {
    ($a:ident : $b:ty) => {};
    ($a:ident $b:ident $c:ident) => {};
}

After formatting:

macro_rules! foo {
    ($a: ident: $b: ty) => {};
    ($a: ident $b: ident $c: ident) => {};
}

This formatting makes the macro patterns difficult to read.

I understand why rustfmt adds a space after every :, and it makes a lot of sense when arguments are separated by commas or semicolons. But if arguments are separated by spaces or other kinds of delimiters, the end result is not great. :(

cc @RReverser

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