Skip to content

Remove extra unnecessary blocks #5616

Open
@jjant

Description

@jjant

Description

It should be safe to remove unnecessarily nested blocks when there's no statements in between: {{{ <stmts> }}} => { <stmts> }.

Example

Input:

fn f() {
    {{{{{ g() }}}}};
}

Expected output:

fn f() {
  g();
}

Actual output:

fn f() {
    {
        {
            {
                {
                    {
                        g()
                    }
                }
            }
        }
    };
}

Metadata

Metadata

Assignees

Labels

community drivenIssues the rustfmt team will not work on directly. Intended for contributors!feature-requestp-low

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions