lint enum variants names that start or end with their enum's name
This commit is contained in:
parent
5726216c9b
commit
32894d503e
2 changed files with 26 additions and 2 deletions
|
|
@ -11,7 +11,8 @@ enum FakeCallType2 {
|
|||
}
|
||||
|
||||
enum Foo {
|
||||
cFoo, cBar,
|
||||
cFoo, //~ ERROR: Variant name ends with the enum's name
|
||||
cBar,
|
||||
}
|
||||
|
||||
enum BadCallType { //~ ERROR: All variants have the same prefix: `CallType`
|
||||
|
|
@ -68,4 +69,12 @@ enum NonCaps { //~ ERROR: All variants have the same prefix: `Prefix`
|
|||
PrefixCake,
|
||||
}
|
||||
|
||||
enum Stuff {
|
||||
BadStuff, //~ ERROR: Variant name ends with the enum's name
|
||||
}
|
||||
|
||||
enum Food {
|
||||
FoodGood, //~ ERROR: Variant name starts with the enum's name
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue