Skip to content

Extra indentation in macro_rules! #4152

Closed
@UltraMachine

Description

@UltraMachine

rustfmt 1.4.12-stable (a828ffe 2020-03-11)

For example, this:

macro_rules! bit {
    ($bool:expr) => {
        if $bool {
            1
        } else {
            0
        }
    };
}
macro_rules! add_one {
    ($vec:expr) => {
        {
            $vec.push(1);
        }
    };
}

Formatted into:

macro_rules! bit {
    ($bool:expr) => {
        if $bool {
                1
        } else {
                0
            }
    };
}
macro_rules! add_one {
    ($vec:expr) => {{
        $vec.push(1);
        }};
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-macrosonly-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