@@ -6,53 +6,65 @@ LL | format!("foo");
6
6
|
7
7
= note: `-D clippy::useless-format` implied by `-D warnings`
8
8
9
+ error: useless use of `format!`
10
+ --> $DIR/format.rs:14:5
11
+ |
12
+ LL | format!("{{}}");
13
+ | ^^^^^^^^^^^^^^^^ help: consider using .to_string(): `"{}".to_string();`
14
+
9
15
error: useless use of `format!`
10
16
--> $DIR/format.rs:15:5
11
17
|
18
+ LL | format!("{{}} abc {{}}");
19
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `"{} abc {}".to_string();`
20
+
21
+ error: useless use of `format!`
22
+ --> $DIR/format.rs:17:5
23
+ |
12
24
LL | format!("{}", "foo");
13
25
| ^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `"foo".to_string();`
14
26
15
27
error: useless use of `format!`
16
- --> $DIR/format.rs:19 :5
28
+ --> $DIR/format.rs:21 :5
17
29
|
18
30
LL | format!("{:+}", "foo"); // Warn when the format makes no difference.
19
31
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `"foo".to_string();`
20
32
21
33
error: useless use of `format!`
22
- --> $DIR/format.rs:20 :5
34
+ --> $DIR/format.rs:22 :5
23
35
|
24
36
LL | format!("{:<}", "foo"); // Warn when the format makes no difference.
25
37
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `"foo".to_string();`
26
38
27
39
error: useless use of `format!`
28
- --> $DIR/format.rs:25 :5
40
+ --> $DIR/format.rs:27 :5
29
41
|
30
42
LL | format!("{}", arg);
31
43
| ^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `arg.to_string();`
32
44
33
45
error: useless use of `format!`
34
- --> $DIR/format.rs:29 :5
46
+ --> $DIR/format.rs:31 :5
35
47
|
36
48
LL | format!("{:+}", arg); // Warn when the format makes no difference.
37
49
| ^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `arg.to_string();`
38
50
39
51
error: useless use of `format!`
40
- --> $DIR/format.rs:30 :5
52
+ --> $DIR/format.rs:32 :5
41
53
|
42
54
LL | format!("{:<}", arg); // Warn when the format makes no difference.
43
55
| ^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `arg.to_string();`
44
56
45
57
error: useless use of `format!`
46
- --> $DIR/format.rs:57 :5
58
+ --> $DIR/format.rs:59 :5
47
59
|
48
60
LL | format!("{}", 42.to_string());
49
61
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: `to_string()` is enough: `42.to_string();`
50
62
51
63
error: useless use of `format!`
52
- --> $DIR/format.rs:59 :5
64
+ --> $DIR/format.rs:61 :5
53
65
|
54
66
LL | format!("{}", x.display().to_string());
55
67
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: `to_string()` is enough: `x.display().to_string();`
56
68
57
- error: aborting due to 9 previous errors
69
+ error: aborting due to 11 previous errors
58
70
0 commit comments