Skip to content

Commit 89591a7

Browse files
committed
enum-variant-names: make lint adhere to lint message convention
1 parent db390f5 commit 89591a7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

clippy_lints/src/enum_variants.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ fn check_variant(
183183
&& name.chars().nth(item_name_chars).map_or(false, |c| !c.is_lowercase())
184184
&& name.chars().nth(item_name_chars + 1).map_or(false, |c| !c.is_numeric())
185185
{
186-
span_lint(cx, lint, var.span, "Variant name starts with the enum's name");
186+
span_lint(cx, lint, var.span, "variant name starts with the enum's name");
187187
}
188188
if partial_rmatch(item_name, &name) == item_name_chars {
189-
span_lint(cx, lint, var.span, "Variant name ends with the enum's name");
189+
span_lint(cx, lint, var.span, "variant name ends with the enum's name");
190190
}
191191
}
192192
let first = &def.variants[0].ident.name.as_str();

tests/ui/enum_variants.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
error: Variant name ends with the enum's name
1+
error: variant name ends with the enum's name
22
--> $DIR/enum_variants.rs:16:5
33
|
44
LL | cFoo,
55
| ^^^^
66
|
77
= note: `-D clippy::enum-variant-names` implied by `-D warnings`
88

9-
error: Variant name starts with the enum's name
9+
error: variant name starts with the enum's name
1010
--> $DIR/enum_variants.rs:27:5
1111
|
1212
LL | FoodGood,
1313
| ^^^^^^^^
1414

15-
error: Variant name starts with the enum's name
15+
error: variant name starts with the enum's name
1616
--> $DIR/enum_variants.rs:28:5
1717
|
1818
LL | FoodMiddle,
1919
| ^^^^^^^^^^
2020

21-
error: Variant name starts with the enum's name
21+
error: variant name starts with the enum's name
2222
--> $DIR/enum_variants.rs:29:5
2323
|
2424
LL | FoodBad,

0 commit comments

Comments
 (0)