Skip to content

Feature request: alphabetic sorting of struct/enum fields #3422

Open
@PvdBerg1998

Description

@PvdBerg1998

Whenever the order of a struct or enum would be completely irrelevant, I like to keep them in alphabetic order. However, this gets slightly annoying to maintain when adding new fields. Therefore I propose an optional automatic sorting attribute, think #[rustfmt::sort].

My first idea was to create a clippy lint for this, but having this done automatically would be the best.

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