about summary refs log tree commit diff
path: root/tests/ui/format_push_string.stderr
blob: d862dd6dc5f3648f0ac91197e7790f2ebd85bf35 (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
error: `format!(..)` appended to existing `String`
  --> $DIR/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`

error: `format!(..)` appended to existing `String`
  --> $DIR/format_push_string.rs:7:5
   |
LL |     string.push_str(&format!("{:?}", 5678));
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider using `write!` to avoid the extra allocation

error: `format!(..)` appended to existing `String`
  --> $DIR/format_push_string.rs:15:13
   |
LL | /             hex += &(if upper {
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`
  --> $DIR/format_push_string.rs:28:9
   |
LL | /         s += &(if let Some(_a) = Some(1234) {
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`
  --> $DIR/format_push_string.rs:35: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