
9

Fix `enum_variants` FP on prefixes that are not camel-case by dswij · Pull Reque...
source link: https://github.com/rust-lang/rust-clippy/pull/8127
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

closes #8090
Fix FP on enum_variants
when prefixes are only a substring of a camel-case word. Also adds some util helpers on str_utils
to help parsing camel-case strings.
This changes how the lint behaves:
- previously if the Prefix is only a length of 1, it's going to get ignored, i.e. these were previously ignored and now is warned
enum Foo { cFoo, cBar, cBaz, } enum Something { CCall, CCreate, CCryogenize, }
- non-ascii characters that doesn't have casing will not be split,
enum NonCaps { PrefixXXX, PrefixTea, PrefixCake, }
will be considered as PrefixXXX
, Prefix
, Prefix
, so this won't lint as opposed to fired previously.
changelog: [enum_variant_names
] Fix FP when first prefix are only a substring of a camel-case word.
(Edited by @xFrednet removed some non ascii characters)
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK