2023-07-31 21:53:53 +00:00
|
|
|
error: use of `format!` to build up a string from an iterator
|
|
|
|
--> $DIR/format_collect.rs:5:5
|
|
|
|
|
|
|
|
|
LL | bytes.iter().map(|b| format!("{b:02X}")).collect()
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: call `fold` instead
|
|
|
|
--> $DIR/format_collect.rs:5:18
|
|
|
|
|
|
|
|
|
LL | bytes.iter().map(|b| format!("{b:02X}")).collect()
|
|
|
|
| ^^^
|
|
|
|
help: ... and use the `write!` macro here
|
|
|
|
--> $DIR/format_collect.rs:5:26
|
|
|
|
|
|
|
|
|
LL | bytes.iter().map(|b| format!("{b:02X}")).collect()
|
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
= note: this can be written more efficiently by appending to a `String` directly
|
|
|
|
= note: `-D clippy::format-collect` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::format_collect)]`
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
error: use of `format!` to build up a string from an iterator
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/format_collect.rs:11:5
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
|
LL | bytes.iter().map(|b| {{{{{ format!("{b:02X}") }}}}}).collect()
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
|
help: call `fold` instead
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/format_collect.rs:11:18
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
|
LL | bytes.iter().map(|b| {{{{{ format!("{b:02X}") }}}}}).collect()
|
|
|
|
| ^^^
|
|
|
|
help: ... and use the `write!` macro here
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/format_collect.rs:11:32
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
|
LL | bytes.iter().map(|b| {{{{{ format!("{b:02X}") }}}}}).collect()
|
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
= note: this can be written more efficiently by appending to a `String` directly
|
|
|
|
|
|
|
|
error: use of `format!` to build up a string from an iterator
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/format_collect.rs:26:5
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
|
LL | / (1..10)
|
2023-08-24 19:32:12 +00:00
|
|
|
LL | |
|
2023-07-31 21:53:53 +00:00
|
|
|
LL | | .map(|s| {
|
|
|
|
LL | | let y = 1;
|
|
|
|
LL | | format!("{s} {y}")
|
|
|
|
LL | | })
|
|
|
|
LL | | .collect()
|
|
|
|
| |__________________^
|
|
|
|
|
|
|
|
|
help: call `fold` instead
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/format_collect.rs:28:10
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
|
LL | .map(|s| {
|
|
|
|
| ^^^
|
|
|
|
help: ... and use the `write!` macro here
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/format_collect.rs:30:13
|
2023-07-31 21:53:53 +00:00
|
|
|
|
|
|
|
|
LL | format!("{s} {y}")
|
|
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
= note: this can be written more efficiently by appending to a `String` directly
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
|