blob: bba2a8947c43f8858c4362da86c26b85bf06df73 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
error: `format!(..)` appended to existing `String`
--> tests/ui/format_push_string.rs:5:5
|
LL | string += &format!("{:?}", 1234);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using `write!` to avoid the extra allocation
= note: `-D clippy::format-push-string` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::format_push_string)]`
error: `format!(..)` appended to existing `String`
--> tests/ui/format_push_string.rs:8:5
|
LL | string.push_str(&format!("{:?}", 5678));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider using `write!` to avoid the extra allocation
error: `format!(..)` appended to existing `String`
--> tests/ui/format_push_string.rs:16:13
|
LL | / hex += &(if upper {
LL | |
LL | |
LL | | format!("{byte:02X}")
LL | | } else {
LL | | format!("{byte:02x}")
LL | | });
| |______________^
|
= help: consider using `write!` to avoid the extra allocation
error: `format!(..)` appended to existing `String`
--> tests/ui/format_push_string.rs:30:9
|
LL | / s += &(if let Some(_a) = Some(1234) {
LL | |
LL | |
LL | | format!("{}", 1234)
LL | | } else {
LL | | format!("{}", 1234)
LL | | });
| |__________^
|
= help: consider using `write!` to avoid the extra allocation
error: `format!(..)` appended to existing `String`
--> tests/ui/format_push_string.rs:38:9
|
LL | / s += &(match Some(1234) {
LL | |
LL | | Some(_) => format!("{}", 1234),
LL | | None => format!("{}", 1234),
LL | | });
| |__________^
|
= help: consider using `write!` to avoid the extra allocation
error: aborting due to 5 previous errors
|