Skip to content

enum_variant_names

Default: Disabled

Source Code

What it does

Detects enumeration variants that are prefixed or suffixed by the same characters.

Example

cairo
enum Cake {
    BlackForestCake,
    HummingbirdCake,
    BattenbergCake,
}

Can be simplified to:

cairo
enum Cake {
    BlackForest,
    Hummingbird,
    Battenberg,
}