[INFO] cloning repository https://github.com/JoshuaBOUCHAT/crypto [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/JoshuaBOUCHAT/crypto" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FJoshuaBOUCHAT%2Fcrypto", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FJoshuaBOUCHAT%2Fcrypto'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] bf5f404ec84985ef5c990573312dcf4305d27554 [INFO] linting JoshuaBOUCHAT/crypto against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FJoshuaBOUCHAT%2Fcrypto" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/JoshuaBOUCHAT/crypto [INFO] finished tweaking git repo https://github.com/JoshuaBOUCHAT/crypto [INFO] tweaked toml for git repo https://github.com/JoshuaBOUCHAT/crypto written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/JoshuaBOUCHAT/crypto on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/JoshuaBOUCHAT/crypto already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded libp2p-allow-block-list v0.6.0 [INFO] [stderr] Downloaded libp2p v0.56.0 [INFO] [stderr] Downloaded libp2p-connection-limits v0.6.0 [INFO] [stderr] Downloaded libp2p-core v0.43.1 [INFO] [stderr] Downloaded libp2p-swarm v0.47.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 89e48479d3d1069b586fbdd25986f8ed730ab03a89713284109d1cf2dee08395 [INFO] running `Command { std: "docker" "start" "-a" "89e48479d3d1069b586fbdd25986f8ed730ab03a89713284109d1cf2dee08395", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "89e48479d3d1069b586fbdd25986f8ed730ab03a89713284109d1cf2dee08395", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "89e48479d3d1069b586fbdd25986f8ed730ab03a89713284109d1cf2dee08395", kill_on_drop: false }` [INFO] [stdout] 89e48479d3d1069b586fbdd25986f8ed730ab03a89713284109d1cf2dee08395 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 76ebf9e19ca07981ef9f565ed75aaf55314aa88fab58dd540d0f26405d66c0ff [INFO] running `Command { std: "docker" "start" "-a" "76ebf9e19ca07981ef9f565ed75aaf55314aa88fab58dd540d0f26405d66c0ff", kill_on_drop: false }` [INFO] [stderr] Compiling sha2-asm v0.6.4 [INFO] [stderr] Checking signature v2.2.0 [INFO] [stderr] Compiling syn v2.0.111 [INFO] [stderr] Checking getrandom v0.2.16 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Checking num_cpus v1.17.0 [INFO] [stderr] Compiling data-encoding v2.9.0 [INFO] [stderr] Checking core2 v0.4.0 [INFO] [stderr] Checking const-str v0.4.3 [INFO] [stderr] Checking unsigned-varint v0.8.0 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Checking form_urlencoded v1.2.2 [INFO] [stderr] Checking quick-protobuf v0.8.1 [INFO] [stderr] Checking bs58 v0.5.1 [INFO] [stderr] Checking base-x v0.2.11 [INFO] [stderr] Checking parking_lot_core v0.9.12 [INFO] [stderr] Checking either v1.15.0 [INFO] [stderr] Checking unsigned-varint v0.7.2 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking ed25519 v2.2.3 [INFO] [stderr] Checking time-core v0.1.6 [INFO] [stderr] Checking hmac v0.12.1 [INFO] [stderr] Checking parking_lot v0.12.5 [INFO] [stderr] Checking multihash v0.19.3 [INFO] [stderr] Checking time v0.3.44 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking hkdf v0.12.4 [INFO] [stderr] Checking rayon v1.11.0 [INFO] [stderr] Checking sha2 v0.10.9 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Compiling match-lookup v0.1.1 [INFO] [stderr] Checking base256emoji v1.0.2 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.8.1 [INFO] [stderr] Compiling zerovec-derive v0.11.2 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling futures-macro v0.3.31 [INFO] [stderr] Compiling curve25519-dalek-derive v0.1.1 [INFO] [stderr] Compiling pin-project-internal v1.1.10 [INFO] [stderr] Compiling data-encoding-macro-internal v0.1.16 [INFO] [stderr] Compiling thiserror-impl v2.0.17 [INFO] [stderr] Compiling tracing-attributes v0.1.31 [INFO] [stderr] Checking curve25519-dalek v4.1.3 [INFO] [stderr] Checking data-encoding-macro v0.1.18 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Checking multibase v0.9.2 [INFO] [stderr] Checking tracing v0.1.43 [INFO] [stderr] Checking thiserror v2.0.17 [INFO] [stderr] Checking pin-project v1.1.10 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Checking yoke v0.8.1 [INFO] [stderr] Checking ed25519-dalek v2.2.0 [INFO] [stderr] Checking zerovec v0.11.5 [INFO] [stderr] Checking zerotrie v0.2.3 [INFO] [stderr] Checking libp2p-identity v0.2.13 [INFO] [stderr] Checking tinystr v0.8.2 [INFO] [stderr] Checking potential_utf v0.1.4 [INFO] [stderr] Checking icu_collections v2.1.1 [INFO] [stderr] Checking icu_locale_core v2.1.1 [INFO] [stderr] Checking icu_provider v2.1.1 [INFO] [stderr] Checking futures-executor v0.3.31 [INFO] [stderr] Checking futures v0.3.31 [INFO] [stderr] Checking multistream-select v0.13.0 [INFO] [stderr] Checking rw-stream-sink v0.4.0 [INFO] [stderr] Checking icu_normalizer v2.1.1 [INFO] [stderr] Checking icu_properties v2.1.2 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Checking idna v1.1.0 [INFO] [stderr] Checking url v2.5.7 [INFO] [stderr] Checking multiaddr v0.18.2 [INFO] [stderr] Checking libp2p-core v0.43.1 [INFO] [stderr] Checking libp2p-swarm v0.47.0 [INFO] [stderr] Checking libp2p-allow-block-list v0.6.0 [INFO] [stderr] Checking libp2p-connection-limits v0.6.0 [INFO] [stderr] Checking libp2p v0.56.0 [INFO] [stderr] Checking crypto v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/block_chain.rs:29:17 [INFO] [stdout] | [INFO] [stdout] 29 | pub fn peak<'a>(&'a self) -> &'a Block { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 29 - pub fn peak<'a>(&'a self) -> &'a Block { [INFO] [stdout] 29 + pub fn peak(&self) -> &Block { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/block_chain.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | &self.blocks.last().unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.blocks.last().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/block_chain.rs:36:17 [INFO] [stdout] | [INFO] [stdout] 36 | assert!(transactions.len() != 0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!transactions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/block_chain.rs:39:39 [INFO] [stdout] | [INFO] [stdout] 39 | MiningBlock::from_black_chain(&self, merkel_root) [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/block_chain.rs:48:12 [INFO] [stdout] | [INFO] [stdout] 48 | if self.blocks.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.blocks.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/block_chain.rs:51:13 [INFO] [stdout] | [INFO] [stdout] 51 | self.peak().get_hash().clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self.peak().get_hash()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/blocks/block.rs:97:18 [INFO] [stdout] | [INFO] [stdout] 97 | .map_err(|err| BlockValidationError::TransactionValidationError(err))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `BlockValidationError::TransactionValidationError` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/blocks/block.rs:99:27 [INFO] [stdout] | [INFO] [stdout] 99 | spent_map.insert((input.get_tx_id().clone(), input.get_tx_idx())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*input.get_tx_id()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/blocks/block.rs:118:36 [INFO] [stdout] | [INFO] [stdout] 118 | BASE64_STANDARD.encode(&self.hash), [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `self.hash` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/blocks/mining_block.rs:28:23 [INFO] [stdout] | [INFO] [stdout] 28 | hasher.update(&self.version.to_be_bytes()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.version.to_be_bytes()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/blocks/mining_block.rs:29:23 [INFO] [stdout] | [INFO] [stdout] 29 | hasher.update(&self.difficulty.to_be_bytes()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.difficulty.to_be_bytes()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/blocks/mining_block.rs:30:23 [INFO] [stdout] | [INFO] [stdout] 30 | hasher.update(&self.previous_hash); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `self.previous_hash` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/blocks/mining_block.rs:31:23 [INFO] [stdout] | [INFO] [stdout] 31 | hasher.update(&self.merkel_root); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `self.merkel_root` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/blocks/mining_block.rs:32:23 [INFO] [stdout] | [INFO] [stdout] 32 | hasher.update(&self.timestamp.to_be_bytes()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.timestamp.to_be_bytes()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/blocks/mining_block.rs:33:23 [INFO] [stdout] | [INFO] [stdout] 33 | hasher.update(&self.nonce.to_be_bytes()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.nonce.to_be_bytes()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/blocks/mining_block.rs:59:13 [INFO] [stdout] | [INFO] [stdout] 59 | / if count_leading_zeros(&self.hash()) >= self.get_difficulty() { [INFO] [stdout] 60 | | if let Some(block) = Block::try_new(&self) { [INFO] [stdout] 61 | | return Some(block); [INFO] [stdout] 62 | | } [INFO] [stdout] 63 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 59 ~ if count_leading_zeros(&self.hash()) >= self.get_difficulty() [INFO] [stdout] 60 ~ && let Some(block) = Block::try_new(&self) { [INFO] [stdout] 61 | return Some(block); [INFO] [stdout] 62 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/blocks/mining_block.rs:60:53 [INFO] [stdout] | [INFO] [stdout] 60 | if let Some(block) = Block::try_new(&self) { [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/blocks/mining_block.rs:84:28 [INFO] [stdout] | [INFO] [stdout] 84 | previous_hash: chain.get_previous_hash().clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `chain.get_previous_hash()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/transactions/merkel.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | assert!(transactions.len() != 0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!transactions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/transactions/merkel.rs:56:28 [INFO] [stdout] | [INFO] [stdout] 56 | self[0] = Some(hash.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*hash` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/transactions/merkel.rs:76:13 [INFO] [stdout] | [INFO] [stdout] 76 | !(first_index > final_index), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(first_index <= final_index)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/block_chain.rs:29:17 [INFO] [stdout] | [INFO] [stdout] 29 | pub fn peak<'a>(&'a self) -> &'a Block { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 29 - pub fn peak<'a>(&'a self) -> &'a Block { [INFO] [stdout] 29 + pub fn peak(&self) -> &Block { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/block_chain.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | &self.blocks.last().unwrap() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.blocks.last().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/block_chain.rs:36:17 [INFO] [stdout] | [INFO] [stdout] 36 | assert!(transactions.len() != 0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!transactions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/block_chain.rs:39:39 [INFO] [stdout] | [INFO] [stdout] 39 | MiningBlock::from_black_chain(&self, merkel_root) [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/block_chain.rs:48:12 [INFO] [stdout] | [INFO] [stdout] 48 | if self.blocks.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.blocks.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/block_chain.rs:51:13 [INFO] [stdout] | [INFO] [stdout] 51 | self.peak().get_hash().clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self.peak().get_hash()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `UTXOMap` [INFO] [stdout] --> src/utxo_map.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | / pub fn new() -> Self { [INFO] [stdout] 16 | | Self { [INFO] [stdout] 17 | | utxos: HashMap::new(), [INFO] [stdout] 18 | | } [INFO] [stdout] 19 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 14 + impl Default for UTXOMap { [INFO] [stdout] 15 + fn default() -> Self { [INFO] [stdout] 16 + Self::new() [INFO] [stdout] 17 + } [INFO] [stdout] 18 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/utxo_map.rs:34:39 [INFO] [stdout] | [INFO] [stdout] 34 | let utxo_key = Input::new(tx_id.clone(), tx_output_idx); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*tx_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/blocks/block.rs:97:18 [INFO] [stdout] | [INFO] [stdout] 97 | .map_err(|err| BlockValidationError::TransactionValidationError(err))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `BlockValidationError::TransactionValidationError` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/blocks/block.rs:99:27 [INFO] [stdout] | [INFO] [stdout] 99 | spent_map.insert((input.get_tx_id().clone(), input.get_tx_idx())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*input.get_tx_id()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/blocks/block.rs:118:36 [INFO] [stdout] | [INFO] [stdout] 118 | BASE64_STANDARD.encode(&self.hash), [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `self.hash` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/blocks/mining_block.rs:28:23 [INFO] [stdout] | [INFO] [stdout] 28 | hasher.update(&self.version.to_be_bytes()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.version.to_be_bytes()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/blocks/mining_block.rs:29:23 [INFO] [stdout] | [INFO] [stdout] 29 | hasher.update(&self.difficulty.to_be_bytes()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.difficulty.to_be_bytes()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/blocks/mining_block.rs:30:23 [INFO] [stdout] | [INFO] [stdout] 30 | hasher.update(&self.previous_hash); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `self.previous_hash` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/blocks/mining_block.rs:31:23 [INFO] [stdout] | [INFO] [stdout] 31 | hasher.update(&self.merkel_root); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: change this to: `self.merkel_root` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/blocks/mining_block.rs:32:23 [INFO] [stdout] | [INFO] [stdout] 32 | hasher.update(&self.timestamp.to_be_bytes()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.timestamp.to_be_bytes()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/blocks/mining_block.rs:33:23 [INFO] [stdout] | [INFO] [stdout] 33 | hasher.update(&self.nonce.to_be_bytes()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.nonce.to_be_bytes()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/blocks/mining_block.rs:59:13 [INFO] [stdout] | [INFO] [stdout] 59 | / if count_leading_zeros(&self.hash()) >= self.get_difficulty() { [INFO] [stdout] 60 | | if let Some(block) = Block::try_new(&self) { [INFO] [stdout] 61 | | return Some(block); [INFO] [stdout] 62 | | } [INFO] [stdout] 63 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 59 ~ if count_leading_zeros(&self.hash()) >= self.get_difficulty() [INFO] [stdout] 60 ~ && let Some(block) = Block::try_new(&self) { [INFO] [stdout] 61 | return Some(block); [INFO] [stdout] 62 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/blocks/mining_block.rs:60:53 [INFO] [stdout] | [INFO] [stdout] 60 | if let Some(block) = Block::try_new(&self) { [INFO] [stdout] | ^^^^^ help: change this to: `self` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/blocks/mining_block.rs:84:28 [INFO] [stdout] | [INFO] [stdout] 84 | previous_hash: chain.get_previous_hash().clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `chain.get_previous_hash()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/transactions/merkel.rs:17:13 [INFO] [stdout] | [INFO] [stdout] 17 | assert!(transactions.len() != 0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!transactions.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/transactions/merkel.rs:56:28 [INFO] [stdout] | [INFO] [stdout] 56 | self[0] = Some(hash.clone()); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*hash` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/transactions/merkel.rs:76:13 [INFO] [stdout] | [INFO] [stdout] 76 | !(first_index > final_index), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(first_index <= final_index)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `UTXOMap` [INFO] [stdout] --> src/utxo_map.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | / pub fn new() -> Self { [INFO] [stdout] 16 | | Self { [INFO] [stdout] 17 | | utxos: HashMap::new(), [INFO] [stdout] 18 | | } [INFO] [stdout] 19 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 14 + impl Default for UTXOMap { [INFO] [stdout] 15 + fn default() -> Self { [INFO] [stdout] 16 + Self::new() [INFO] [stdout] 17 + } [INFO] [stdout] 18 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/utxo_map.rs:34:39 [INFO] [stdout] | [INFO] [stdout] 34 | let utxo_key = Input::new(tx_id.clone(), tx_output_idx); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try dereferencing it: `*tx_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 18.22s [INFO] running `Command { std: "docker" "inspect" "76ebf9e19ca07981ef9f565ed75aaf55314aa88fab58dd540d0f26405d66c0ff", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "76ebf9e19ca07981ef9f565ed75aaf55314aa88fab58dd540d0f26405d66c0ff", kill_on_drop: false }` [INFO] [stdout] 76ebf9e19ca07981ef9f565ed75aaf55314aa88fab58dd540d0f26405d66c0ff