1
1
error: useless use of `format!`
2
- --> $DIR/format.rs:18 :5
2
+ --> $DIR/format.rs:19 :5
3
3
|
4
4
LL | format!("foo");
5
5
| ^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
6
6
|
7
7
= note: `-D clippy::useless-format` implied by `-D warnings`
8
8
9
9
error: useless use of `format!`
10
- --> $DIR/format.rs:19 :5
10
+ --> $DIR/format.rs:20 :5
11
11
|
12
12
LL | format!("{{}}");
13
13
| ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"{}".to_string()`
14
14
15
15
error: useless use of `format!`
16
- --> $DIR/format.rs:20 :5
16
+ --> $DIR/format.rs:21 :5
17
17
|
18
18
LL | format!("{{}} abc {{}}");
19
19
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"{} abc {}".to_string()`
20
20
21
21
error: useless use of `format!`
22
- --> $DIR/format.rs:21 :5
22
+ --> $DIR/format.rs:22 :5
23
23
|
24
24
LL | / format!(
25
25
LL | | r##"foo {{}}
@@ -34,91 +34,91 @@ LL ~ " bar"##.to_string();
34
34
|
35
35
36
36
error: useless use of `format!`
37
- --> $DIR/format.rs:26 :13
37
+ --> $DIR/format.rs:27 :13
38
38
|
39
39
LL | let _ = format!("");
40
40
| ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()`
41
41
42
42
error: useless use of `format!`
43
- --> $DIR/format.rs:28 :5
43
+ --> $DIR/format.rs:29 :5
44
44
|
45
45
LL | format!("{}", "foo");
46
46
| ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
47
47
48
48
error: useless use of `format!`
49
- --> $DIR/format.rs:32 :5
49
+ --> $DIR/format.rs:33 :5
50
50
|
51
51
LL | format!("{:+}", "foo"); // Warn when the format makes no difference.
52
52
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
53
53
54
54
error: useless use of `format!`
55
- --> $DIR/format.rs:33 :5
55
+ --> $DIR/format.rs:34 :5
56
56
|
57
57
LL | format!("{:<}", "foo"); // Warn when the format makes no difference.
58
58
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
59
59
60
60
error: useless use of `format!`
61
- --> $DIR/format.rs:38 :5
61
+ --> $DIR/format.rs:39 :5
62
62
|
63
63
LL | format!("{}", arg);
64
64
| ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string()`
65
65
66
66
error: useless use of `format!`
67
- --> $DIR/format.rs:42 :5
67
+ --> $DIR/format.rs:43 :5
68
68
|
69
69
LL | format!("{:+}", arg); // Warn when the format makes no difference.
70
70
| ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string()`
71
71
72
72
error: useless use of `format!`
73
- --> $DIR/format.rs:43 :5
73
+ --> $DIR/format.rs:44 :5
74
74
|
75
75
LL | format!("{:<}", arg); // Warn when the format makes no difference.
76
76
| ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string()`
77
77
78
78
error: useless use of `format!`
79
- --> $DIR/format.rs:70 :5
79
+ --> $DIR/format.rs:71 :5
80
80
|
81
81
LL | format!("{}", 42.to_string());
82
82
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `42.to_string()`
83
83
84
84
error: useless use of `format!`
85
- --> $DIR/format.rs:72 :5
85
+ --> $DIR/format.rs:73 :5
86
86
|
87
87
LL | format!("{}", x.display().to_string());
88
88
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.display().to_string()`
89
89
90
90
error: useless use of `format!`
91
- --> $DIR/format.rs:76 :18
91
+ --> $DIR/format.rs:77 :18
92
92
|
93
93
LL | let _ = Some(format!("{}", a + "bar"));
94
94
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `a + "bar"`
95
95
96
96
error: useless use of `format!`
97
- --> $DIR/format.rs:80 :22
97
+ --> $DIR/format.rs:81 :22
98
98
|
99
99
LL | let _s: String = format!("{}", &*v.join("/n"));
100
100
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `(&*v.join("/n")).to_string()`
101
101
102
102
error: useless use of `format!`
103
- --> $DIR/format.rs:86 :13
103
+ --> $DIR/format.rs:87 :13
104
104
|
105
105
LL | let _ = format!("{x}");
106
106
| ^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.to_string()`
107
107
108
108
error: useless use of `format!`
109
- --> $DIR/format.rs:88 :13
109
+ --> $DIR/format.rs:89 :13
110
110
|
111
111
LL | let _ = format!("{y}", y = x);
112
112
| ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.to_string()`
113
113
114
114
error: useless use of `format!`
115
- --> $DIR/format.rs:92 :13
115
+ --> $DIR/format.rs:93 :13
116
116
|
117
117
LL | let _ = format!("{abc}");
118
118
| ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `abc.to_string()`
119
119
120
120
error: useless use of `format!`
121
- --> $DIR/format.rs:94 :13
121
+ --> $DIR/format.rs:95 :13
122
122
|
123
123
LL | let _ = format!("{xx}");
124
124
| ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `xx.to_string()`
0 commit comments