Skip to content
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

rustfmt should use natural sorting #4381

Closed
jgarvin opened this issue Aug 12, 2020 · 1 comment
Closed

rustfmt should use natural sorting #4381

jgarvin opened this issue Aug 12, 2020 · 1 comment

Comments

@jgarvin
Copy link

jgarvin commented Aug 12, 2020

Current behavior is to sort imports lexicographically:

use std::num::{NonZeroU16, NonZeroU8, NonZeroU32, NonZeroU64};

Natural sorting would be slightly nicer:

use std::num::{NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64};

@calebcartwright
Copy link
Member

Not exactly a dup, though this has already been implemented within source (refs #3764). It's considered a breaking change and hasn't been released, but available in the rustfmt 2.0 beta if you build from source. Going to go ahead and close.

Side note, you may want to bump rust-lang/style-team#143 in the Style Guide to try to get that codified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants