Skip to content

Commit 4418ff1

Browse files
committed
unneeded-field-pattern: make lint adhere to lint message convention
1 parent 2792260 commit 4418ff1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

clippy_lints/src/misc_early.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,9 +298,9 @@ impl EarlyLintPass for MiscEarlyLints {
298298
cx,
299299
UNNEEDED_FIELD_PATTERN,
300300
pat.span,
301-
"All the struct fields are matched to a wildcard pattern, consider using `..`.",
301+
"all the struct fields are matched to a wildcard pattern, consider using `..`",
302302
None,
303-
&format!("Try with `{} {{ .. }}` instead", type_name),
303+
&format!("try with `{} {{ .. }}` instead", type_name),
304304
);
305305
return;
306306
}
@@ -313,7 +313,7 @@ impl EarlyLintPass for MiscEarlyLints {
313313
cx,
314314
UNNEEDED_FIELD_PATTERN,
315315
field.span,
316-
"You matched a field with a wildcard pattern. Consider using `..` instead",
316+
"you matched a field with a wildcard pattern, consider using `..` instead",
317317
);
318318
} else {
319319
let mut normal = vec![];
@@ -333,10 +333,10 @@ impl EarlyLintPass for MiscEarlyLints {
333333
cx,
334334
UNNEEDED_FIELD_PATTERN,
335335
field.span,
336-
"You matched a field with a wildcard pattern. Consider using `..` \
336+
"you matched a field with a wildcard pattern, consider using `..` \
337337
instead",
338338
None,
339-
&format!("Try with `{} {{ {}, .. }}`", type_name, normal[..].join(", ")),
339+
&format!("try with `{} {{ {}, .. }}`", type_name, normal[..].join(", ")),
340340
);
341341
}
342342
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
error: You matched a field with a wildcard pattern. Consider using `..` instead
1+
error: you matched a field with a wildcard pattern, consider using `..` instead
22
--> $DIR/unneeded_field_pattern.rs:14:15
33
|
44
LL | Foo { a: _, b: 0, .. } => {},
55
| ^^^^
66
|
77
= note: `-D clippy::unneeded-field-pattern` implied by `-D warnings`
8-
= help: Try with `Foo { b: 0, .. }`
8+
= help: try with `Foo { b: 0, .. }`
99

10-
error: All the struct fields are matched to a wildcard pattern, consider using `..`.
10+
error: all the struct fields are matched to a wildcard pattern, consider using `..`
1111
--> $DIR/unneeded_field_pattern.rs:16:9
1212
|
1313
LL | Foo { a: _, b: _, c: _ } => {},
1414
| ^^^^^^^^^^^^^^^^^^^^^^^^
1515
|
16-
= help: Try with `Foo { .. }` instead
16+
= help: try with `Foo { .. }` instead
1717

1818
error: aborting due to 2 previous errors
1919

0 commit comments

Comments
 (0)