[INFO] cloning repository https://github.com/varex83/awesome-blockchain-rust [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/varex83/awesome-blockchain-rust" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fvarex83%2Fawesome-blockchain-rust", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fvarex83%2Fawesome-blockchain-rust'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 822bfe829eb5db1caf733824012746a4308868f4 [INFO] linting varex83/awesome-blockchain-rust against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fvarex83%2Fawesome-blockchain-rust" "/workspace/builds/worker-5-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/varex83/awesome-blockchain-rust [INFO] finished tweaking git repo https://github.com/varex83/awesome-blockchain-rust [INFO] tweaked toml for git repo https://github.com/varex83/awesome-blockchain-rust written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/varex83/awesome-blockchain-rust 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/varex83/awesome-blockchain-rust 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] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded ed25519 v1.2.0 [INFO] [stderr] Downloaded zeroize v1.4.2 [INFO] [stderr] Downloaded zeroize_derive v1.2.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] a254708b513fa75405b695b872cd187e0597af39b423d15ca3a827af66b2b6c5 [INFO] running `Command { std: "docker" "start" "-a" "a254708b513fa75405b695b872cd187e0597af39b423d15ca3a827af66b2b6c5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "a254708b513fa75405b695b872cd187e0597af39b423d15ca3a827af66b2b6c5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "a254708b513fa75405b695b872cd187e0597af39b423d15ca3a827af66b2b6c5", kill_on_drop: false }` [INFO] [stdout] a254708b513fa75405b695b872cd187e0597af39b423d15ca3a827af66b2b6c5 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] eac67f051cf68f601b19b4dcdbcfaa83cb4edc5cb0b18cbb739552687a7de49d [INFO] running `Command { std: "docker" "start" "-a" "eac67f051cf68f601b19b4dcdbcfaa83cb4edc5cb0b18cbb739552687a7de49d", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.30 [INFO] [stderr] Compiling num-traits v0.2.14 [INFO] [stderr] Compiling libc v0.2.104 [INFO] [stderr] Compiling syn v1.0.80 [INFO] [stderr] Compiling num-integer v0.1.44 [INFO] [stderr] Compiling num-bigint v0.4.3 [INFO] [stderr] Compiling num-iter v0.1.42 [INFO] [stderr] Compiling num-rational v0.4.0 [INFO] [stderr] Checking ppv-lite86 v0.2.14 [INFO] [stderr] Compiling serde v1.0.130 [INFO] [stderr] Checking signature v1.3.1 [INFO] [stderr] Checking crypto-mac v0.8.0 [INFO] [stderr] Checking sha2 v0.9.8 [INFO] [stderr] Checking ed25519 v1.2.0 [INFO] [stderr] Checking blake2 v0.9.2 [INFO] [stderr] Compiling quote v1.0.10 [INFO] [stderr] Checking getrandom v0.1.16 [INFO] [stderr] Checking num-complex v0.4.0 [INFO] [stderr] Checking rand_core v0.5.1 [INFO] [stderr] Checking rand_chacha v0.2.2 [INFO] [stderr] Checking rand v0.7.3 [INFO] [stderr] Checking num v0.4.0 [INFO] [stderr] Compiling synstructure v0.12.6 [INFO] [stderr] Compiling zeroize_derive v1.2.0 [INFO] [stderr] Checking zeroize v1.4.2 [INFO] [stderr] Checking curve25519-dalek v3.2.0 [INFO] [stderr] Checking ed25519-dalek v1.0.1 [INFO] [stderr] Checking blockchain_workshop v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: field `account_type` is never read [INFO] [stdout] --> src/types/account.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct Account { [INFO] [stdout] | ------- field in this struct [INFO] [stdout] 11 | account_type: AccountType, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Account` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `transaction_pool` is never read [INFO] [stdout] --> src/types/blockchain.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 13 | pub struct Blockchain { [INFO] [stdout] | ---------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 16 | transaction_pool: Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Blockchain` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/types/block.rs:46:44 [INFO] [stdout] | [INFO] [stdout] 46 | matches!(&self.hash, Some(hash) if true [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 47 | | && hash == &self.hash() [INFO] [stdout] 48 | | && _hash < target [INFO] [stdout] | |_________________________________^ help: try: `hash == &self.hash() && _hash < target` [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: this boolean expression can be simplified [INFO] [stdout] --> src/types/block.rs:46:44 [INFO] [stdout] | [INFO] [stdout] 46 | matches!(&self.hash, Some(hash) if true [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 47 | | && hash == &self.hash() [INFO] [stdout] | |_______________________________________^ help: try: `hash == &self.hash()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/types/blockchain.rs:9:28 [INFO] [stdout] | [INFO] [stdout] 9 | const EXPECTED_TIME: i32 = 1000 * 60 * 1; // 1 min [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider reducing it to: `1000 * 60` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/types/blockchain.rs:27:39 [INFO] [stdout] | [INFO] [stdout] 27 | Entry::Occupied(_) => Err(format!("AccountId already exist")), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AccountId already exist".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/types/blockchain.rs:50:9 [INFO] [stdout] | [INFO] [stdout] 47 | / let nbc = Self { [INFO] [stdout] 48 | | ..Default::default() [INFO] [stdout] 49 | | }; [INFO] [stdout] | |__________- unnecessary `let` binding [INFO] [stdout] 50 | nbc [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 47 ~ [INFO] [stdout] 48 ~ Self { [INFO] [stdout] 49 + ..Default::default() [INFO] [stdout] 50 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Blockchain` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/types/blockchain.rs:53:5 [INFO] [stdout] | [INFO] [stdout] 53 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/types/blockchain.rs:63:12 [INFO] [stdout] | [INFO] [stdout] 63 | if block.transactions.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `block.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: manual implementation of `Option::map` [INFO] [stdout] --> src/types/blockchain.rs:181:9 [INFO] [stdout] | [INFO] [stdout] 181 | / match self.blocks.head() { [INFO] [stdout] 182 | | None => None, [INFO] [stdout] 183 | | Some(x) => Some(x.block_number), [INFO] [stdout] 184 | | } [INFO] [stdout] | |_________^ help: try: `self.blocks.head().map(|x| x.block_number)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Chain` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/types/chain.rs:58:5 [INFO] [stdout] | [INFO] [stdout] 58 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/types/transaction.rs:44:12 [INFO] [stdout] | [INFO] [stdout] 44 | if !self.signature.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.signature.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/types/transaction.rs:48:12 [INFO] [stdout] | [INFO] [stdout] 48 | if !self.from.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `self.from.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `account_type` is never read [INFO] [stdout] --> src/types/account.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 10 | pub struct Account { [INFO] [stdout] | ------- field in this struct [INFO] [stdout] 11 | account_type: AccountType, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Account` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `transaction_pool` is never read [INFO] [stdout] --> src/types/blockchain.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 13 | pub struct Blockchain { [INFO] [stdout] | ---------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 16 | transaction_pool: Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Blockchain` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/types/transaction.rs:102:20 [INFO] [stdout] | [INFO] [stdout] 102 | if !from.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `from.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/types/transaction.rs:108:20 [INFO] [stdout] | [INFO] [stdout] 108 | if !state.get_account_by_id_mut(from.clone()).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `state.get_account_by_id_mut(from.clone()).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/types/transaction.rs:111:20 [INFO] [stdout] | [INFO] [stdout] 111 | if !state.get_account_by_id_mut(to.clone()).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `state.get_account_by_id_mut(to.clone()).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/types/block.rs:46:44 [INFO] [stdout] | [INFO] [stdout] 46 | matches!(&self.hash, Some(hash) if true [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 47 | | && hash == &self.hash() [INFO] [stdout] 48 | | && _hash < target [INFO] [stdout] | |_________________________________^ help: try: `hash == &self.hash() && _hash < target` [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: this boolean expression can be simplified [INFO] [stdout] --> src/types/block.rs:46:44 [INFO] [stdout] | [INFO] [stdout] 46 | matches!(&self.hash, Some(hash) if true [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 47 | | && hash == &self.hash() [INFO] [stdout] | |_______________________________________^ help: try: `hash == &self.hash()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u128` -> `u128`) [INFO] [stdout] --> src/types/miner.rs:14:23 [INFO] [stdout] | [INFO] [stdout] 14 | block.timestamp = SystemTime::now() [INFO] [stdout] | _______________________^ [INFO] [stdout] 15 | | .duration_since(UNIX_EPOCH) [INFO] [stdout] 16 | | .expect("Time went backwards") [INFO] [stdout] 17 | | .as_millis() as u128; [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 14 ~ block.timestamp = SystemTime::now() [INFO] [stdout] 15 + .duration_since(UNIX_EPOCH) [INFO] [stdout] 16 + .expect("Time went backwards") [INFO] [stdout] 17 ~ .as_millis(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utils.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 67 | return target_compacted; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 67 - return target_compacted; [INFO] [stdout] 67 + target_compacted [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> src/utils.rs:70:1 [INFO] [stdout] | [INFO] [stdout] 70 | / pub fn create_accounts_and_transfer( [INFO] [stdout] 71 | | bc: &mut Blockchain, [INFO] [stdout] 72 | | account_1: AccountId, [INFO] [stdout] 73 | | account_2: AccountId, [INFO] [stdout] ... | [INFO] [stdout] 79 | | account_2_keypair: &ed25519_dalek::Keypair, [INFO] [stdout] 80 | | ) -> Result<(), Error> { [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` 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/types/block.rs:148:37 [INFO] [stdout] | [INFO] [stdout] 148 | assert!(BigInt::parse_bytes(&block.hash().as_bytes(), 16).unwrap() < target); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `block.hash().as_bytes()` [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: this operation has no effect [INFO] [stdout] --> src/types/blockchain.rs:9:28 [INFO] [stdout] | [INFO] [stdout] 9 | const EXPECTED_TIME: i32 = 1000 * 60 * 1; // 1 min [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider reducing it to: `1000 * 60` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/types/chain.rs:69:17 [INFO] [stdout] | [INFO] [stdout] 69 | pub fn iter(&self) -> ChainIter { [INFO] [stdout] | ^^^^^ ^^^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 69 | pub fn iter(&self) -> ChainIter<'_, T> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/types/chain.rs:75:21 [INFO] [stdout] | [INFO] [stdout] 75 | pub fn iter_mut(&mut self) -> ChainIterMut { [INFO] [stdout] | ^^^^^^^^^ ^^^^^^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 75 | pub fn iter_mut(&mut self) -> ChainIterMut<'_, T> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/types/blockchain.rs:27:39 [INFO] [stdout] | [INFO] [stdout] 27 | Entry::Occupied(_) => Err(format!("AccountId already exist")), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"AccountId already exist".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/types/blockchain.rs:50:9 [INFO] [stdout] | [INFO] [stdout] 47 | / let nbc = Self { [INFO] [stdout] 48 | | ..Default::default() [INFO] [stdout] 49 | | }; [INFO] [stdout] | |__________- unnecessary `let` binding [INFO] [stdout] 50 | nbc [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 47 ~ [INFO] [stdout] 48 ~ Self { [INFO] [stdout] 49 + ..Default::default() [INFO] [stdout] 50 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Blockchain` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/types/blockchain.rs:53:5 [INFO] [stdout] | [INFO] [stdout] 53 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/types/blockchain.rs:63:12 [INFO] [stdout] | [INFO] [stdout] 63 | if block.transactions.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `block.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: manual implementation of `Option::map` [INFO] [stdout] --> src/types/blockchain.rs:181:9 [INFO] [stdout] | [INFO] [stdout] 181 | / match self.blocks.head() { [INFO] [stdout] 182 | | None => None, [INFO] [stdout] 183 | | Some(x) => Some(x.block_number), [INFO] [stdout] 184 | | } [INFO] [stdout] | |_________^ help: try: `self.blocks.head().map(|x| x.block_number)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/types/blockchain.rs:537:18 [INFO] [stdout] | [INFO] [stdout] 537 | dbg!(&prev_time - &block.timestamp); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 537 - dbg!(&prev_time - &block.timestamp); [INFO] [stdout] 537 + dbg!(prev_time - block.timestamp); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Chain` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/types/chain.rs:58:5 [INFO] [stdout] | [INFO] [stdout] 58 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/types/transaction.rs:44:12 [INFO] [stdout] | [INFO] [stdout] 44 | if !self.signature.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self.signature.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/types/transaction.rs:48:12 [INFO] [stdout] | [INFO] [stdout] 48 | if !self.from.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `self.from.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/types/transaction.rs:102:20 [INFO] [stdout] | [INFO] [stdout] 102 | if !from.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `from.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/types/transaction.rs:108:20 [INFO] [stdout] | [INFO] [stdout] 108 | if !state.get_account_by_id_mut(from.clone()).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `state.get_account_by_id_mut(from.clone()).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/types/transaction.rs:111:20 [INFO] [stdout] | [INFO] [stdout] 111 | if !state.get_account_by_id_mut(to.clone()).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `state.get_account_by_id_mut(to.clone()).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u128` -> `u128`) [INFO] [stdout] --> src/types/miner.rs:14:23 [INFO] [stdout] | [INFO] [stdout] 14 | block.timestamp = SystemTime::now() [INFO] [stdout] | _______________________^ [INFO] [stdout] 15 | | .duration_since(UNIX_EPOCH) [INFO] [stdout] 16 | | .expect("Time went backwards") [INFO] [stdout] 17 | | .as_millis() as u128; [INFO] [stdout] | |____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 14 ~ block.timestamp = SystemTime::now() [INFO] [stdout] 15 + .duration_since(UNIX_EPOCH) [INFO] [stdout] 16 + .expect("Time went backwards") [INFO] [stdout] 17 ~ .as_millis(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utils.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 67 | return target_compacted; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 67 - return target_compacted; [INFO] [stdout] 67 + target_compacted [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> src/utils.rs:70:1 [INFO] [stdout] | [INFO] [stdout] 70 | / pub fn create_accounts_and_transfer( [INFO] [stdout] 71 | | bc: &mut Blockchain, [INFO] [stdout] 72 | | account_1: AccountId, [INFO] [stdout] 73 | | account_2: AccountId, [INFO] [stdout] ... | [INFO] [stdout] 79 | | account_2_keypair: &ed25519_dalek::Keypair, [INFO] [stdout] 80 | | ) -> Result<(), Error> { [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/types/chain.rs:69:17 [INFO] [stdout] | [INFO] [stdout] 69 | pub fn iter(&self) -> ChainIter { [INFO] [stdout] | ^^^^^ ^^^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 69 | pub fn iter(&self) -> ChainIter<'_, T> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's elided elsewhere is confusing [INFO] [stdout] --> src/types/chain.rs:75:21 [INFO] [stdout] | [INFO] [stdout] 75 | pub fn iter_mut(&mut self) -> ChainIterMut { [INFO] [stdout] | ^^^^^^^^^ ^^^^^^^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is elided here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] help: use `'_` for type paths [INFO] [stdout] | [INFO] [stdout] 75 | pub fn iter_mut(&mut self) -> ChainIterMut<'_, T> { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 8.66s [INFO] running `Command { std: "docker" "inspect" "eac67f051cf68f601b19b4dcdbcfaa83cb4edc5cb0b18cbb739552687a7de49d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "eac67f051cf68f601b19b4dcdbcfaa83cb4edc5cb0b18cbb739552687a7de49d", kill_on_drop: false }` [INFO] [stdout] eac67f051cf68f601b19b4dcdbcfaa83cb4edc5cb0b18cbb739552687a7de49d