@@ -6,53 +6,65 @@ LL | format!("foo");
66 |
77 = note: `-D clippy::useless-format` implied by `-D warnings`
88
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+
915error: useless use of `format!`
1016 --> $DIR/format.rs:15:5
1117 |
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+ |
1224LL | format!("{}", "foo");
1325 | ^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `"foo".to_string();`
1426
1527error: useless use of `format!`
16- --> $DIR/format.rs:19 :5
28+ --> $DIR/format.rs:21 :5
1729 |
1830LL | format!("{:+}", "foo"); // Warn when the format makes no difference.
1931 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `"foo".to_string();`
2032
2133error: useless use of `format!`
22- --> $DIR/format.rs:20 :5
34+ --> $DIR/format.rs:22 :5
2335 |
2436LL | format!("{:<}", "foo"); // Warn when the format makes no difference.
2537 | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `"foo".to_string();`
2638
2739error: useless use of `format!`
28- --> $DIR/format.rs:25 :5
40+ --> $DIR/format.rs:27 :5
2941 |
3042LL | format!("{}", arg);
3143 | ^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `arg.to_string();`
3244
3345error: useless use of `format!`
34- --> $DIR/format.rs:29 :5
46+ --> $DIR/format.rs:31 :5
3547 |
3648LL | format!("{:+}", arg); // Warn when the format makes no difference.
3749 | ^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `arg.to_string();`
3850
3951error: useless use of `format!`
40- --> $DIR/format.rs:30 :5
52+ --> $DIR/format.rs:32 :5
4153 |
4254LL | format!("{:<}", arg); // Warn when the format makes no difference.
4355 | ^^^^^^^^^^^^^^^^^^^^^ help: consider using .to_string(): `arg.to_string();`
4456
4557error: useless use of `format!`
46- --> $DIR/format.rs:57 :5
58+ --> $DIR/format.rs:59 :5
4759 |
4860LL | format!("{}", 42.to_string());
4961 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: `to_string()` is enough: `42.to_string();`
5062
5163error: useless use of `format!`
52- --> $DIR/format.rs:59 :5
64+ --> $DIR/format.rs:61 :5
5365 |
5466LL | format!("{}", x.display().to_string());
5567 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: `to_string()` is enough: `x.display().to_string();`
5668
57- error: aborting due to 9 previous errors
69+ error: aborting due to 11 previous errors
5870
0 commit comments