Commit 0a03b55
committed
examples: avoid format collect
Fixes:
```
error: use of `format!` to build up a string from an iterator
--> rcgen/examples/rsa-irc.rs:30:25
|
30 | let hash_hex: String = hash.as_ref().iter().map(|b| format!("{:02x}", b)).collect();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: call `fold` instead
--> rcgen/examples/rsa-irc.rs:30:46
|
30 | let hash_hex: String = hash.as_ref().iter().map(|b| format!("{:02x}", b)).collect();
| ^^^
help: ... and use the `write!` macro here
--> rcgen/examples/rsa-irc.rs:30:54
|
30 | let hash_hex: String = hash.as_ref().iter().map(|b| format!("{:02x}", b)).collect();
| ^^^^^^^^^^^^^^^^^^^^
= note: this can be written more efficiently by appending to a `String` directly
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_collect
= note: `-D clippy::format-collect` implied by `-D warnings`
```1 parent 22f38c5 commit 0a03b55
2 files changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
| |||
0 commit comments