[INFO] cloning repository https://github.com/CPChain/cpchain-rust-sdk [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/CPChain/cpchain-rust-sdk" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FCPChain%2Fcpchain-rust-sdk", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FCPChain%2Fcpchain-rust-sdk'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] df78ab5b8d7004951a7b2643cbfaf3bbb6d4b472 [INFO] linting CPChain/cpchain-rust-sdk against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FCPChain%2Fcpchain-rust-sdk" "/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/CPChain/cpchain-rust-sdk [INFO] finished tweaking git repo https://github.com/CPChain/cpchain-rust-sdk [INFO] tweaked toml for git repo https://github.com/CPChain/cpchain-rust-sdk written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/CPChain/cpchain-rust-sdk 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/CPChain/cpchain-rust-sdk 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] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded keccak v0.1.2 [INFO] [stderr] Downloaded parity-scale-codec-derive v3.6.4 [INFO] [stderr] Downloaded web3-async-native-tls v0.4.0 [INFO] [stderr] Downloaded pbkdf2 v0.3.0 [INFO] [stderr] Downloaded once_cell v0.1.8 [INFO] [stderr] Downloaded ethabi v16.0.0 [INFO] [stderr] Downloaded hashbrown v0.1.8 [INFO] [stderr] Downloaded serde_derive v1.0.150 [INFO] [stderr] Downloaded uint v0.9.4 [INFO] [stderr] Downloaded web3 v0.18.0 [INFO] [stderr] Downloaded uuid-macro-internal v1.2.2 [INFO] [stderr] Downloaded rayon v1.6.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] aafcf5d8cd7c5faf5934dddce01fc3c234e318920d2a5ad3dfa0b634c701035a [INFO] running `Command { std: "docker" "start" "-a" "aafcf5d8cd7c5faf5934dddce01fc3c234e318920d2a5ad3dfa0b634c701035a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "aafcf5d8cd7c5faf5934dddce01fc3c234e318920d2a5ad3dfa0b634c701035a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "aafcf5d8cd7c5faf5934dddce01fc3c234e318920d2a5ad3dfa0b634c701035a", kill_on_drop: false }` [INFO] [stdout] aafcf5d8cd7c5faf5934dddce01fc3c234e318920d2a5ad3dfa0b634c701035a [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] a3de97e3837932598e63ebc8c243bc4ec1086cd0878c74a1c6d07eabf695385d [INFO] running `Command { std: "docker" "start" "-a" "a3de97e3837932598e63ebc8c243bc4ec1086cd0878c74a1c6d07eabf695385d", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.66 [INFO] [stderr] Compiling syn v1.0.105 [INFO] [stderr] Checking bytes v1.2.1 [INFO] [stderr] Compiling serde_derive v1.0.150 [INFO] [stderr] Compiling serde v1.0.150 [INFO] [stderr] Compiling futures-core v0.3.25 [INFO] [stderr] Compiling autocfg v0.1.8 [INFO] [stderr] Compiling once_cell v1.15.0 [INFO] [stderr] Checking generic-array v0.14.6 [INFO] [stderr] Checking getrandom v0.2.8 [INFO] [stderr] Checking num_cpus v1.13.1 [INFO] [stderr] Checking subtle v2.4.1 [INFO] [stderr] Checking parking_lot_core v0.9.4 [INFO] [stderr] Compiling futures-channel v0.3.25 [INFO] [stderr] Compiling futures-task v0.3.25 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Compiling openssl-sys v0.9.77 [INFO] [stderr] Checking mio v0.8.5 [INFO] [stderr] Checking socket2 v0.4.7 [INFO] [stderr] Checking signal-hook-registry v1.4.0 [INFO] [stderr] Checking rand_core v0.3.1 [INFO] [stderr] Checking parking_lot v0.12.1 [INFO] [stderr] Checking futures-io v0.3.25 [INFO] [stderr] Compiling futures-util v0.3.25 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking byte-slice-cast v1.2.1 [INFO] [stderr] Compiling rand_chacha v0.1.1 [INFO] [stderr] Compiling rand_pcg v0.1.2 [INFO] [stderr] Checking http v0.2.8 [INFO] [stderr] Compiling rand v0.6.5 [INFO] [stderr] Compiling openssl v0.10.42 [INFO] [stderr] Checking rand_hc v0.1.0 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking crypto-common v0.1.6 [INFO] [stderr] Checking block-buffer v0.10.3 [INFO] [stderr] Checking rand_isaac v0.1.1 [INFO] [stderr] Checking rand_xorshift v0.1.1 [INFO] [stderr] Checking tracing-core v0.1.30 [INFO] [stderr] Checking generic-array v0.12.4 [INFO] [stderr] Checking rand_os v0.1.3 [INFO] [stderr] Checking rand_jitter v0.1.4 [INFO] [stderr] Checking digest v0.10.5 [INFO] [stderr] Compiling native-tls v0.2.10 [INFO] [stderr] Checking rlp v0.5.2 [INFO] [stderr] Compiling tiny-keccak v2.0.2 [INFO] [stderr] Compiling serde_json v1.0.89 [INFO] [stderr] Compiling quote v1.0.32 [INFO] [stderr] Checking block-buffer v0.9.0 [INFO] [stderr] Checking fixed-hash v0.7.0 [INFO] [stderr] Checking uint v0.9.4 [INFO] [stderr] Compiling parking_lot_core v0.4.0 [INFO] [stderr] Checking digest v0.9.0 [INFO] [stderr] Checking inout v0.1.3 [INFO] [stderr] Checking scopeguard v0.3.3 [INFO] [stderr] Checking idna v0.3.0 [INFO] [stderr] Checking cipher v0.4.3 [INFO] [stderr] Checking impl-rlp v0.3.0 [INFO] [stderr] Compiling secp256k1-sys v0.4.2 [INFO] [stderr] Compiling backtrace v0.3.66 [INFO] [stderr] Checking tracing v0.1.37 [INFO] [stderr] Compiling num-traits v0.2.15 [INFO] [stderr] Checking gimli v0.26.2 [INFO] [stderr] Checking byte-tools v0.3.1 [INFO] [stderr] Checking subtle v1.0.0 [INFO] [stderr] Checking http-body v0.4.5 [INFO] [stderr] Checking miniz_oxide v0.5.4 [INFO] [stderr] Checking block-padding v0.1.5 [INFO] [stderr] Checking crypto-mac v0.7.0 [INFO] [stderr] Checking lock_api v0.1.5 [INFO] [stderr] Checking rayon-core v1.10.1 [INFO] [stderr] Checking digest v0.8.1 [INFO] [stderr] Checking object v0.29.0 [INFO] [stderr] Checking base64ct v1.5.3 [INFO] [stderr] Checking keccak v0.1.2 [INFO] [stderr] Checking either v1.8.0 [INFO] [stderr] Checking block-buffer v0.7.3 [INFO] [stderr] Checking url v2.3.1 [INFO] [stderr] Checking headers-core v0.2.0 [INFO] [stderr] Checking sha3 v0.9.1 [INFO] [stderr] Checking hmac v0.12.1 [INFO] [stderr] Checking sha2 v0.10.6 [INFO] [stderr] Checking sha1 v0.10.5 [INFO] [stderr] Checking sha-1 v0.9.8 [INFO] [stderr] Checking ff v0.12.1 [INFO] [stderr] Compiling num-bigint v0.4.3 [INFO] [stderr] Checking const-oid v0.9.1 [INFO] [stderr] Checking password-hash v0.4.2 [INFO] [stderr] Checking rayon v1.6.0 [INFO] [stderr] Checking fake-simd v0.1.2 [INFO] [stderr] Checking zeroize v1.5.7 [INFO] [stderr] Checking opaque-debug v0.2.3 [INFO] [stderr] Checking headers v0.3.8 [INFO] [stderr] Checking idna v0.2.3 [INFO] [stderr] Checking group v0.12.1 [INFO] [stderr] Checking sha2 v0.8.2 [INFO] [stderr] Checking der v0.6.1 [INFO] [stderr] Checking pbkdf2 v0.11.0 [INFO] [stderr] Checking crypto-bigint v0.4.9 [INFO] [stderr] Checking hmac v0.7.1 [INFO] [stderr] Checking salsa20 v0.10.2 [INFO] [stderr] Checking hashbrown v0.1.8 [INFO] [stderr] Checking fixed-hash v0.8.0 [INFO] [stderr] Checking aho-corasick v0.7.20 [INFO] [stderr] Checking base16ct v0.1.1 [INFO] [stderr] Checking regex-syntax v0.6.28 [INFO] [stderr] Checking futures-timer v3.0.2 [INFO] [stderr] Checking scrypt v0.10.0 [INFO] [stderr] Checking aes v0.8.2 [INFO] [stderr] Checking parking_lot v0.7.1 [INFO] [stderr] Checking ctr v0.9.2 [INFO] [stderr] Compiling hex-literal v0.3.4 [INFO] [stderr] Checking once_cell v0.1.8 [INFO] [stderr] Checking elliptic-curve v0.12.3 [INFO] [stderr] Checking num-integer v0.1.45 [INFO] [stderr] Checking secp256k1 v0.21.3 [INFO] [stderr] Checking addr2line v0.17.0 [INFO] [stderr] Compiling toml v0.5.9 [INFO] [stderr] Checking regex v1.7.0 [INFO] [stderr] Checking pbkdf2 v0.3.0 [INFO] [stderr] Compiling synstructure v0.12.6 [INFO] [stderr] Compiling thiserror-impl v1.0.37 [INFO] [stderr] Compiling tokio-macros v1.8.0 [INFO] [stderr] Compiling futures-macro v0.3.25 [INFO] [stderr] Compiling impl-trait-for-tuples v0.2.2 [INFO] [stderr] Compiling openssl-macros v0.1.0 [INFO] [stderr] Compiling derive_more v0.99.17 [INFO] [stderr] Compiling failure_derive v0.1.8 [INFO] [stderr] Compiling pin-project-internal v1.0.12 [INFO] [stderr] Compiling uuid-macro-internal v1.2.2 [INFO] [stderr] Checking uuid v1.2.2 [INFO] [stderr] Checking failure v0.1.8 [INFO] [stderr] Checking tokio v1.23.0 [INFO] [stderr] Checking cpc-bip39 v0.1.0 (/opt/rustwide/workdir/bip39) [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> bip39/src/error.rs:3:17 [INFO] [stdout] | [INFO] [stdout] 3 | #[derive(Debug, Fail)] [INFO] [stdout] | ^--- [INFO] [stdout] | | [INFO] [stdout] | `Fail` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_DERIVE_failure_Fail_FOR_ErrorKind` [INFO] [stdout] 4 | pub enum ErrorKind { [INFO] [stdout] | --------- `ErrorKind` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Fail` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Fail` may come from an old version of the `failure_derive` crate, try updating your dependency with `cargo update -p failure_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: `#[warn(non_local_definitions)]` on by default [INFO] [stdout] = note: this warning originates in the derive macro `Fail` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-local `impl` definition, `impl` blocks should be written at the same level as their item [INFO] [stdout] --> bip39/src/error.rs:3:17 [INFO] [stdout] | [INFO] [stdout] 3 | #[derive(Debug, Fail)] [INFO] [stdout] | ^--- [INFO] [stdout] | | [INFO] [stdout] | `Display` is not local [INFO] [stdout] | move the `impl` block outside of this constant `_DERIVE_failure_core_fmt_Display_FOR_ErrorKind` [INFO] [stdout] 4 | pub enum ErrorKind { [INFO] [stdout] | --------- `ErrorKind` is not local [INFO] [stdout] | [INFO] [stdout] = note: the derive macro `Fail` defines the non-local `impl`, and may need to be changed [INFO] [stdout] = note: the derive macro `Fail` may come from an old version of the `failure_derive` crate, try updating your dependency with `cargo update -p failure_derive` [INFO] [stdout] = note: an `impl` is never scoped, even when it is nested inside an item, as it may impact type checking outside of that item, which can be the case if neither the trait or the self type are at the same nesting level as the `impl` [INFO] [stdout] = note: items in an anonymous const item (`const _: () = { ... }`) are treated as in the same scope as the anonymous const's declaration for the purpose of this lint [INFO] [stdout] = note: this warning originates in the derive macro `Fail` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Compiling thiserror v1.0.37 [INFO] [stderr] Compiling proc-macro-crate v1.2.1 [INFO] [stderr] Checking pin-project v1.0.12 [INFO] [stderr] Compiling parity-scale-codec-derive v2.3.1 [INFO] [stderr] Compiling parity-scale-codec-derive v3.6.4 [INFO] [stderr] Compiling scale-info-derive v2.9.0 [INFO] [stderr] Checking futures-executor v0.3.25 [INFO] [stderr] Checking futures v0.3.25 [INFO] [stderr] Checking soketto v0.7.1 [INFO] [stderr] Checking tokio-util v0.7.4 [INFO] [stderr] Checking tokio-native-tls v0.3.0 [INFO] [stderr] Checking tokio-stream v0.1.11 [INFO] [stderr] Checking tokio-util v0.6.10 [INFO] [stderr] Checking web3-async-native-tls v0.4.0 [INFO] [stderr] Checking h2 v0.3.15 [INFO] [stderr] Checking impl-serde v0.3.2 [INFO] [stderr] Checking parity-scale-codec v2.3.1 [INFO] [stderr] Checking parity-scale-codec v3.5.0 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking impl-serde v0.4.0 [INFO] [stderr] Checking ethbloom v0.11.1 [INFO] [stderr] Checking impl-codec v0.5.1 [INFO] [stderr] Checking primitive-types v0.10.1 [INFO] [stderr] Checking jsonrpc-core v18.0.0 [INFO] [stderr] Checking impl-codec v0.6.0 [INFO] [stderr] Checking scale-info v2.9.0 [INFO] [stderr] Checking primitive-types v0.12.1 [INFO] [stderr] Checking hyper v0.14.20 [INFO] [stderr] Checking ethereum-types v0.12.1 [INFO] [stderr] Checking ethabi v16.0.0 [INFO] [stderr] Checking hyper-tls v0.5.0 [INFO] [stderr] Checking reqwest v0.11.13 [INFO] [stderr] Checking web3 v0.18.0 [INFO] [stderr] Checking cpchain-rust-sdk v0.1.20 (/opt/rustwide/workdir) [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/transport.rs:4:1 [INFO] [stdout] | [INFO] [stdout] 4 | use log; [INFO] [stdout] | ^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] = note: `#[warn(clippy::single_component_path_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `wasm` [INFO] [stdout] --> src/transport.rs:35:19 [INFO] [stdout] | [INFO] [stdout] 35 | #[cfg(not(feature = "wasm"))] [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: remove the condition [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = help: consider adding `wasm` as a feature in `Cargo.toml` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: `#[warn(unexpected_cfgs)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: digits grouped inconsistently by underscores [INFO] [stdout] --> src/contract/mod.rs:224:28 [INFO] [stdout] | [INFO] [stdout] 224 | opt.gas = Some(3000_000.into()); [INFO] [stdout] | ^^^^^^^^ help: consider: `3_000_000` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inconsistent_digit_grouping [INFO] [stdout] = note: `#[warn(clippy::inconsistent_digit_grouping)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using tabs in doc comments is not recommended [INFO] [stdout] --> src/cpc_aes/mod.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | /// "3357121ebb5a29468bd861467596ce3da59bdee42dcc0614dea955368d8a5dc0cad4" [INFO] [stdout] | ^^^^ help: consider using four spaces per tab [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#tabs_in_doc_comments [INFO] [stdout] = note: `#[warn(clippy::tabs_in_doc_comments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/transport.rs:4:1 [INFO] [stdout] | [INFO] [stdout] 4 | use log; [INFO] [stdout] | ^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] = note: `#[warn(clippy::single_component_path_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unexpected `cfg` condition value: `wasm` [INFO] [stdout] --> src/transport.rs:35:19 [INFO] [stdout] | [INFO] [stdout] 35 | #[cfg(not(feature = "wasm"))] [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: remove the condition [INFO] [stdout] | [INFO] [stdout] = note: no expected values for `feature` [INFO] [stdout] = help: consider adding `wasm` as a feature in `Cargo.toml` [INFO] [stdout] = note: see for more information about checking conditional configuration [INFO] [stdout] = note: `#[warn(unexpected_cfgs)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/keystore/kdf.rs:94:17 [INFO] [stdout] | [INFO] [stdout] 94 | dklen: dklen, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `dklen` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/keystore/crypto_info.rs:191:24 [INFO] [stdout] | [INFO] [stdout] 191 | const FIELDS: &'static [&'static str] = &[ [INFO] [stdout] | -^^^^^^^--------------- help: consider removing `'static`: `&[&'static str]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/keystore/crypto_info.rs:191:34 [INFO] [stdout] | [INFO] [stdout] 191 | const FIELDS: &'static [&'static str] = &[ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/keystore/my_scrypt.rs:5:1 [INFO] [stdout] | [INFO] [stdout] 5 | / /// TODO 搞清楚为什么 Go 实现的 Scrypt 比 Rust 的快这么多 [INFO] [stdout] 6 | | [INFO] [stdout] | |_^ [INFO] [stdout] 7 | fn as_u32_le(array: &[u8]) -> u32 { [INFO] [stdout] | ------------ the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using tabs in doc comments is not recommended [INFO] [stdout] --> src/cpc_aes/mod.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | /// "3357121ebb5a29468bd861467596ce3da59bdee42dcc0614dea955368d8a5dc0cad4" [INFO] [stdout] | ^^^^ help: consider using four spaces per tab [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#tabs_in_doc_comments [INFO] [stdout] = note: `#[warn(clippy::tabs_in_doc_comments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/keystore/mod.rs:86:17 [INFO] [stdout] | [INFO] [stdout] 86 | kdf: kdf, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `kdf` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/keystore/kdf.rs:94:17 [INFO] [stdout] | [INFO] [stdout] 94 | dklen: dklen, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `dklen` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/keystore/crypto_info.rs:191:24 [INFO] [stdout] | [INFO] [stdout] 191 | const FIELDS: &'static [&'static str] = &[ [INFO] [stdout] | -^^^^^^^--------------- help: consider removing `'static`: `&[&'static str]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/keystore/crypto_info.rs:191:34 [INFO] [stdout] | [INFO] [stdout] 191 | const FIELDS: &'static [&'static str] = &[ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/keystore/my_scrypt.rs:5:1 [INFO] [stdout] | [INFO] [stdout] 5 | / /// TODO 搞清楚为什么 Go 实现的 Scrypt 比 Rust 的快这么多 [INFO] [stdout] 6 | | [INFO] [stdout] | |_^ [INFO] [stdout] 7 | fn as_u32_le(array: &[u8]) -> u32 { [INFO] [stdout] | ------------ the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/keystore/mod.rs:86:17 [INFO] [stdout] | [INFO] [stdout] 86 | kdf: kdf, [INFO] [stdout] | ^^^^^^^^ help: replace it with: `kdf` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/cpc_web3.rs:62:9 [INFO] [stdout] | [INFO] [stdout] 62 | Ok(self.web3.eth().gas_price().await?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 62 - Ok(self.web3.eth().gas_price().await?) [INFO] [stdout] 62 + self.web3.eth().gas_price().await [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `receipt` after checking its variant with `is_some` [INFO] [stdout] --> src/cpc_web3.rs:85:27 [INFO] [stdout] | [INFO] [stdout] 84 | if receipt.is_some() { [INFO] [stdout] | -------------------- help: try: `if let Some() = receipt` [INFO] [stdout] 85 | return Ok(receipt.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/cpc_web3.rs:109:12 [INFO] [stdout] | [INFO] [stdout] 109 | Ok(code.0.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!code.0.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 `if` statement can be collapsed [INFO] [stdout] --> src/transport.rs:119:5 [INFO] [stdout] | [INFO] [stdout] 119 | / if url_1.contains("eth_getBlock") { [INFO] [stdout] 120 | | if response.len() > 2 && response.to_vec()[response.len() - 3] == b'}' { [INFO] [stdout] 121 | | response.pop(); [INFO] [stdout] 122 | | response.pop(); [INFO] [stdout] ... | [INFO] [stdout] 134 | | } [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] 119 ~ if url_1.contains("eth_getBlock") [INFO] [stdout] 120 ~ && response.len() > 2 && response.to_vec()[response.len() - 3] == b'}' { [INFO] [stdout] 121 | response.pop(); [INFO] [stdout] ... [INFO] [stdout] 132 | response.append(&mut uncles.to_vec()); [INFO] [stdout] 133 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str` [INFO] [stdout] --> src/address.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | / pub fn from_str(s: &str) -> Result> { [INFO] [stdout] 18 | | let data = utils::hex_to_bytes(s)?; [INFO] [stdout] 19 | | Ok(Self { [INFO] [stdout] 20 | | h160: H160::from_slice(data.as_slice()), [INFO] [stdout] 21 | | }) [INFO] [stdout] 22 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils.rs:20:30 [INFO] [stdout] | [INFO] [stdout] 20 | let hashed = hex::encode(&hashed); [INFO] [stdout] | ^^^^^^^ help: change this to: `hashed` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/utils.rs:24:12 [INFO] [stdout] | [INFO] [stdout] 24 | if ch >= '0' && ch <= '9' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('0'..='9').contains(&ch)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/utils.rs:26:19 [INFO] [stdout] | [INFO] [stdout] 26 | } else if ch >= 'a' && ch <= 'f' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('a'..='f').contains(&ch)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/contract/deployer.rs:135:51 [INFO] [stdout] | [INFO] [stdout] 135 | let signed_tx = web3.sign_transaction(&from, &tx).await.unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `from` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/contract/event.rs:54:45 [INFO] [stdout] | [INFO] [stdout] 54 | fn take_index<'a>(index: &usize, bytes: &'a Vec) -> &'a [u8] { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 54 - fn take_index<'a>(index: &usize, bytes: &'a Vec) -> &'a [u8] { [INFO] [stdout] 54 + fn take_index<'a>(index: &usize, bytes: &'a [u8]) -> &'a [u8] { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/contract/event.rs:59:20 [INFO] [stdout] | [INFO] [stdout] 59 | fn take_index2<'a>(begin: usize, bytes: &'a Vec) -> &'a [u8] { [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] 59 - fn take_index2<'a>(begin: usize, bytes: &'a Vec) -> &'a [u8] { [INFO] [stdout] 59 + fn take_index2(begin: usize, bytes: &Vec) -> &[u8] { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/contract/event.rs:59:45 [INFO] [stdout] | [INFO] [stdout] 59 | fn take_index2<'a>(begin: usize, bytes: &'a Vec) -> &'a [u8] { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 59 - fn take_index2<'a>(begin: usize, bytes: &'a Vec) -> &'a [u8] { [INFO] [stdout] 59 + fn take_index2<'a>(begin: usize, bytes: &'a [u8]) -> &'a [u8] { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/contract/event.rs:155:25 [INFO] [stdout] | [INFO] [stdout] 155 | return Ok(EventParam::Array(results)) [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] 155 ~ Ok(EventParam::Array(results)) [INFO] [stdout] 156 | }, [INFO] [stdout] ... [INFO] [stdout] 169 | } [INFO] [stdout] 170 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/contract/event.rs:165:25 [INFO] [stdout] | [INFO] [stdout] 165 | return Ok(EventParam::Array(results)); [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 165 ~ Ok(EventParam::Array(results)) [INFO] [stdout] 166 | }, [INFO] [stdout] ... [INFO] [stdout] 169 | } [INFO] [stdout] 170 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/contract/event.rs:168:25 [INFO] [stdout] | [INFO] [stdout] 168 | return Err(format!("Unsupported event parameter's kind: {:?} of an event array", param).into()) [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 168 ~ Err(format!("Unsupported event parameter's kind: {:?} of an event array", param).into()) [INFO] [stdout] 169 | } [INFO] [stdout] 170 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/contract/event.rs:132:57 [INFO] [stdout] | [INFO] [stdout] 132 | ... let b1 = begin.as_usize() + (32 * ( 1)) + b1.as_usize(); [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `32` [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: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/contract/event.rs:136:49 [INFO] [stdout] | [INFO] [stdout] 136 | ... for j in 0..size.clone() { [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*size` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/contract/event.rs:227:51 [INFO] [stdout] | [INFO] [stdout] 227 | pub fn from_logs(event: ðabi::Event, logs: &Vec) -> Result, StdError> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 227 - pub fn from_logs(event: ðabi::Event, logs: &Vec) -> Result, StdError> { [INFO] [stdout] 227 + pub fn from_logs(event: ðabi::Event, logs: &[Log]) -> Result, StdError> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/contract/event.rs:231:44 [INFO] [stdout] | [INFO] [stdout] 231 | events.push(Event::from(event, &log)?); [INFO] [stdout] | ^^^^ help: change this to: `log` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/contract/mod.rs:142:47 [INFO] [stdout] | [INFO] [stdout] 142 | let signed_tx = web3.sign_transaction(&account, &tx).await?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `account` [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: called `unwrap` on `from_block` after checking its variant with `is_some` [INFO] [stdout] --> src/contract/mod.rs:161:42 [INFO] [stdout] | [INFO] [stdout] 160 | if from_block.is_some() { [INFO] [stdout] | ----------------------- help: try: `if let Some() = from_block` [INFO] [stdout] 161 | builder = builder.from_block(from_block.unwrap().into()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `to_block` after checking its variant with `is_some` [INFO] [stdout] --> src/contract/mod.rs:164:40 [INFO] [stdout] | [INFO] [stdout] 163 | if to_block.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = to_block` [INFO] [stdout] 164 | builder = builder.to_block(to_block.unwrap().into()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/contract/mod.rs:177:9 [INFO] [stdout] | [INFO] [stdout] 177 | Ok(Event::from_logs(e, &logs)?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 177 - Ok(Event::from_logs(e, &logs)?) [INFO] [stdout] 177 + Event::from_logs(e, &logs) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/contract/mod.rs:183:24 [INFO] [stdout] | [INFO] [stdout] 183 | Event::from(e, &log) [INFO] [stdout] | ^^^^ help: change this to: `log` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/cpc_aes/ecb.rs:9:40 [INFO] [stdout] | [INFO] [stdout] 9 | pub fn encrypt_ebc(key: [u8;32], data: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 9 - pub fn encrypt_ebc(key: [u8;32], data: &Vec) -> Vec { [INFO] [stdout] 9 + pub fn encrypt_ebc(key: [u8;32], data: &[u8]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/cpc_aes/ecb.rs:35:41 [INFO] [stdout] | [INFO] [stdout] 35 | pub fn decrypt_ebc(key: [u8; 32], data: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 35 - pub fn decrypt_ebc(key: [u8; 32], data: &Vec) -> Vec { [INFO] [stdout] 35 + pub fn decrypt_ebc(key: [u8; 32], data: &[u8]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/cpc_web3.rs:62:9 [INFO] [stdout] | [INFO] [stdout] 62 | Ok(self.web3.eth().gas_price().await?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] = note: `#[warn(clippy::needless_question_mark)]` on by default [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 62 - Ok(self.web3.eth().gas_price().await?) [INFO] [stdout] 62 + self.web3.eth().gas_price().await [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/cpc_aes/ecb.rs:55:10 [INFO] [stdout] | [INFO] [stdout] 55 | while r.len() > 0 && r[r.len() - 1] == 0 { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!r.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: called `unwrap` on `receipt` after checking its variant with `is_some` [INFO] [stdout] --> src/cpc_web3.rs:85:27 [INFO] [stdout] | [INFO] [stdout] 84 | if receipt.is_some() { [INFO] [stdout] | -------------------- help: try: `if let Some() = receipt` [INFO] [stdout] 85 | return Ok(receipt.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` 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/cpc_aes/mod.rs:38:26 [INFO] [stdout] | [INFO] [stdout] 38 | Ok(encrypt_ebc(key, &data)) [INFO] [stdout] | ^^^^^ help: change this to: `data` [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/cpc_web3.rs:109:12 [INFO] [stdout] | [INFO] [stdout] 109 | Ok(code.0.len() > 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!code.0.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: length comparison to zero [INFO] [stdout] --> src/cpc_web3.rs:134:17 [INFO] [stdout] | [INFO] [stdout] 134 | assert!(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] [INFO] [stdout] [INFO] [stdout] warning: name `KDF` contains a capitalized acronym [INFO] [stdout] --> src/keystore/kdf.rs:32:10 [INFO] [stdout] | [INFO] [stdout] 32 | pub enum KDF { [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Kdf` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `SCRYPT` contains a capitalized acronym [INFO] [stdout] --> src/keystore/kdf.rs:38:5 [INFO] [stdout] | [INFO] [stdout] 38 | SCRYPT(Option), [INFO] [stdout] | ^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Scrypt` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/keystore/kdf.rs:44:60 [INFO] [stdout] | [INFO] [stdout] 44 | KDF::PBKDF2(params) => Ok(serde_json::to_value(¶ms)?), [INFO] [stdout] | ^^^^^^^ help: change this to: `params` [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/keystore/kdf.rs:45:60 [INFO] [stdout] | [INFO] [stdout] 45 | KDF::SCRYPT(params) => Ok(serde_json::to_value(¶ms)?), [INFO] [stdout] | ^^^^^^^ help: change this to: `params` [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/keystore/kdf.rs:96:35 [INFO] [stdout] | [INFO] [stdout] 96 | salt: hex::encode(&rand_salt()), [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `rand_salt()` [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: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/cpc_web3.rs:246:9 [INFO] [stdout] | [INFO] [stdout] 246 | / assert_eq!( [INFO] [stdout] 247 | | web3.is_contract( [INFO] [stdout] 248 | | Address::from_str("0xcf3174cd4dc7c4834d8932f7c3800ab98afc437a") [INFO] [stdout] 249 | | .unwrap() [INFO] [stdout] ... | [INFO] [stdout] 254 | | true [INFO] [stdout] 255 | | ); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 246 ~ assert!( [INFO] [stdout] 247 | web3.is_contract( [INFO] [stdout] ... [INFO] [stdout] 252 | .await [INFO] [stdout] 253 ~ .unwrap() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/keystore/kdf.rs:126:35 [INFO] [stdout] | [INFO] [stdout] 126 | salt: hex::encode(&rand_salt()), [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `rand_salt()` [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: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/cpc_web3.rs:256:9 [INFO] [stdout] | [INFO] [stdout] 256 | / assert_eq!( [INFO] [stdout] 257 | | web3.is_contract( [INFO] [stdout] 258 | | Address::from_str("0x1455D180E3adE94ebD9cC324D22a9065d1F5F575") [INFO] [stdout] 259 | | .unwrap() [INFO] [stdout] ... | [INFO] [stdout] 264 | | false [INFO] [stdout] 265 | | ); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 256 ~ assert!( [INFO] [stdout] 257 ~ !web3.is_contract( [INFO] [stdout] 258 | Address::from_str("0x1455D180E3adE94ebD9cC324D22a9065d1F5F575") [INFO] [stdout] ... [INFO] [stdout] 262 | .await [INFO] [stdout] 263 ~ .unwrap() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `KDF` contains a capitalized acronym [INFO] [stdout] --> src/keystore/crypto_info.rs:68:13 [INFO] [stdout] | [INFO] [stdout] 68 | KDF, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Kdf` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/keystore/crypto_info.rs:97:70 [INFO] [stdout] | [INFO] [stdout] 97 | ... _ => Err(de::Error::unknown_field(value, &FIELDS)), [INFO] [stdout] | ^^^^^^^ help: change this to: `FIELDS` [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: this `if` statement can be collapsed [INFO] [stdout] --> src/transport.rs:119:5 [INFO] [stdout] | [INFO] [stdout] 119 | / if url_1.contains("eth_getBlock") { [INFO] [stdout] 120 | | if response.len() > 2 && response.to_vec()[response.len() - 3] == b'}' { [INFO] [stdout] 121 | | response.pop(); [INFO] [stdout] 122 | | response.pop(); [INFO] [stdout] ... | [INFO] [stdout] 134 | | } [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] 119 ~ if url_1.contains("eth_getBlock") [INFO] [stdout] 120 ~ && response.len() > 2 && response.to_vec()[response.len() - 3] == b'}' { [INFO] [stdout] 121 | response.pop(); [INFO] [stdout] ... [INFO] [stdout] 132 | response.append(&mut uncles.to_vec()); [INFO] [stdout] 133 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/keystore/my_scrypt.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | ((array[0] as u32) << 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `((array[0] as u32))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/keystore/my_scrypt.rs:35:21 [INFO] [stdout] | [INFO] [stdout] 35 | let start = (i * 8) as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `(i * 8)` [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] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/keystore/my_scrypt.rs:36:31 [INFO] [stdout] | [INFO] [stdout] 36 | salsa_xor(tmp, &input[((i * 16) as usize)..], &mut out[start..]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `(i * 16)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/keystore/my_scrypt.rs:37:21 [INFO] [stdout] | [INFO] [stdout] 37 | let start = (i * 8 + r * 16) as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(i * 8 + r * 16)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/keystore/my_scrypt.rs:38:31 [INFO] [stdout] | [INFO] [stdout] 38 | salsa_xor(tmp, &input[((i * 16 + 16) as usize)..], &mut out[start..]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(i * 16 + 16)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str` [INFO] [stdout] --> src/address.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | / pub fn from_str(s: &str) -> Result> { [INFO] [stdout] 18 | | let data = utils::hex_to_bytes(s)?; [INFO] [stdout] 19 | | Ok(Self { [INFO] [stdout] 20 | | h160: H160::from_slice(data.as_slice()), [INFO] [stdout] 21 | | }) [INFO] [stdout] 22 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/address.rs:43:38 [INFO] [stdout] | [INFO] [stdout] 43 | assert!(checksum_addr == addr.to_string()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `addr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/keystore/my_scrypt.rs:154:5 [INFO] [stdout] | [INFO] [stdout] 154 | return b[j as usize] as u64 | (b[(j + 1) as usize] as u64) << 32; [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 154 - return b[j as usize] as u64 | (b[(j + 1) as usize] as u64) << 32; [INFO] [stdout] 154 + b[j as usize] as u64 | (b[(j + 1) as usize] as u64) << 32 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/keystore/my_scrypt.rs:162:5 [INFO] [stdout] | [INFO] [stdout] 162 | return [b4, b3, b2, b1]; [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 162 - return [b4, b3, b2, b1]; [INFO] [stdout] 162 + [b4, b3, b2, b1] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/utils.rs:20:30 [INFO] [stdout] | [INFO] [stdout] 20 | let hashed = hex::encode(&hashed); [INFO] [stdout] | ^^^^^^^ help: change this to: `hashed` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/utils.rs:24:12 [INFO] [stdout] | [INFO] [stdout] 24 | if ch >= '0' && ch <= '9' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('0'..='9').contains(&ch)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/utils.rs:26:19 [INFO] [stdout] | [INFO] [stdout] 26 | } else if ch >= 'a' && ch <= 'f' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `('a'..='f').contains(&ch)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `integer` doesn't need a mutable reference [INFO] [stdout] --> src/keystore/my_scrypt.rs:201:22 [INFO] [stdout] | [INFO] [stdout] 201 | j = (integer(&mut y, r) & (n - 1) as u64) as i32; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 201 - j = (integer(&mut y, r) & (n - 1) as u64) as i32; [INFO] [stdout] 201 + j = (integer(&y, r) & (n - 1) as u64) as i32; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `block_xor` doesn't need a mutable reference [INFO] [stdout] --> src/keystore/my_scrypt.rs:202:27 [INFO] [stdout] | [INFO] [stdout] 202 | block_xor(&mut y, &mut v[(((j as u32) * R) as usize)..], R as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 202 - block_xor(&mut y, &mut v[(((j as u32) * R) as usize)..], R as usize); [INFO] [stdout] 202 + block_xor(&mut y, &v[(((j as u32) * R) as usize)..], R as usize); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/utils.rs:47:17 [INFO] [stdout] | [INFO] [stdout] 47 | assert!(!d.is_err()); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `d.is_ok()` [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/utils.rs:54:17 [INFO] [stdout] | [INFO] [stdout] 54 | assert!(!d.is_err()); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `d.is_ok()` [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: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/utils.rs:51:17 [INFO] [stdout] | [INFO] [stdout] 51 | assert!(d.last().unwrap().clone() == 239); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*d.last().unwrap()` [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: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/utils.rs:58:17 [INFO] [stdout] | [INFO] [stdout] 58 | assert!(d.last().unwrap().clone() == 239); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*d.last().unwrap()` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/keystore/my_scrypt.rs:251:57 [INFO] [stdout] | [INFO] [stdout] 251 | pbkdf2::pbkdf2::>(password.as_bytes(), &salt, 1, &mut b); [INFO] [stdout] | ^^^^^ help: change this to: `salt` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/contract/deployer.rs:135:51 [INFO] [stdout] | [INFO] [stdout] 135 | let signed_tx = web3.sign_transaction(&from, &tx).await.unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `from` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/contract/event.rs:54:45 [INFO] [stdout] | [INFO] [stdout] 54 | fn take_index<'a>(index: &usize, bytes: &'a Vec) -> &'a [u8] { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 54 - fn take_index<'a>(index: &usize, bytes: &'a Vec) -> &'a [u8] { [INFO] [stdout] 54 + fn take_index<'a>(index: &usize, bytes: &'a [u8]) -> &'a [u8] { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/contract/event.rs:59:20 [INFO] [stdout] | [INFO] [stdout] 59 | fn take_index2<'a>(begin: usize, bytes: &'a Vec) -> &'a [u8] { [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] 59 - fn take_index2<'a>(begin: usize, bytes: &'a Vec) -> &'a [u8] { [INFO] [stdout] 59 + fn take_index2(begin: usize, bytes: &Vec) -> &[u8] { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/contract/event.rs:59:45 [INFO] [stdout] | [INFO] [stdout] 59 | fn take_index2<'a>(begin: usize, bytes: &'a Vec) -> &'a [u8] { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 59 - fn take_index2<'a>(begin: usize, bytes: &'a Vec) -> &'a [u8] { [INFO] [stdout] 59 + fn take_index2<'a>(begin: usize, bytes: &'a [u8]) -> &'a [u8] { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/keystore/mod.rs:29:22 [INFO] [stdout] | [INFO] [stdout] 29 | Ok(s) => return Ok(s), [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 29 - Ok(s) => return Ok(s), [INFO] [stdout] 29 + Ok(s) => Ok(s), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/contract/event.rs:155:25 [INFO] [stdout] | [INFO] [stdout] 155 | return Ok(EventParam::Array(results)) [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] 155 ~ Ok(EventParam::Array(results)) [INFO] [stdout] 156 | }, [INFO] [stdout] ... [INFO] [stdout] 169 | } [INFO] [stdout] 170 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/contract/event.rs:165:25 [INFO] [stdout] | [INFO] [stdout] 165 | return Ok(EventParam::Array(results)); [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 165 ~ Ok(EventParam::Array(results)) [INFO] [stdout] 166 | }, [INFO] [stdout] ... [INFO] [stdout] 169 | } [INFO] [stdout] 170 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/keystore/mod.rs:30:23 [INFO] [stdout] | [INFO] [stdout] 30 | Err(e) => return Err(format!("{}", e).into()), [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - Err(e) => return Err(format!("{}", e).into()), [INFO] [stdout] 30 + Err(e) => Err(format!("{}", e).into()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/contract/event.rs:168:25 [INFO] [stdout] | [INFO] [stdout] 168 | return Err(format!("Unsupported event parameter's kind: {:?} of an event array", param).into()) [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 168 ~ Err(format!("Unsupported event parameter's kind: {:?} of an event array", param).into()) [INFO] [stdout] 169 | } [INFO] [stdout] 170 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/keystore/mod.rs:34:45 [INFO] [stdout] | [INFO] [stdout] 34 | fn derive(kdf: &KDF, password: &str) -> Result<([u8; 16], [u8; 16], KDF), Box> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/keystore/mod.rs:38:34 [INFO] [stdout] | [INFO] [stdout] 38 | derived_key[index] = elem.clone(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*elem` [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: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/keystore/mod.rs:42:33 [INFO] [stdout] | [INFO] [stdout] 42 | mac_prefix[index] = elem.clone(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*elem` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> src/keystore/mod.rs:53:9 [INFO] [stdout] | [INFO] [stdout] 52 | let encrypted = AES::AES128(derived_key).encrypt(&data, ¶ms).unwrap(); [INFO] [stdout] | -------------------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 53 | encrypted [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] 52 ~ [INFO] [stdout] 53 ~ AES::AES128(derived_key).encrypt(&data, ¶ms).unwrap() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/keystore/mod.rs:52:58 [INFO] [stdout] | [INFO] [stdout] 52 | let encrypted = AES::AES128(derived_key).encrypt(&data, ¶ms).unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `data` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/keystore/mod.rs:63:50 [INFO] [stdout] | [INFO] [stdout] 63 | fn caclute_mac(prefix: &[u8; 16], encrypted: &Vec) -> [u8; 32] { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 63 ~ fn caclute_mac(prefix: &[u8; 16], encrypted: &[u8]) -> [u8; 32] { [INFO] [stdout] 64 | let mut bytes = prefix.to_vec(); [INFO] [stdout] 65 ~ bytes.append(&mut encrypted.to_owned()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/keystore/mod.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 66 | let mac = keccak256(&bytes); [INFO] [stdout] | ---------------------------- unnecessary `let` binding [INFO] [stdout] 67 | mac [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] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 66 ~ [INFO] [stdout] 67 ~ keccak256(&bytes) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/contract/event.rs:132:57 [INFO] [stdout] | [INFO] [stdout] 132 | ... let b1 = begin.as_usize() + (32 * ( 1)) + b1.as_usize(); [INFO] [stdout] | ^^^^^^^^^^^ help: consider reducing it to: `32` [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: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/contract/event.rs:136:49 [INFO] [stdout] | [INFO] [stdout] 136 | ... for j in 0..size.clone() { [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*size` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/keystore/mod.rs:77:41 [INFO] [stdout] | [INFO] [stdout] 77 | let mac = Keystore::caclute_mac(&mac_prefix, &encrypted); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `mac_prefix` [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` which implements the `Copy` trait [INFO] [stdout] --> src/keystore/mod.rs:118:21 [INFO] [stdout] | [INFO] [stdout] 118 | iv[i] = e.clone(); [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*e` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/contract/event.rs:227:51 [INFO] [stdout] | [INFO] [stdout] 227 | pub fn from_logs(event: ðabi::Event, logs: &Vec) -> Result, StdError> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 227 - pub fn from_logs(event: ðabi::Event, logs: &Vec) -> Result, StdError> { [INFO] [stdout] 227 + pub fn from_logs(event: ðabi::Event, logs: &[Log]) -> Result, StdError> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/contract/event.rs:231:44 [INFO] [stdout] | [INFO] [stdout] 231 | events.push(Event::from(event, &log)?); [INFO] [stdout] | ^^^^ help: change this to: `log` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hd.rs:43:34 [INFO] [stdout] | [INFO] [stdout] 43 | let seed = Seed::new_cpc(&mnemonic, ""); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `mnemonic` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hd.rs:44:60 [INFO] [stdout] | [INFO] [stdout] 44 | let bytes = compute_hmac(MASTER_SECRET.as_bytes(), &seed.as_bytes())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `seed.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] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/hd.rs:51:45 [INFO] [stdout] | [INFO] [stdout] 51 | master_private_key[index] = elem.clone(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*elem` [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: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/hd.rs:65:44 [INFO] [stdout] | [INFO] [stdout] 65 | master_chain_code[index] = elem.clone(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*elem` [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/hd.rs:110:12 [INFO] [stdout] | [INFO] [stdout] 110 | if path.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!path.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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/contract/mod.rs:142:47 [INFO] [stdout] | [INFO] [stdout] 142 | let signed_tx = web3.sign_transaction(&account, &tx).await?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `account` [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` which implements the `Copy` trait [INFO] [stdout] --> src/hd.rs:121:43 [INFO] [stdout] | [INFO] [stdout] 121 | data[index + 1] = e.clone(); [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*e` [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/hd.rs:124:24 [INFO] [stdout] | [INFO] [stdout] 124 | if path.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!path.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: called `unwrap` on `from_block` after checking its variant with `is_some` [INFO] [stdout] --> src/contract/mod.rs:161:42 [INFO] [stdout] | [INFO] [stdout] 160 | if from_block.is_some() { [INFO] [stdout] | ----------------------- help: try: `if let Some() = from_block` [INFO] [stdout] 161 | builder = builder.from_block(from_block.unwrap().into()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `to_block` after checking its variant with `is_some` [INFO] [stdout] --> src/contract/mod.rs:164:40 [INFO] [stdout] | [INFO] [stdout] 163 | if to_block.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = to_block` [INFO] [stdout] 164 | builder = builder.to_block(to_block.unwrap().into()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enclosing `Ok` and `?` operator are unneeded [INFO] [stdout] --> src/contract/mod.rs:177:9 [INFO] [stdout] | [INFO] [stdout] 177 | Ok(Event::from_logs(e, &logs)?) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_question_mark [INFO] [stdout] help: remove the enclosing `Ok` and `?` operator [INFO] [stdout] | [INFO] [stdout] 177 - Ok(Event::from_logs(e, &logs)?) [INFO] [stdout] 177 + Event::from_logs(e, &logs) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/hd.rs:164:37 [INFO] [stdout] | [INFO] [stdout] 164 | ki[index] = e.clone(); [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*e` [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: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/hd.rs:179:13 [INFO] [stdout] | [INFO] [stdout] 179 | child_chain_code.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*child_chain_code` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/contract/mod.rs:183:24 [INFO] [stdout] | [INFO] [stdout] 183 | Event::from(e, &log) [INFO] [stdout] | ^^^^ help: change this to: `log` [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/hd.rs:190:12 [INFO] [stdout] | [INFO] [stdout] 190 | if components.len() == 0 || path == "" || (components[0] == "m" && self.depth != 0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `components.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: comparison to empty slice [INFO] [stdout] --> src/hd.rs:190:37 [INFO] [stdout] | [INFO] [stdout] 190 | if components.len() == 0 || path == "" || (components[0] == "m" && self.depth != 0) { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `path.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u64` is unnecessary [INFO] [stdout] --> src/contract/mod.rs:223:34 [INFO] [stdout] | [INFO] [stdout] 223 | opt.gas_price = Some((180_000_000_000 as u64).into()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `180_000_000_000_u64` [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] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/cpc_aes/ecb.rs:9:40 [INFO] [stdout] | [INFO] [stdout] 9 | pub fn encrypt_ebc(key: [u8;32], data: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 9 - pub fn encrypt_ebc(key: [u8;32], data: &Vec) -> Vec { [INFO] [stdout] 9 + pub fn encrypt_ebc(key: [u8;32], data: &[u8]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/cpc_aes/ecb.rs:35:41 [INFO] [stdout] | [INFO] [stdout] 35 | pub fn decrypt_ebc(key: [u8; 32], data: &Vec) -> Vec { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 35 - pub fn decrypt_ebc(key: [u8; 32], data: &Vec) -> Vec { [INFO] [stdout] 35 + pub fn decrypt_ebc(key: [u8; 32], data: &[u8]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/cpc_aes/ecb.rs:55:10 [INFO] [stdout] | [INFO] [stdout] 55 | while r.len() > 0 && r[r.len() - 1] == 0 { [INFO] [stdout] | ^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!r.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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/cpc_aes/mod.rs:38:26 [INFO] [stdout] | [INFO] [stdout] 38 | Ok(encrypt_ebc(key, &data)) [INFO] [stdout] | ^^^^^ help: change this to: `data` [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: name `KDF` contains a capitalized acronym [INFO] [stdout] --> src/keystore/kdf.rs:32:10 [INFO] [stdout] | [INFO] [stdout] 32 | pub enum KDF { [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Kdf` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `SCRYPT` contains a capitalized acronym [INFO] [stdout] --> src/keystore/kdf.rs:38:5 [INFO] [stdout] | [INFO] [stdout] 38 | SCRYPT(Option), [INFO] [stdout] | ^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Scrypt` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/keystore/kdf.rs:44:60 [INFO] [stdout] | [INFO] [stdout] 44 | KDF::PBKDF2(params) => Ok(serde_json::to_value(¶ms)?), [INFO] [stdout] | ^^^^^^^ help: change this to: `params` [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/keystore/kdf.rs:45:60 [INFO] [stdout] | [INFO] [stdout] 45 | KDF::SCRYPT(params) => Ok(serde_json::to_value(¶ms)?), [INFO] [stdout] | ^^^^^^^ help: change this to: `params` [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/keystore/kdf.rs:96:35 [INFO] [stdout] | [INFO] [stdout] 96 | salt: hex::encode(&rand_salt()), [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `rand_salt()` [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/keystore/kdf.rs:126:35 [INFO] [stdout] | [INFO] [stdout] 126 | salt: hex::encode(&rand_salt()), [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `rand_salt()` [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: name `KDF` contains a capitalized acronym [INFO] [stdout] --> src/keystore/crypto_info.rs:68:13 [INFO] [stdout] | [INFO] [stdout] 68 | KDF, [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Kdf` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/keystore/crypto_info.rs:97:70 [INFO] [stdout] | [INFO] [stdout] 97 | ... _ => Err(de::Error::unknown_field(value, &FIELDS)), [INFO] [stdout] | ^^^^^^^ help: change this to: `FIELDS` [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: this operation has no effect [INFO] [stdout] --> src/keystore/my_scrypt.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | ((array[0] as u32) << 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `((array[0] as u32))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/keystore/my_scrypt.rs:35:21 [INFO] [stdout] | [INFO] [stdout] 35 | let start = (i * 8) as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `(i * 8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/keystore/my_scrypt.rs:36:31 [INFO] [stdout] | [INFO] [stdout] 36 | salsa_xor(tmp, &input[((i * 16) as usize)..], &mut out[start..]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `(i * 16)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/keystore/my_scrypt.rs:37:21 [INFO] [stdout] | [INFO] [stdout] 37 | let start = (i * 8 + r * 16) as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(i * 8 + r * 16)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/keystore/my_scrypt.rs:38:31 [INFO] [stdout] | [INFO] [stdout] 38 | salsa_xor(tmp, &input[((i * 16 + 16) as usize)..], &mut out[start..]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(i * 16 + 16)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/keystore/my_scrypt.rs:154:5 [INFO] [stdout] | [INFO] [stdout] 154 | return b[j as usize] as u64 | (b[(j + 1) as usize] as u64) << 32; [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 154 - return b[j as usize] as u64 | (b[(j + 1) as usize] as u64) << 32; [INFO] [stdout] 154 + b[j as usize] as u64 | (b[(j + 1) as usize] as u64) << 32 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/keystore/my_scrypt.rs:162:5 [INFO] [stdout] | [INFO] [stdout] 162 | return [b4, b3, b2, b1]; [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 162 - return [b4, b3, b2, b1]; [INFO] [stdout] 162 + [b4, b3, b2, b1] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `integer` doesn't need a mutable reference [INFO] [stdout] --> src/keystore/my_scrypt.rs:201:22 [INFO] [stdout] | [INFO] [stdout] 201 | j = (integer(&mut y, r) & (n - 1) as u64) as i32; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 201 - j = (integer(&mut y, r) & (n - 1) as u64) as i32; [INFO] [stdout] 201 + j = (integer(&y, r) & (n - 1) as u64) as i32; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `block_xor` doesn't need a mutable reference [INFO] [stdout] --> src/keystore/my_scrypt.rs:202:27 [INFO] [stdout] | [INFO] [stdout] 202 | block_xor(&mut y, &mut v[(((j as u32) * R) as usize)..], R as usize); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 202 - block_xor(&mut y, &mut v[(((j as u32) * R) as usize)..], R as usize); [INFO] [stdout] 202 + block_xor(&mut y, &v[(((j as u32) * R) as usize)..], R as usize); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/keystore/my_scrypt.rs:251:57 [INFO] [stdout] | [INFO] [stdout] 251 | pbkdf2::pbkdf2::>(password.as_bytes(), &salt, 1, &mut b); [INFO] [stdout] | ^^^^^ help: change this to: `salt` [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: called `unwrap` on `expected` after checking its variant with `is_some` [INFO] [stdout] --> src/keystore/my_scrypt.rs:279:47 [INFO] [stdout] | [INFO] [stdout] 278 | if expected.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = expected` [INFO] [stdout] 279 | assert_eq!(hex::encode(&derived), expected.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/keystore/mod.rs:29:22 [INFO] [stdout] | [INFO] [stdout] 29 | Ok(s) => return Ok(s), [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 29 - Ok(s) => return Ok(s), [INFO] [stdout] 29 + Ok(s) => Ok(s), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/keystore/mod.rs:30:23 [INFO] [stdout] | [INFO] [stdout] 30 | Err(e) => return Err(format!("{}", e).into()), [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] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - Err(e) => return Err(format!("{}", e).into()), [INFO] [stdout] 30 + Err(e) => Err(format!("{}", e).into()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/keystore/mod.rs:34:45 [INFO] [stdout] | [INFO] [stdout] 34 | fn derive(kdf: &KDF, password: &str) -> Result<([u8; 16], [u8; 16], KDF), Box> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/keystore/mod.rs:38:34 [INFO] [stdout] | [INFO] [stdout] 38 | derived_key[index] = elem.clone(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*elem` [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: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/keystore/mod.rs:42:33 [INFO] [stdout] | [INFO] [stdout] 42 | mac_prefix[index] = elem.clone(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*elem` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> src/keystore/mod.rs:53:9 [INFO] [stdout] | [INFO] [stdout] 52 | let encrypted = AES::AES128(derived_key).encrypt(&data, ¶ms).unwrap(); [INFO] [stdout] | -------------------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 53 | encrypted [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] 52 ~ [INFO] [stdout] 53 ~ AES::AES128(derived_key).encrypt(&data, ¶ms).unwrap() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/keystore/mod.rs:52:58 [INFO] [stdout] | [INFO] [stdout] 52 | let encrypted = AES::AES128(derived_key).encrypt(&data, ¶ms).unwrap(); [INFO] [stdout] | ^^^^^ help: change this to: `data` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/keystore/mod.rs:63:50 [INFO] [stdout] | [INFO] [stdout] 63 | fn caclute_mac(prefix: &[u8; 16], encrypted: &Vec) -> [u8; 32] { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 63 ~ fn caclute_mac(prefix: &[u8; 16], encrypted: &[u8]) -> [u8; 32] { [INFO] [stdout] 64 | let mut bytes = prefix.to_vec(); [INFO] [stdout] 65 ~ bytes.append(&mut encrypted.to_owned()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/keystore/mod.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 66 | let mac = keccak256(&bytes); [INFO] [stdout] | ---------------------------- unnecessary `let` binding [INFO] [stdout] 67 | mac [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] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 66 ~ [INFO] [stdout] 67 ~ keccak256(&bytes) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/keystore/mod.rs:77:41 [INFO] [stdout] | [INFO] [stdout] 77 | let mac = Keystore::caclute_mac(&mac_prefix, &encrypted); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `mac_prefix` [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` which implements the `Copy` trait [INFO] [stdout] --> src/keystore/mod.rs:118:21 [INFO] [stdout] | [INFO] [stdout] 118 | iv[i] = e.clone(); [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*e` [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: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/keystore/mod.rs:246:9 [INFO] [stdout] | [INFO] [stdout] 246 | assert_eq!(r.is_err(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 246 - assert_eq!(r.is_err(), true); [INFO] [stdout] 246 + assert!(r.is_err()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/keystore/mod.rs:257:9 [INFO] [stdout] | [INFO] [stdout] 257 | assert_eq!(r.is_err(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 257 - assert_eq!(r.is_err(), true); [INFO] [stdout] 257 + assert!(r.is_err()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/keystore/mod.rs:267:9 [INFO] [stdout] | [INFO] [stdout] 267 | assert_eq!(r.is_err(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 267 - assert_eq!(r.is_err(), true); [INFO] [stdout] 267 + assert!(r.is_err()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hd.rs:43:34 [INFO] [stdout] | [INFO] [stdout] 43 | let seed = Seed::new_cpc(&mnemonic, ""); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `mnemonic` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/hd.rs:44:60 [INFO] [stdout] | [INFO] [stdout] 44 | let bytes = compute_hmac(MASTER_SECRET.as_bytes(), &seed.as_bytes())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `seed.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] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/hd.rs:51:45 [INFO] [stdout] | [INFO] [stdout] 51 | master_private_key[index] = elem.clone(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*elem` [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: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/hd.rs:65:44 [INFO] [stdout] | [INFO] [stdout] 65 | master_chain_code[index] = elem.clone(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*elem` [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/hd.rs:110:12 [INFO] [stdout] | [INFO] [stdout] 110 | if path.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!path.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` which implements the `Copy` trait [INFO] [stdout] --> src/hd.rs:121:43 [INFO] [stdout] | [INFO] [stdout] 121 | data[index + 1] = e.clone(); [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*e` [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/hd.rs:124:24 [INFO] [stdout] | [INFO] [stdout] 124 | if path.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!path.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` which implements the `Copy` trait [INFO] [stdout] --> src/hd.rs:164:37 [INFO] [stdout] | [INFO] [stdout] 164 | ki[index] = e.clone(); [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*e` [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: using `clone` on type `[u8; 32]` which implements the `Copy` trait [INFO] [stdout] --> src/hd.rs:179:13 [INFO] [stdout] | [INFO] [stdout] 179 | child_chain_code.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*child_chain_code` [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/hd.rs:190:12 [INFO] [stdout] | [INFO] [stdout] 190 | if components.len() == 0 || path == "" || (components[0] == "m" && self.depth != 0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `components.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: comparison to empty slice [INFO] [stdout] --> src/hd.rs:190:37 [INFO] [stdout] | [INFO] [stdout] 190 | if components.len() == 0 || path == "" || (components[0] == "m" && self.depth != 0) { [INFO] [stdout] | ^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `path.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/hd.rs:236:30 [INFO] [stdout] | [INFO] [stdout] 236 | let pk = hex::encode(&node.private_key.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `node.private_key.unwrap()` [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: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/accounts.rs:154:9 [INFO] [stdout] | [INFO] [stdout] 154 | assert_eq!(account.mnemonic.is_none(), true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 154 - assert_eq!(account.mnemonic.is_none(), true); [INFO] [stdout] 154 + assert!(account.mnemonic.is_none()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 35.09s [INFO] [stderr] warning: the following packages contain code that will be rejected by a future version of Rust: openssl v0.10.42 [INFO] [stderr] note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 3` [INFO] running `Command { std: "docker" "inspect" "a3de97e3837932598e63ebc8c243bc4ec1086cd0878c74a1c6d07eabf695385d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "a3de97e3837932598e63ebc8c243bc4ec1086cd0878c74a1c6d07eabf695385d", kill_on_drop: false }` [INFO] [stdout] a3de97e3837932598e63ebc8c243bc4ec1086cd0878c74a1c6d07eabf695385d