11error: useless use of `format!`
2- --> tests/ui/format.rs:20 :5
2+ --> tests/ui/format.rs:21 :5
33 |
44LL | format!("foo");
55 | ^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
@@ -8,19 +8,19 @@ LL | format!("foo");
88 = help: to override `-D warnings` add `#[allow(clippy::useless_format)]`
99
1010error: useless use of `format!`
11- --> tests/ui/format.rs:22 :5
11+ --> tests/ui/format.rs:23 :5
1212 |
1313LL | format!("{{}}");
1414 | ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"{}".to_string()`
1515
1616error: useless use of `format!`
17- --> tests/ui/format.rs:24 :5
17+ --> tests/ui/format.rs:25 :5
1818 |
1919LL | format!("{{}} abc {{}}");
2020 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"{} abc {}".to_string()`
2121
2222error: useless use of `format!`
23- --> tests/ui/format.rs:26 :5
23+ --> tests/ui/format.rs:27 :5
2424 |
2525LL | / format!(
2626LL | |
@@ -36,70 +36,94 @@ LL ~ " bar"##.to_string();
3636 |
3737
3838error: useless use of `format!`
39- --> tests/ui/format.rs:32 :13
39+ --> tests/ui/format.rs:33 :13
4040 |
4141LL | let _ = format!("");
4242 | ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()`
4343
4444error: useless use of `format!`
45- --> tests/ui/format.rs:35 :5
45+ --> tests/ui/format.rs:36 :5
4646 |
4747LL | format!("{}", "foo");
4848 | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
4949
5050error: useless use of `format!`
51- --> tests/ui/format.rs:44 :5
51+ --> tests/ui/format.rs:45 :5
5252 |
5353LL | format!("{}", arg);
5454 | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string()`
5555
5656error: useless use of `format!`
57- --> tests/ui/format.rs:75 :5
57+ --> tests/ui/format.rs:76 :5
5858 |
5959LL | format!("{}", 42.to_string());
6060 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `42.to_string()`
6161
6262error: useless use of `format!`
63- --> tests/ui/format.rs:78 :5
63+ --> tests/ui/format.rs:79 :5
6464 |
6565LL | format!("{}", x.display().to_string());
6666 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.display().to_string()`
6767
6868error: useless use of `format!`
69- --> tests/ui/format.rs:83 :18
69+ --> tests/ui/format.rs:84 :18
7070 |
7171LL | let _ = Some(format!("{}", a + "bar"));
7272 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `a + "bar"`
7373
7474error: useless use of `format!`
75- --> tests/ui/format.rs:88 :22
75+ --> tests/ui/format.rs:89 :22
7676 |
7777LL | let _s: String = format!("{}", &*v.join("\n"));
7878 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `(&*v.join("\n")).to_string()`
7979
8080error: useless use of `format!`
81- --> tests/ui/format.rs:95 :13
81+ --> tests/ui/format.rs:96 :13
8282 |
8383LL | let _ = format!("{x}");
8484 | ^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.to_string()`
8585
8686error: useless use of `format!`
87- --> tests/ui/format.rs:98 :13
87+ --> tests/ui/format.rs:99 :13
8888 |
8989LL | let _ = format!("{y}", y = x);
9090 | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.to_string()`
9191
9292error: useless use of `format!`
93- --> tests/ui/format.rs:103 :13
93+ --> tests/ui/format.rs:104 :13
9494 |
9595LL | let _ = format!("{abc}");
9696 | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `abc.to_string()`
9797
9898error: useless use of `format!`
99- --> tests/ui/format.rs:106 :13
99+ --> tests/ui/format.rs:107 :13
100100 |
101101LL | let _ = format!("{xx}");
102102 | ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `xx.to_string()`
103103
104- error: aborting due to 15 previous errors
104+ error: useless use of `format!`
105+ --> tests/ui/format.rs:138:27
106+ |
107+ LL | let _ = plain_mr!(format!("{}", s()));
108+ | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `s().to_string()`
109+
110+ error: useless use of `format!`
111+ --> tests/ui/format.rs:140:27
112+ |
113+ LL | let _ = block_mr!(format!("{}", s()));
114+ | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `s().to_string()`
115+
116+ error: useless use of `format!`
117+ --> tests/ui/format.rs:142:27
118+ |
119+ LL | let _ = plain_dm!(format!("{}", s()));
120+ | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `s().to_string()`
121+
122+ error: useless use of `format!`
123+ --> tests/ui/format.rs:144:27
124+ |
125+ LL | let _ = block_dm!(format!("{}", s()));
126+ | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `s().to_string()`
127+
128+ error: aborting due to 19 previous errors
105129
0 commit comments