Skip to content

Single-line imports are unnecessarily wrapped #5927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
taylordotfish opened this issue Sep 28, 2023 · 0 comments
Open

Single-line imports are unnecessarily wrapped #5927

taylordotfish opened this issue Sep 28, 2023 · 0 comments
Labels
a-imports `use` syntax

Comments

@taylordotfish
Copy link

Imports that could fit on a single line are unnecessarily wrapped:

/* 50 characters:
0        1         2         3         4         5
12345678901234567890123456789012345678901234567890
*/
use aaaaaaaaa::{bbbbbbbbb, ccccccccc, ddddddddd};

After rustfmt --config max_width=50:

/* 50 characters:
0        1         2         3         4         5
12345678901234567890123456789012345678901234567890
*/
use aaaaaaaaa::{
    bbbbbbbbb, ccccccccc, ddddddddd,
};

The use declaration is only 49 characters but gets wrapped anyway. This also happens with the default max_width of 100 (use declarations > 98 characters get wrapped).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-imports `use` syntax
Projects
None yet
Development

No branches or pull requests

2 participants