chore: solve clippy warnings #4
Annotations
11 errors and 5 warnings
use of `format!` to build up a string from an iterator:
data_structures/src/superblock.rs#L161
error: use of `format!` to build up a string from an iterator
--> data_structures/src/superblock.rs:161:29
|
161 | let mut s: String = self
| _____________________________^
162 | | .votes_on_each_superblock
163 | | .iter()
164 | | .map(|(superblock_hash, votes)| {
... |
172 | | })
173 | | .collect();
| |______________________^
|
help: call `fold` instead
--> data_structures/src/superblock.rs:164:14
|
164 | .map(|(superblock_hash, votes)| {
| ^^^
help: ... and use the `write!` macro here
--> data_structures/src/superblock.rs:171:17
|
171 | format!(" {}: {} votes: {:?}\n", superblock_hash, pkhs.len(), pkhs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= 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`
|
use of `or_insert_with` to construct default value:
data_structures/src/data_request.rs#L146
error: use of `or_insert_with` to construct default value
--> data_structures/src/data_request.rs:146:14
|
146 | .or_insert_with(HashSet::new)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
|
use of `format!` to build up a string from an iterator:
data_structures/src/superblock.rs#L161
error: use of `format!` to build up a string from an iterator
--> data_structures/src/superblock.rs:161:29
|
161 | let mut s: String = self
| _____________________________^
162 | | .votes_on_each_superblock
163 | | .iter()
164 | | .map(|(superblock_hash, votes)| {
... |
172 | | })
173 | | .collect();
| |______________________^
|
help: call `fold` instead
--> data_structures/src/superblock.rs:164:14
|
164 | .map(|(superblock_hash, votes)| {
| ^^^
help: ... and use the `write!` macro here
--> data_structures/src/superblock.rs:171:17
|
171 | format!(" {}: {} votes: {:?}\n", superblock_hash, pkhs.len(), pkhs)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= 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`
|
use of `or_insert_with` to construct default value:
data_structures/src/data_request.rs#L146
error: use of `or_insert_with` to construct default value
--> data_structures/src/data_request.rs:146:14
|
146 | .or_insert_with(HashSet::new)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
|
use of `or_insert_with` to construct default value:
data_structures/src/chain/mod.rs#L2718
error: use of `or_insert_with` to construct default value
--> data_structures/src/chain/mod.rs:2718:30
|
2718 | ... .or_insert_with(Vec::new)
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
|
use of `or_insert_with` to construct default value:
data_structures/src/chain/mod.rs#L2693
error: use of `or_insert_with` to construct default value
--> data_structures/src/chain/mod.rs:2693:30
|
2693 | ... .or_insert_with(Vec::new)
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
= note: `-D clippy::unwrap-or-default` implied by `-D warnings`
|
use of `or_insert_with` to construct default value:
data_structures/src/chain/mod.rs#L2718
error: use of `or_insert_with` to construct default value
--> data_structures/src/chain/mod.rs:2718:30
|
2718 | ... .or_insert_with(Vec::new)
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
|
use of `or_insert_with` to construct default value:
data_structures/src/chain/mod.rs#L2693
error: use of `or_insert_with` to construct default value
--> data_structures/src/chain/mod.rs:2693:30
|
2693 | ... .or_insert_with(Vec::new)
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default
= note: `-D clippy::unwrap-or-default` implied by `-D warnings`
|
build_ubuntu
could not compile `witnet_data_structures` (lib) due to 5 previous errors
|
build_ubuntu
could not compile `witnet_data_structures` (lib test) due to 5 previous errors
|
build_ubuntu
Clippy had exited with the 101 exit code
|
build_ubuntu
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1, actions-rs/clippy-check@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
|
build_ubuntu
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
build_ubuntu
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
build_ubuntu
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|
build_ubuntu
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
|