diff options
| author | dswij <dswijj@gmail.com> | 2021-12-24 12:32:12 +0800 |
|---|---|---|
| committer | Dharma Saputra Wijaya <dswijj@gmail.com> | 2021-12-25 21:55:20 +0800 |
| commit | b82c9ce3af0bd338ef3e532eae8a9f87d6981bf0 (patch) | |
| tree | 9b6ed5d4b0049becca54cc0db6f472230e754f82 | |
| parent | 6f7e5cbe21d99b7867d8d7383fd2ab753da1d256 (diff) | |
| download | rust-b82c9ce3af0bd338ef3e532eae8a9f87d6981bf0.tar.gz rust-b82c9ce3af0bd338ef3e532eae8a9f87d6981bf0.zip | |
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.
| -rw-r--r-- | clippy_lints/src/enum_variants.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clippy_lints/src/enum_variants.rs b/clippy_lints/src/enum_variants.rs index b13fd25c6e1..6e1fa836b8f 100644 --- a/clippy_lints/src/enum_variants.rs +++ b/clippy_lints/src/enum_variants.rs @@ -18,6 +18,12 @@ declare_clippy_lint! { /// Enumeration variant names should specify their variant, /// not repeat the enumeration name. /// + /// ### Limitations + /// Characters with no casing will be considered when comparing prefixes/suffixes + /// This applies to numbers and non-ascii characters without casing + /// e.g. `Foo1` and `Foo2` is considered to have different prefixes + /// (the prefixes are `Foo1` and `Foo2` respectively), as also `Bar螃`, `Bar蟹` + /// /// ### Example /// ```rust /// enum Cake { |
