Skip to content

Allow splitting multi-line use statements into separate single-line statements #4620

Open
@Aaron1011

Description

@Aaron1011

By default, rustfmt currently formats the following code

use std::{ReallyLongImportTypeNameOne, ReallyLongImportTypeNameTwo, ReallyLongImportTypeNameThree, ReallyLongImportTypeNameFour};

as

use std::{
    ReallyLongImportTypeNameFour, ReallyLongImportTypeNameOne, ReallyLongImportTypeNameThree,
    ReallyLongImportTypeNameTwo,
};

it would be nice to have an option to split these imports into multiple lines, with each line respecting the maximum line width:

use std::{ReallyLongImportTypeNameFour, ReallyLongImportTypeNameThree};
use std::{ReallyLongImportTypeNameOne, ReallyLongImportTypeNameTwo};

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