Skip to content

Commit b82c9ce

Browse files
committed
Add limitation description for enum_variant_names
`enum_variant_names` will consider characters with no case to be a part of prefixes/suffixes substring that are compared. This means `Foo1` and `Foo2` has different prefixes (`Foo1` and `Foo2` prefix respeectively). This applies to all non-ascii characters with no casing.
1 parent 6f7e5cb commit b82c9ce

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

clippy_lints/src/enum_variants.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ declare_clippy_lint! {
1818
/// Enumeration variant names should specify their variant,
1919
/// not repeat the enumeration name.
2020
///
21+
/// ### Limitations
22+
/// Characters with no casing will be considered when comparing prefixes/suffixes
23+
/// This applies to numbers and non-ascii characters without casing
24+
/// e.g. `Foo1` and `Foo2` is considered to have different prefixes
25+
/// (the prefixes are `Foo1` and `Foo2` respectively), as also `Bar螃`, `Bar蟹`
26+
///
2127
/// ### Example
2228
/// ```rust
2329
/// enum Cake {

0 commit comments

Comments
 (0)