Skip to content

rustfmt should use natural sorting #4381

Closed

Description

@jgarvin

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};

Activity

  1. calebcartwright commented on Aug 12, 2020

    @calebcartwright
    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.

  2. added
    C-feature-requestCategory: a feature request (not decided/implemented)
    and removed
    E-fixed-needs-confirmationCall for participation: expected to have been fixed, needs confirmation
    on Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions