Skip to content

Commit 6b0a6a7

Browse files
committed
default-trait-access: make lint adhere to lint message convention
1 parent 3d592b5 commit 6b0a6a7

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

clippy_lints/src/default_trait_access.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl<'tcx> LateLintPass<'tcx> for DefaultTraitAccess {
6161
cx,
6262
DEFAULT_TRAIT_ACCESS,
6363
expr.span,
64-
&format!("Calling `{}` is more clear than this expression", replacement),
64+
&format!("calling `{}` is more clear than this expression", replacement),
6565
"try",
6666
replacement,
6767
Applicability::Unspecified, // First resolve the TODO above

tests/ui/default_trait_access.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
error: Calling `std::string::String::default()` is more clear than this expression
1+
error: calling `std::string::String::default()` is more clear than this expression
22
--> $DIR/default_trait_access.rs:8:22
33
|
44
LL | let s1: String = Default::default();
55
| ^^^^^^^^^^^^^^^^^^ help: try: `std::string::String::default()`
66
|
77
= note: `-D clippy::default-trait-access` implied by `-D warnings`
88

9-
error: Calling `std::string::String::default()` is more clear than this expression
9+
error: calling `std::string::String::default()` is more clear than this expression
1010
--> $DIR/default_trait_access.rs:12:22
1111
|
1212
LL | let s3: String = D2::default();
1313
| ^^^^^^^^^^^^^ help: try: `std::string::String::default()`
1414

15-
error: Calling `std::string::String::default()` is more clear than this expression
15+
error: calling `std::string::String::default()` is more clear than this expression
1616
--> $DIR/default_trait_access.rs:14:22
1717
|
1818
LL | let s4: String = std::default::Default::default();
1919
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::string::String::default()`
2020

21-
error: Calling `std::string::String::default()` is more clear than this expression
21+
error: calling `std::string::String::default()` is more clear than this expression
2222
--> $DIR/default_trait_access.rs:18:22
2323
|
2424
LL | let s6: String = default::Default::default();
2525
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::string::String::default()`
2626

27-
error: Calling `GenericDerivedDefault<std::string::String>::default()` is more clear than this expression
27+
error: calling `GenericDerivedDefault<std::string::String>::default()` is more clear than this expression
2828
--> $DIR/default_trait_access.rs:28:46
2929
|
3030
LL | let s11: GenericDerivedDefault<String> = Default::default();
3131
| ^^^^^^^^^^^^^^^^^^ help: try: `GenericDerivedDefault<std::string::String>::default()`
3232

33-
error: Calling `TupleDerivedDefault::default()` is more clear than this expression
33+
error: calling `TupleDerivedDefault::default()` is more clear than this expression
3434
--> $DIR/default_trait_access.rs:34:36
3535
|
3636
LL | let s14: TupleDerivedDefault = Default::default();
3737
| ^^^^^^^^^^^^^^^^^^ help: try: `TupleDerivedDefault::default()`
3838

39-
error: Calling `ArrayDerivedDefault::default()` is more clear than this expression
39+
error: calling `ArrayDerivedDefault::default()` is more clear than this expression
4040
--> $DIR/default_trait_access.rs:36:36
4141
|
4242
LL | let s15: ArrayDerivedDefault = Default::default();
4343
| ^^^^^^^^^^^^^^^^^^ help: try: `ArrayDerivedDefault::default()`
4444

45-
error: Calling `TupleStructDerivedDefault::default()` is more clear than this expression
45+
error: calling `TupleStructDerivedDefault::default()` is more clear than this expression
4646
--> $DIR/default_trait_access.rs:40:42
4747
|
4848
LL | let s17: TupleStructDerivedDefault = Default::default();

0 commit comments

Comments
 (0)