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