11error: useless use of `format!`
2- --> $DIR/format.rs:18 :5
2+ --> $DIR/format.rs:19 :5
33 |
44LL | format!("foo");
55 | ^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
66 |
77 = note: `-D clippy::useless-format` implied by `-D warnings`
88
99error: useless use of `format!`
10- --> $DIR/format.rs:19 :5
10+ --> $DIR/format.rs:20 :5
1111 |
1212LL | format!("{{}}");
1313 | ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"{}".to_string()`
1414
1515error: useless use of `format!`
16- --> $DIR/format.rs:20 :5
16+ --> $DIR/format.rs:21 :5
1717 |
1818LL | format!("{{}} abc {{}}");
1919 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"{} abc {}".to_string()`
2020
2121error: useless use of `format!`
22- --> $DIR/format.rs:21 :5
22+ --> $DIR/format.rs:22 :5
2323 |
2424LL | / format!(
2525LL | | r##"foo {{}}
@@ -34,91 +34,91 @@ LL ~ " bar"##.to_string();
3434 |
3535
3636error: useless use of `format!`
37- --> $DIR/format.rs:26 :13
37+ --> $DIR/format.rs:27 :13
3838 |
3939LL | let _ = format!("");
4040 | ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()`
4141
4242error: useless use of `format!`
43- --> $DIR/format.rs:28 :5
43+ --> $DIR/format.rs:29 :5
4444 |
4545LL | format!("{}", "foo");
4646 | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
4747
4848error: useless use of `format!`
49- --> $DIR/format.rs:32 :5
49+ --> $DIR/format.rs:33 :5
5050 |
5151LL | format!("{:+}", "foo"); // Warn when the format makes no difference.
5252 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
5353
5454error: useless use of `format!`
55- --> $DIR/format.rs:33 :5
55+ --> $DIR/format.rs:34 :5
5656 |
5757LL | format!("{:<}", "foo"); // Warn when the format makes no difference.
5858 | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
5959
6060error: useless use of `format!`
61- --> $DIR/format.rs:38 :5
61+ --> $DIR/format.rs:39 :5
6262 |
6363LL | format!("{}", arg);
6464 | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string()`
6565
6666error: useless use of `format!`
67- --> $DIR/format.rs:42 :5
67+ --> $DIR/format.rs:43 :5
6868 |
6969LL | format!("{:+}", arg); // Warn when the format makes no difference.
7070 | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string()`
7171
7272error: useless use of `format!`
73- --> $DIR/format.rs:43 :5
73+ --> $DIR/format.rs:44 :5
7474 |
7575LL | format!("{:<}", arg); // Warn when the format makes no difference.
7676 | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string()`
7777
7878error: useless use of `format!`
79- --> $DIR/format.rs:70 :5
79+ --> $DIR/format.rs:71 :5
8080 |
8181LL | format!("{}", 42.to_string());
8282 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `42.to_string()`
8383
8484error: useless use of `format!`
85- --> $DIR/format.rs:72 :5
85+ --> $DIR/format.rs:73 :5
8686 |
8787LL | format!("{}", x.display().to_string());
8888 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.display().to_string()`
8989
9090error: useless use of `format!`
91- --> $DIR/format.rs:76 :18
91+ --> $DIR/format.rs:77 :18
9292 |
9393LL | let _ = Some(format!("{}", a + "bar"));
9494 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `a + "bar"`
9595
9696error: useless use of `format!`
97- --> $DIR/format.rs:80 :22
97+ --> $DIR/format.rs:81 :22
9898 |
9999LL | let _s: String = format!("{}", &*v.join("/n"));
100100 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `(&*v.join("/n")).to_string()`
101101
102102error: useless use of `format!`
103- --> $DIR/format.rs:86 :13
103+ --> $DIR/format.rs:87 :13
104104 |
105105LL | let _ = format!("{x}");
106106 | ^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.to_string()`
107107
108108error: useless use of `format!`
109- --> $DIR/format.rs:88 :13
109+ --> $DIR/format.rs:89 :13
110110 |
111111LL | let _ = format!("{y}", y = x);
112112 | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.to_string()`
113113
114114error: useless use of `format!`
115- --> $DIR/format.rs:92 :13
115+ --> $DIR/format.rs:93 :13
116116 |
117117LL | let _ = format!("{abc}");
118118 | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `abc.to_string()`
119119
120120error: useless use of `format!`
121- --> $DIR/format.rs:94 :13
121+ --> $DIR/format.rs:95 :13
122122 |
123123LL | let _ = format!("{xx}");
124124 | ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `xx.to_string()`
0 commit comments