fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.1 KiB64 linesraw
1error: use of `format!` to build up a string from an iterator
2  --> $DIR/format_collect.rs:5:5
3   |
4LL |     bytes.iter().map(|b| format!("{b:02X}")).collect()
5   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6   |
7help: call `fold` instead
8  --> $DIR/format_collect.rs:5:18
9   |
10LL |     bytes.iter().map(|b| format!("{b:02X}")).collect()
11   |                  ^^^
12help: ... and use the `write!` macro here
13  --> $DIR/format_collect.rs:5:26
14   |
15LL |     bytes.iter().map(|b| format!("{b:02X}")).collect()
16   |                          ^^^^^^^^^^^^^^^^^^
17   = note: this can be written more efficiently by appending to a `String` directly
18   = note: `-D clippy::format-collect` implied by `-D warnings`
19   = help: to override `-D warnings` add `#[allow(clippy::format_collect)]`
20
21error: use of `format!` to build up a string from an iterator
22  --> $DIR/format_collect.rs:11:5
23   |
24LL |     bytes.iter().map(|b| {{{{{ format!("{b:02X}") }}}}}).collect()
25   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26   |
27help: call `fold` instead
28  --> $DIR/format_collect.rs:11:18
29   |
30LL |     bytes.iter().map(|b| {{{{{ format!("{b:02X}") }}}}}).collect()
31   |                  ^^^
32help: ... and use the `write!` macro here
33  --> $DIR/format_collect.rs:11:32
34   |
35LL |     bytes.iter().map(|b| {{{{{ format!("{b:02X}") }}}}}).collect()
36   |                                ^^^^^^^^^^^^^^^^^^
37   = note: this can be written more efficiently by appending to a `String` directly
38
39error: use of `format!` to build up a string from an iterator
40  --> $DIR/format_collect.rs:26:5
41   |
42LL | /     (1..10)
43LL | |
44LL | |         .map(|s| {
45LL | |             let y = 1;
46LL | |             format!("{s} {y}")
47LL | |         })
48LL | |         .collect()
49   | |__________________^
50   |
51help: call `fold` instead
52  --> $DIR/format_collect.rs:28:10
53   |
54LL |         .map(|s| {
55   |          ^^^
56help: ... and use the `write!` macro here
57  --> $DIR/format_collect.rs:30:13
58   |
59LL |             format!("{s} {y}")
60   |             ^^^^^^^^^^^^^^^^^^
61   = note: this can be written more efficiently by appending to a `String` directly
62
63error: aborting due to 3 previous errors
64