@@ -36,62 +36,68 @@ LL ~ " bar"##.to_string();
36
36
error: useless use of `format!`
37
37
--> $DIR/format.rs:21:5
38
38
|
39
+ LL | format!("");
40
+ | ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()`
41
+
42
+ error: useless use of `format!`
43
+ --> $DIR/format.rs:23:5
44
+ |
39
45
LL | format!("{}", "foo");
40
46
| ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
41
47
42
48
error: useless use of `format!`
43
- --> $DIR/format.rs:25 :5
49
+ --> $DIR/format.rs:27 :5
44
50
|
45
51
LL | format!("{:+}", "foo"); // Warn when the format makes no difference.
46
52
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
47
53
48
54
error: useless use of `format!`
49
- --> $DIR/format.rs:26 :5
55
+ --> $DIR/format.rs:28 :5
50
56
|
51
57
LL | format!("{:<}", "foo"); // Warn when the format makes no difference.
52
58
| ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"foo".to_string()`
53
59
54
60
error: useless use of `format!`
55
- --> $DIR/format.rs:31 :5
61
+ --> $DIR/format.rs:33 :5
56
62
|
57
63
LL | format!("{}", arg);
58
64
| ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string()`
59
65
60
66
error: useless use of `format!`
61
- --> $DIR/format.rs:35 :5
67
+ --> $DIR/format.rs:37 :5
62
68
|
63
69
LL | format!("{:+}", arg); // Warn when the format makes no difference.
64
70
| ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string()`
65
71
66
72
error: useless use of `format!`
67
- --> $DIR/format.rs:36 :5
73
+ --> $DIR/format.rs:38 :5
68
74
|
69
75
LL | format!("{:<}", arg); // Warn when the format makes no difference.
70
76
| ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `arg.to_string()`
71
77
72
78
error: useless use of `format!`
73
- --> $DIR/format.rs:63 :5
79
+ --> $DIR/format.rs:65 :5
74
80
|
75
81
LL | format!("{}", 42.to_string());
76
82
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `42.to_string()`
77
83
78
84
error: useless use of `format!`
79
- --> $DIR/format.rs:65 :5
85
+ --> $DIR/format.rs:67 :5
80
86
|
81
87
LL | format!("{}", x.display().to_string());
82
88
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `x.display().to_string()`
83
89
84
90
error: useless use of `format!`
85
- --> $DIR/format.rs:69 :18
91
+ --> $DIR/format.rs:71 :18
86
92
|
87
93
LL | let _ = Some(format!("{}", a + "bar"));
88
94
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `a + "bar"`
89
95
90
96
error: useless use of `format!`
91
- --> $DIR/format.rs:73 :22
97
+ --> $DIR/format.rs:75 :22
92
98
|
93
99
LL | let _s: String = format!("{}", &*v.join("/n"));
94
100
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `(&*v.join("/n")).to_string()`
95
101
96
- error: aborting due to 14 previous errors
102
+ error: aborting due to 15 previous errors
97
103
0 commit comments