mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
enum-variant-names: make lint adhere to lint message convention
This commit is contained in:
parent
db390f5e6a
commit
89591a78b8
2 changed files with 6 additions and 6 deletions
|
@ -183,10 +183,10 @@ fn check_variant(
|
|||
&& name.chars().nth(item_name_chars).map_or(false, |c| !c.is_lowercase())
|
||||
&& name.chars().nth(item_name_chars + 1).map_or(false, |c| !c.is_numeric())
|
||||
{
|
||||
span_lint(cx, lint, var.span, "Variant name starts with the enum's name");
|
||||
span_lint(cx, lint, var.span, "variant name starts with the enum's name");
|
||||
}
|
||||
if partial_rmatch(item_name, &name) == item_name_chars {
|
||||
span_lint(cx, lint, var.span, "Variant name ends with the enum's name");
|
||||
span_lint(cx, lint, var.span, "variant name ends with the enum's name");
|
||||
}
|
||||
}
|
||||
let first = &def.variants[0].ident.name.as_str();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
error: Variant name ends with the enum's name
|
||||
error: variant name ends with the enum's name
|
||||
--> $DIR/enum_variants.rs:16:5
|
||||
|
|
||||
LL | cFoo,
|
||||
|
@ -6,19 +6,19 @@ LL | cFoo,
|
|||
|
|
||||
= note: `-D clippy::enum-variant-names` implied by `-D warnings`
|
||||
|
||||
error: Variant name starts with the enum's name
|
||||
error: variant name starts with the enum's name
|
||||
--> $DIR/enum_variants.rs:27:5
|
||||
|
|
||||
LL | FoodGood,
|
||||
| ^^^^^^^^
|
||||
|
||||
error: Variant name starts with the enum's name
|
||||
error: variant name starts with the enum's name
|
||||
--> $DIR/enum_variants.rs:28:5
|
||||
|
|
||||
LL | FoodMiddle,
|
||||
| ^^^^^^^^^^
|
||||
|
||||
error: Variant name starts with the enum's name
|
||||
error: variant name starts with the enum's name
|
||||
--> $DIR/enum_variants.rs:29:5
|
||||
|
|
||||
LL | FoodBad,
|
||||
|
|
Loading…
Reference in a new issue