[INFO] cloning repository https://github.com/VielenDanke/rust_learning [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/VielenDanke/rust_learning" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FVielenDanke%2Frust_learning", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FVielenDanke%2Frust_learning'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] a286695f871eb9ff055d614fad042337cf5b7a89 [INFO] linting VielenDanke/rust_learning against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FVielenDanke%2Frust_learning" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/VielenDanke/rust_learning [INFO] finished tweaking git repo https://github.com/VielenDanke/rust_learning [INFO] tweaked toml for git repo https://github.com/VielenDanke/rust_learning written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/VielenDanke/rust_learning 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/VielenDanke/rust_learning 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] warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"` [INFO] [stderr] | [INFO] [stderr] = note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest [INFO] [stderr] = note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest [INFO] [stderr] = note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded sval_serde v2.13.0 [INFO] [stderr] Downloaded value-bag-sval2 v1.9.0 [INFO] [stderr] Downloaded sval_json v2.13.0 [INFO] [stderr] Downloaded sval_ref v2.13.0 [INFO] [stderr] Downloaded sval v2.13.0 [INFO] [stderr] Downloaded sval_buffer v2.13.0 [INFO] [stderr] Downloaded piper v0.2.2 [INFO] [stderr] Downloaded async-dup v1.2.4 [INFO] [stderr] Downloaded sval_fmt v2.13.0 [INFO] [stderr] Downloaded sval_dynamic v2.13.0 [INFO] [stderr] Downloaded async-signal v0.2.6 [INFO] [stderr] Downloaded async-h1 v2.3.4 [INFO] [stderr] Downloaded async-io v2.3.2 [INFO] [stderr] Downloaded sval_nested v2.13.0 [INFO] [stderr] Downloaded const_fn v0.4.10 [INFO] [stderr] Downloaded regex-lite v0.1.5 [INFO] [stderr] Downloaded value-bag-serde1 v1.9.0 [INFO] [stderr] Downloaded actix-http v3.7.0 [INFO] [stderr] Downloaded actix-web v4.6.0 [INFO] [stderr] Downloaded brotli-decompressor v4.0.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 12316f1cc0d4834d5f0a4b28bcce1b3f617205704b34b6ac5b88591c0150ba6d [INFO] running `Command { std: "docker" "start" "-a" "12316f1cc0d4834d5f0a4b28bcce1b3f617205704b34b6ac5b88591c0150ba6d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "12316f1cc0d4834d5f0a4b28bcce1b3f617205704b34b6ac5b88591c0150ba6d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "12316f1cc0d4834d5f0a4b28bcce1b3f617205704b34b6ac5b88591c0150ba6d", kill_on_drop: false }` [INFO] [stdout] 12316f1cc0d4834d5f0a4b28bcce1b3f617205704b34b6ac5b88591c0150ba6d [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] c1ca3b2b71b7605e6d455a599e1a4b6c82a3f4b165341c04e3032d805b074246 [INFO] running `Command { std: "docker" "start" "-a" "c1ca3b2b71b7605e6d455a599e1a4b6c82a3f4b165341c04e3032d805b074246", kill_on_drop: false }` [INFO] [stderr] warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"` [INFO] [stderr] | [INFO] [stderr] = note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest [INFO] [stderr] = note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest [INFO] [stderr] = note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions [INFO] [stderr] Compiling libc v0.2.154 [INFO] [stderr] Compiling serde v1.0.203 [INFO] [stderr] Compiling autocfg v1.2.0 [INFO] [stderr] Checking typeid v1.0.0 [INFO] [stderr] Checking memchr v2.7.2 [INFO] [stderr] Checking bytes v1.6.0 [INFO] [stderr] Checking tracing-core v0.1.32 [INFO] [stderr] Compiling syn v2.0.60 [INFO] [stderr] Checking bitflags v2.5.0 [INFO] [stderr] Compiling serde_json v1.0.117 [INFO] [stderr] Compiling rustix v0.38.34 [INFO] [stderr] Checking concurrent-queue v2.5.0 [INFO] [stderr] Checking unicode-normalization v0.1.23 [INFO] [stderr] Checking linux-raw-sys v0.4.13 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Compiling thiserror v1.0.61 [INFO] [stderr] Checking futures-lite v2.3.0 [INFO] [stderr] Checking event-listener v4.0.3 [INFO] [stderr] Compiling time-macros v0.2.18 [INFO] [stderr] Compiling slab v0.4.9 [INFO] [stderr] Compiling lock_api v0.4.12 [INFO] [stderr] Checking idna v0.5.0 [INFO] [stderr] Checking sha1 v0.10.6 [INFO] [stderr] Checking digest v0.9.0 [INFO] [stderr] Compiling standback v0.2.17 [INFO] [stderr] Compiling http v0.2.12 [INFO] [stderr] Compiling polling v2.8.0 [INFO] [stderr] Checking event-listener v5.3.0 [INFO] [stderr] Checking event-listener-strategy v0.4.0 [INFO] [stderr] Checking async-lock v3.3.0 [INFO] [stderr] Compiling unicase v2.7.0 [INFO] [stderr] Checking event-listener-strategy v0.5.2 [INFO] [stderr] Compiling async-io v1.13.0 [INFO] [stderr] Checking http v1.1.0 [INFO] [stderr] Checking cipher v0.2.5 [INFO] [stderr] Checking spin v0.9.8 [INFO] [stderr] Checking futures-lite v1.13.0 [INFO] [stderr] Checking piper v0.2.2 [INFO] [stderr] Checking async-channel v2.3.1 [INFO] [stderr] Compiling num-traits v0.2.18 [INFO] [stderr] Checking universal-hash v0.4.0 [INFO] [stderr] Checking http-body v0.4.6 [INFO] [stderr] Checking cpuid-bool v0.2.0 [INFO] [stderr] Compiling const_fn v0.4.10 [INFO] [stderr] Checking aes-soft v0.6.4 [INFO] [stderr] Checking async-executor v1.11.0 [INFO] [stderr] Checking blocking v1.6.0 [INFO] [stderr] Checking polyval v0.4.5 [INFO] [stderr] Checking event-listener v3.1.0 [INFO] [stderr] Checking crypto-mac v0.10.0 [INFO] [stderr] Checking block-buffer v0.9.0 [INFO] [stderr] Compiling time v0.2.27 [INFO] [stderr] Compiling uncased v0.9.10 [INFO] [stderr] Checking time v0.3.36 [INFO] [stderr] Checking sha2 v0.9.9 [INFO] [stderr] Checking hmac v0.10.1 [INFO] [stderr] Checking ghash v0.3.1 [INFO] [stderr] Compiling mime_guess v2.0.4 [INFO] [stderr] Checking aes v0.6.0 [INFO] [stderr] Compiling futures-channel v0.3.30 [INFO] [stderr] Checking ctr v0.6.0 [INFO] [stderr] Checking async-channel v1.9.0 [INFO] [stderr] Checking aead v0.3.2 [INFO] [stderr] Compiling cookie v0.18.1 [INFO] [stderr] Compiling cookie v0.14.4 [INFO] [stderr] Checking signal-hook-registry v1.4.2 [INFO] [stderr] Checking getrandom v0.2.14 [INFO] [stderr] Checking parking_lot_core v0.9.10 [INFO] [stderr] Checking num_cpus v1.16.0 [INFO] [stderr] Checking socket2 v0.5.7 [INFO] [stderr] Checking io-lifetimes v1.0.11 [INFO] [stderr] Checking socket2 v0.4.10 [INFO] [stderr] Checking getrandom v0.1.16 [INFO] [stderr] Checking parking_lot v0.12.2 [INFO] [stderr] Compiling multer v2.1.0 [INFO] [stderr] Compiling jobserver v0.1.31 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Compiling is-terminal v0.4.12 [INFO] [stderr] Checking rustix v0.37.27 [INFO] [stderr] Compiling yansi v1.0.1 [INFO] [stderr] Checking rand_core v0.5.1 [INFO] [stderr] Compiling ref-cast v1.0.23 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking iana-time-zone v0.1.60 [INFO] [stderr] Compiling cc v1.0.95 [INFO] [stderr] Checking rand_chacha v0.2.2 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking aes-gcm v0.8.0 [INFO] [stderr] Checking hkdf v0.10.0 [INFO] [stderr] Checking anyhow v1.0.86 [INFO] [stderr] Checking headers-core v0.2.0 [INFO] [stderr] Compiling hashbrown v0.14.5 [INFO] [stderr] Compiling http-types v2.12.0 [INFO] [stderr] Checking headers v0.3.9 [INFO] [stderr] Compiling aho-corasick v1.1.3 [INFO] [stderr] Checking rand v0.7.3 [INFO] [stderr] Checking infer v0.2.3 [INFO] [stderr] Compiling zstd-safe v7.1.0 [INFO] [stderr] Checking managing_projects v0.1.0 (/opt/rustwide/workdir/managing_projects) [INFO] [stdout] warning: function `calculate_product_cost` is never used [INFO] [stdout] --> managing_projects/src/service/product_service.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn calculate_product_cost(first_product: u32, second_product: u32) -> u32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `fetch_products` is never used [INFO] [stdout] --> managing_projects/src/repository/mod.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn fetch_products() -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Compiling httparse v1.8.0 [INFO] [stderr] Checking crypto-mac v0.8.0 [INFO] [stderr] Compiling ahash v0.8.11 [INFO] [stderr] Compiling inlinable_string v0.1.15 [INFO] [stderr] Compiling tower-service v0.3.2 [INFO] [stderr] Checking winnow v0.6.8 [INFO] [stderr] Checking regex-syntax v0.8.3 [INFO] [stderr] Compiling httpdate v1.0.3 [INFO] [stderr] Checking miniz_oxide v0.7.2 [INFO] [stderr] Checking actix-service v2.0.2 [INFO] [stderr] Checking brotli-decompressor v4.0.0 [INFO] [stderr] Checking actix-utils v3.0.1 [INFO] [stderr] Compiling regex-automata v0.4.6 [INFO] [stderr] Checking bytestring v1.3.1 [INFO] [stderr] Compiling stable-pattern v0.1.0 [INFO] [stderr] Compiling cookie v0.16.2 [INFO] [stderr] Compiling multer v3.1.0 [INFO] [stderr] Compiling figment v0.10.19 [INFO] [stderr] Checking zerocopy v0.7.34 [INFO] [stderr] Checking arrayvec v0.5.2 [INFO] [stderr] Compiling regex-lite v0.1.5 [INFO] [stderr] Compiling either v1.12.0 [INFO] [stderr] Compiling state v0.6.0 [INFO] [stderr] Checking flate2 v1.0.30 [INFO] [stderr] Checking hmac v0.8.1 [INFO] [stderr] Checking brotli v6.0.0 [INFO] [stderr] Checking local-channel v0.1.5 [INFO] [stderr] Compiling zstd-sys v2.0.10+zstd.1.5.6 [INFO] [stderr] Compiling blake3 v0.3.8 [INFO] [stderr] Checking async-dup v1.2.4 [INFO] [stderr] Checking blake2 v0.10.6 [INFO] [stderr] Checking tempfile v3.10.1 [INFO] [stderr] Compiling rocket v0.5.1 [INFO] [stderr] Compiling proc-macro2-diagnostics v0.10.1 [INFO] [stderr] Checking pin-project-lite v0.1.12 [INFO] [stderr] Checking base64 v0.12.3 [INFO] [stderr] Checking atomic v0.5.3 [INFO] [stderr] Checking route-recognizer v0.2.0 [INFO] [stderr] Checking binascii v0.1.4 [INFO] [stderr] Checking basic_blockchain_example v0.1.0 (/opt/rustwide/workdir/basic_blockchain_example) [INFO] [stderr] Checking server_with_standard_library v0.1.0 (/opt/rustwide/workdir/server_with_standard_library) [INFO] [stderr] Checking learning v0.1.0 (/opt/rustwide/workdir/learning) [INFO] [stdout] warning: field `pending_transactions` is never read [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 11 | pub struct Blockchain { [INFO] [stdout] | ---------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 21 | pending_transactions: Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Blockchain` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `store` and `acc_type` are never read [INFO] [stdout] --> basic_blockchain_example/src/structures/account.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 7 | pub struct Account { [INFO] [stdout] | ------- fields in this struct [INFO] [stdout] 8 | /// We want the account to be able to store any information we want (Dictionary) [INFO] [stdout] 9 | store: HashMap, [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 12 | acc_type: AccountType, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Account` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Blockchain` [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | / pub fn new() -> Self { [INFO] [stdout] 30 | | Blockchain { [INFO] [stdout] 31 | | blocks: Vec::new(), [INFO] [stdout] 32 | | accounts: HashMap::new(), [INFO] [stdout] ... | [INFO] [stdout] 36 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 27 + impl Default for Blockchain { [INFO] [stdout] 28 + fn default() -> Self { [INFO] [stdout] 29 + Self::new() [INFO] [stdout] 30 + } [INFO] [stdout] 31 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:52:12 [INFO] [stdout] | [INFO] [stdout] 52 | if !(block.prev_hash == self.get_last_block_hash()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(block.prev_hash != self.get_last_block_hash())` [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: struct `Blockchain` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:104:5 [INFO] [stdout] | [INFO] [stdout] 104 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:146:20 [INFO] [stdout] | [INFO] [stdout] 146 | if !(&block.prev_hash == &self.blocks[block_num - 1].hash) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(&block.prev_hash != &self.blocks[block_num - 1].hash)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:125:28 [INFO] [stdout] | [INFO] [stdout] 125 | return Err(format!("Stored hash for Block #{} \ [INFO] [stdout] | ____________________________^ [INFO] [stdout] 126 | | does not match calculated hash (Code: 665234234)", block_num + 1).into()); [INFO] [stdout] | |____________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing `.into()` [INFO] [stdout] | [INFO] [stdout] 125 ~ return Err(format!("Stored hash for Block #{} \ [INFO] [stdout] 126 ~ does not match calculated hash (Code: 665234234)", block_num + 1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:139:32 [INFO] [stdout] | [INFO] [stdout] 139 | return Err(format!("Block #{} has no previous hash set", block_num + 1).into()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `format!("Block #{} has no previous hash set", block_num + 1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:146:21 [INFO] [stdout] | [INFO] [stdout] 146 | if !(&block.prev_hash == &self.blocks[block_num - 1].hash) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 146 - if !(&block.prev_hash == &self.blocks[block_num - 1].hash) { [INFO] [stdout] 146 + if !(block.prev_hash == self.blocks[block_num - 1].hash) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:147:32 [INFO] [stdout] | [INFO] [stdout] 147 | return Err(format!("Block #{} is not connected to previous block (Hashes do \ [INFO] [stdout] | ________________________________^ [INFO] [stdout] 148 | | not match. Should be `{}` but is `{}`)", block_num, prev_hash_proposed, [INFO] [stdout] 149 | | prev_hash_actual).into()); [INFO] [stdout] | |_______________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into()` [INFO] [stdout] | [INFO] [stdout] 147 ~ return Err(format!("Block #{} is not connected to previous block (Hashes do \ [INFO] [stdout] 148 + not match. Should be `{}` but is `{}`)", block_num, prev_hash_proposed, [INFO] [stdout] 149 ~ prev_hash_actual)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:170:9 [INFO] [stdout] | [INFO] [stdout] 170 | self.accounts.keys().map(|s| s.clone()).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `self.accounts.keys().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:181:9 [INFO] [stdout] | [INFO] [stdout] 181 | / return if !self.get_user_ids().contains(&id) { [INFO] [stdout] 182 | | let acc = Account::new(account_type); [INFO] [stdout] 183 | | self.accounts.insert(id, Arc::new(RwLock::new(acc))); [INFO] [stdout] 184 | | Ok(()) [INFO] [stdout] 185 | | } else { [INFO] [stdout] 186 | | Err("User already exists! (Code: 934823094)") [INFO] [stdout] 187 | | }; [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] 181 ~ if !self.get_user_ids().contains(&id) { [INFO] [stdout] 182 + let acc = Account::new(account_type); [INFO] [stdout] 183 + self.accounts.insert(id, Arc::new(RwLock::new(acc))); [INFO] [stdout] 184 + Ok(()) [INFO] [stdout] 185 + } else { [INFO] [stdout] 186 + Err("User already exists! (Code: 934823094)") [INFO] [stdout] 187 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> basic_blockchain_example/src/structures/world_state.rs:16:37 [INFO] [stdout] | [INFO] [stdout] 16 | fn get_account_by_id(&self, id: &String) -> Option>>; [INFO] [stdout] | ^^^^^^^ help: change this to: `&str` [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] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `balance_sender_new` after checking its variant with `is_some` [INFO] [stdout] --> basic_blockchain_example/src/structures/transaction.rs:90:98 [INFO] [stdout] | [INFO] [stdout] 89 | return if balance_recv_new.is_some() && balance_sender_new.is_some() { [INFO] [stdout] | ---------------------------- the check is happening here [INFO] [stdout] 90 | world_state.get_account_by_id(&self.from).unwrap().write().unwrap().tokens = balance_sender_new.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [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: called `unwrap` on `balance_recv_new` after checking its variant with `is_some` [INFO] [stdout] --> basic_blockchain_example/src/structures/transaction.rs:91:90 [INFO] [stdout] | [INFO] [stdout] 89 | return if balance_recv_new.is_some() && balance_sender_new.is_some() { [INFO] [stdout] | -------------------------- the check is happening here [INFO] [stdout] 90 | world_state.get_account_by_id(&self.from).unwrap().write().unwrap().tokens = balance_sender_new.unwrap(); [INFO] [stdout] 91 | world_state.get_account_by_id(to).unwrap().write().unwrap().tokens = balance_recv_new.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [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] --> basic_blockchain_example/src/structures/transaction.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | / return match &self.record { [INFO] [stdout] 52 | | TransactionData::CreateUserAccount(account) => { [INFO] [stdout] 53 | | world_state.create_account(account.into(), AccountType::User) [INFO] [stdout] ... | [INFO] [stdout] 101 | | }; [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] 51 ~ match &self.record { [INFO] [stdout] 52 + TransactionData::CreateUserAccount(account) => { [INFO] [stdout] 53 + world_state.create_account(account.into(), AccountType::User) [INFO] [stdout] 54 + } [INFO] [stdout] 55 + [INFO] [stdout] 56 + TransactionData::CreateTokens { receiver, amount } => { [INFO] [stdout] 57 + if !is_initial { [INFO] [stdout] 58 + return Err("Token creation is only available on initial creation (Code: 2394233)"); [INFO] [stdout] 59 + } [INFO] [stdout] 60 + // Get the receiving user (must exist) [INFO] [stdout] 61 + return if let Some(account) = world_state.get_account_by_id(receiver) { [INFO] [stdout] 62 + account.write().unwrap().tokens += *amount; [INFO] [stdout] 63 + Ok(()) [INFO] [stdout] 64 + } else { [INFO] [stdout] 65 + Err("Receiver Account does not exist (Code: 23482309)") [INFO] [stdout] 66 + }; [INFO] [stdout] 67 + } [INFO] [stdout] 68 + [INFO] [stdout] 69 + TransactionData::TransferTokens { to, amount } => { [INFO] [stdout] 70 + let recv_tokens: u128; [INFO] [stdout] 71 + let sender_tokens: u128; [INFO] [stdout] 72 + [INFO] [stdout] 73 + if let Some(recv) = world_state.get_account_by_id(to) { [INFO] [stdout] 74 + // Be extra careful here, even in the genesis block the sender account has to exist [INFO] [stdout] 75 + recv_tokens = recv.read().unwrap().tokens; [INFO] [stdout] 76 + } else { [INFO] [stdout] 77 + return Err("Receiver Account does not exist! (Code: 3242342380)"); [INFO] [stdout] 78 + } [INFO] [stdout] 79 + [INFO] [stdout] 80 + if let Some(sender) = world_state.get_account_by_id(&self.from) { [INFO] [stdout] 81 + sender_tokens = sender.read().unwrap().tokens; [INFO] [stdout] 82 + } else { [INFO] [stdout] 83 + return Err("That account does not exist! (Code: 23423923)"); [INFO] [stdout] 84 + } [INFO] [stdout] 85 + [INFO] [stdout] 86 + let balance_recv_new = recv_tokens.checked_add(*amount); [INFO] [stdout] 87 + let balance_sender_new = sender_tokens.checked_sub(*amount); [INFO] [stdout] 88 + [INFO] [stdout] 89 + return if balance_recv_new.is_some() && balance_sender_new.is_some() { [INFO] [stdout] 90 + world_state.get_account_by_id(&self.from).unwrap().write().unwrap().tokens = balance_sender_new.unwrap(); [INFO] [stdout] 91 + world_state.get_account_by_id(to).unwrap().write().unwrap().tokens = balance_recv_new.unwrap(); [INFO] [stdout] 92 + Ok(()) [INFO] [stdout] 93 + } else { [INFO] [stdout] 94 + Err("Overspent or Arithmetic error (Code: 48239084203)") [INFO] [stdout] 95 + }; [INFO] [stdout] 96 + } [INFO] [stdout] 97 + [INFO] [stdout] 98 + _ => { // Not implemented transaction type [INFO] [stdout] 99 + Err("Unknown Transaction type (not implemented) (Code: 487289724389)") [INFO] [stdout] 100 + } [INFO] [stdout] 101 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> basic_blockchain_example/src/structures/account.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | / return Self { [INFO] [stdout] 23 | | tokens: 0, [INFO] [stdout] 24 | | acc_type: account_type, [INFO] [stdout] 25 | | store: HashMap::new() [INFO] [stdout] 26 | | } [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] 22 ~ Self { [INFO] [stdout] 23 + tokens: 0, [INFO] [stdout] 24 + acc_type: account_type, [INFO] [stdout] 25 + store: HashMap::new() [INFO] [stdout] 26 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> basic_blockchain_example/src/structures.rs:9:35 [INFO] [stdout] | [INFO] [stdout] 9 | pub fn byte_vector_to_string(arr: &Vec) -> String { [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 byte_vector_to_string(arr: &Vec) -> String { [INFO] [stdout] 9 + pub fn byte_vector_to_string(arr: &[u8]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> learning/src/concurrency.rs:4:1 [INFO] [stdout] | [INFO] [stdout] 4 | / /// Manually implementing Sync and Send is not safe [INFO] [stdout] 5 | | [INFO] [stdout] | |_^ [INFO] [stdout] 6 | pub mod concurrent_work_with_threads; [INFO] [stdout] | ------------------------------------ the comment documents this module [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] help: if the comment should document the parent module use an inner doc comment [INFO] [stdout] | [INFO] [stdout] 1 ~ //! Traits [INFO] [stdout] 2 ~ //! Send - allow to send the data between threads (channels) [INFO] [stdout] 3 ~ //! Sync - we can access the type safely from different threads [INFO] [stdout] 4 ~ //! Manually implementing Sync and Send is not safe [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::cell::RefCell` [INFO] [stdout] --> learning/src/oop/pattern_state_example.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::cell::RefCell; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::ops::Add` [INFO] [stdout] --> learning/src/oop/pattern_state_example.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | use std::ops::Add; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> learning/src/advanced_traits/default_common_types_and_operator_overload.rs:3:1 [INFO] [stdout] | [INFO] [stdout] 3 | / /// For add the type is , meaning by default other type will be itself [INFO] [stdout] 4 | | /* [INFO] [stdout] 5 | | trait Add { [INFO] [stdout] 6 | | type Output; [INFO] [stdout] ... | [INFO] [stdout] 10 | | */ [INFO] [stdout] 11 | | [INFO] [stdout] | |_^ [INFO] [stdout] 12 | use std::ops::Add; [INFO] [stdout] | - the comment documents this `use` import [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] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the doc comment should not document the following item then comment it out [INFO] [stdout] | [INFO] [stdout] 1 ~ // /// default type could be point out by using [INFO] [stdout] 2 ~ // /// We can overload operators, like + by using function trait Add (std::ops::Add) [INFO] [stdout] 3 ~ // /// For add the type is , meaning by default other type will be itself [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> learning/src/advanced_traits/call_methods_and_functions_with_the_same_name.rs:40:1 [INFO] [stdout] | [INFO] [stdout] 40 | / /// Call functions [INFO] [stdout] 41 | | [INFO] [stdout] | |_^ [INFO] [stdout] 42 | trait Animal { [INFO] [stdout] | ------------ the comment documents this trait [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] = help: if the empty line is unintentional, remove it [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> basic_blockchain_example/src/main.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | use basic_blockchain_example; [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: this import is redundant [INFO] [stdout] --> basic_blockchain_example/src/main.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | use basic_blockchain_example; [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] [stderr] Compiling devise_core v0.4.1 [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> basic_blockchain_example/src/main.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 60 | / match transaction_data.record { [INFO] [stdout] 61 | | TransactionData::TransferTokens {to:_, ref mut amount} => { [INFO] [stdout] 62 | | *amount = 100; // Actually change the value in place [INFO] [stdout] 63 | | }, [INFO] [stdout] 64 | | [INFO] [stdout] 65 | | _ => {} // We know that that recors is a TransferToken Action so we ignore the rest [INFO] [stdout] 66 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 60 ~ if let TransactionData::TransferTokens {to:_, ref mut amount} = transaction_data.record { [INFO] [stdout] 61 + *amount = 100; // Actually change the value in place [INFO] [stdout] 62 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> basic_blockchain_example/src/main.rs:81:5 [INFO] [stdout] | [INFO] [stdout] 81 | / match transaction_data.record { [INFO] [stdout] 82 | | TransactionData::CreateTokens {receiver: _, ref mut amount} => { [INFO] [stdout] 83 | | *amount = 100_000_000_000; // Let's dont be small on that [INFO] [stdout] 84 | | }, [INFO] [stdout] 85 | | _ => {} // We know that that record is a Token Create Action so we ignore the rest [INFO] [stdout] 86 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 81 ~ if let TransactionData::CreateTokens {receiver: _, ref mut amount} = transaction_data.record { [INFO] [stdout] 82 + *amount = 100_000_000_000; // Let's dont be small on that [INFO] [stdout] 83 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> basic_blockchain_example/src/main.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 60 | / match transaction_data.record { [INFO] [stdout] 61 | | TransactionData::TransferTokens {to:_, ref mut amount} => { [INFO] [stdout] 62 | | *amount = 100; // Actually change the value in place [INFO] [stdout] 63 | | }, [INFO] [stdout] 64 | | [INFO] [stdout] 65 | | _ => {} // We know that that recors is a TransferToken Action so we ignore the rest [INFO] [stdout] 66 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 60 ~ if let TransactionData::TransferTokens {to:_, ref mut amount} = transaction_data.record { [INFO] [stdout] 61 + *amount = 100; // Actually change the value in place [INFO] [stdout] 62 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ThreadPool` [INFO] [stdout] --> server_with_standard_library/src/lib.rs:101:5 [INFO] [stdout] | [INFO] [stdout] 101 | / pub fn new() -> ThreadPool { [INFO] [stdout] 102 | | ThreadPool::build(1).unwrap() [INFO] [stdout] 103 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 66 + impl Default for ThreadPool { [INFO] [stdout] 67 + fn default() -> Self { [INFO] [stdout] 68 + Self::new() [INFO] [stdout] 69 + } [INFO] [stdout] 70 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> basic_blockchain_example/src/main.rs:81:5 [INFO] [stdout] | [INFO] [stdout] 81 | / match transaction_data.record { [INFO] [stdout] 82 | | TransactionData::CreateTokens {receiver: _, ref mut amount} => { [INFO] [stdout] 83 | | *amount = 100_000_000_000; // Let's dont be small on that [INFO] [stdout] 84 | | }, [INFO] [stdout] 85 | | _ => {} // We know that that record is a Token Create Action so we ignore the rest [INFO] [stdout] 86 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = note: you might want to preserve the comments from inside the `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 81 ~ if let TransactionData::CreateTokens {receiver: _, ref mut amount} = transaction_data.record { [INFO] [stdout] 82 + *amount = 100_000_000_000; // Let's dont be small on that [INFO] [stdout] 83 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `worker_result` after checking its variant with `is_err` [INFO] [stdout] --> server_with_standard_library/src/lib.rs:88:96 [INFO] [stdout] | [INFO] [stdout] 87 | if worker_result.is_err() { [INFO] [stdout] | ------------------------- help: try: `if let Err() = worker_result` [INFO] [stdout] 88 | return Err(PoolCreationError { msg: format!("Cannot create pool worker: {:?}", worker_result.unwrap_err()) }); [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: variable does not need to be mutable [INFO] [stdout] --> learning/src/collections/string.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let mut s = String::new(); [INFO] [stdout] | ----^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> learning/src/collections/string.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let mut s = String::new(); [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> learning/src/collections/string.rs:5:9 [INFO] [stdout] | [INFO] [stdout] 5 | let s = data.to_string(); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> learning/src/collections/string.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 6 | let s = "initial content".to_string(); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> learning/src/collections/string.rs:7:9 [INFO] [stdout] | [INFO] [stdout] 7 | let s = String::from("initial content"); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> learning/src/collections/string.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | let s = &hello[0..4]; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `another_module` is never used [INFO] [stdout] --> managing_projects/src/bin/third_bin/another_module.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn another_module() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v` [INFO] [stdout] --> learning/src/collections/vector.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 6 | let v: Vec = Vec::new(); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_v` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `macro_v` [INFO] [stdout] --> learning/src/collections/vector.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 9 | let macro_v = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_macro_v` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `pending_transactions` is never read [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 11 | pub struct Blockchain { [INFO] [stdout] | ---------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 21 | pending_transactions: Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Blockchain` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `store` and `acc_type` are never read [INFO] [stdout] --> basic_blockchain_example/src/structures/account.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 7 | pub struct Account { [INFO] [stdout] | ------- fields in this struct [INFO] [stdout] 8 | /// We want the account to be able to store any information we want (Dictionary) [INFO] [stdout] 9 | store: HashMap, [INFO] [stdout] | ^^^^^ [INFO] [stdout] ... [INFO] [stdout] 12 | acc_type: AccountType, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Account` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Blockchain` [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | / pub fn new() -> Self { [INFO] [stdout] 30 | | Blockchain { [INFO] [stdout] 31 | | blocks: Vec::new(), [INFO] [stdout] 32 | | accounts: HashMap::new(), [INFO] [stdout] ... | [INFO] [stdout] 36 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 27 + impl Default for Blockchain { [INFO] [stdout] 28 + fn default() -> Self { [INFO] [stdout] 29 + Self::new() [INFO] [stdout] 30 + } [INFO] [stdout] 31 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `point_integer` [INFO] [stdout] --> learning/src/generics/generic_structures.rs:24:9 [INFO] [stdout] | [INFO] [stdout] 24 | let point_integer = Point {x: 5, y: 10}; [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_point_integer` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `point_float` [INFO] [stdout] --> learning/src/generics/generic_structures.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | let point_float = Point {x: 5.0, y: 10.0}; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_point_float` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `point_combined` [INFO] [stdout] --> learning/src/generics/generic_structures.rs:27:9 [INFO] [stdout] | [INFO] [stdout] 27 | let point_combined = PointCombined{x: 5, y: 10.0}; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_point_combined` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item` [INFO] [stdout] --> learning/src/traits/traits_with_generics.rs:9:33 [INFO] [stdout] | [INFO] [stdout] 9 | pub fn notify_with_restrictions(item: &(impl Summary + Display)) {} [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item` [INFO] [stdout] --> learning/src/traits/traits_with_generics.rs:11:64 [INFO] [stdout] | [INFO] [stdout] 11 | pub fn notify_with_restrictions_generics(item: &T) {} [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `t` [INFO] [stdout] --> learning/src/traits/traits_with_generics.rs:13:78 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn functions_with_complex_generics(t: &T, u: &U) -> i32 { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_t` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `u` [INFO] [stdout] --> learning/src/traits/traits_with_generics.rs:13:85 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn functions_with_complex_generics(t: &T, u: &U) -> i32 { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_u` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `t` [INFO] [stdout] --> learning/src/traits/traits_with_generics.rs:17:35 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn functions_with_where(t: &T, u: &U) -> i32 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_t` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `u` [INFO] [stdout] --> learning/src/traits/traits_with_generics.rs:17:42 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn functions_with_where(t: &T, u: &U) -> i32 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_u` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:52:12 [INFO] [stdout] | [INFO] [stdout] 52 | if !(block.prev_hash == self.get_last_block_hash()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(block.prev_hash != self.get_last_block_hash())` [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: variable `r` is assigned to, but never used [INFO] [stdout] --> learning/src/lifetimes/lifetime_in_functions.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 46 | let r; [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_r` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `r` is never read [INFO] [stdout] --> learning/src/lifetimes/lifetime_in_functions.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | r = &x; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> learning/src/lifetimes/lifetime_in_struct.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | let i = ImportantExcerpt { part: first_sentence }; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> learning/src/lifetimes/static_lifetime.rs:3:9 [INFO] [stdout] | [INFO] [stdout] 3 | let s: &'static str = "I have a static lifetime"; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `expensive_closure` [INFO] [stdout] --> learning/src/closures/closures_as_variables.rs:5:9 [INFO] [stdout] | [INFO] [stdout] 5 | let expensive_closure = |num: u32| -> u32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_expensive_closure` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `add_one_v2` [INFO] [stdout] --> learning/src/closures/closures_as_variables.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | let add_one_v2 = |x: u32| -> u32 { x + 1 }; [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_add_one_v2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Blockchain` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:104:5 [INFO] [stdout] | [INFO] [stdout] 104 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:146:20 [INFO] [stdout] | [INFO] [stdout] 146 | if !(&block.prev_hash == &self.blocks[block_num - 1].hash) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(&block.prev_hash != &self.blocks[block_num - 1].hash)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `b` [INFO] [stdout] --> learning/src/smart_pointers/rc_pointers.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 6 | let b = Cons(3, Box::new(a)); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_b` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `b` [INFO] [stdout] --> learning/src/smart_pointers/rc_pointers.rs:18:9 [INFO] [stdout] | [INFO] [stdout] 18 | let b = ListRc::Cons(3, Rc::clone(&a)); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_b` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `c` [INFO] [stdout] --> learning/src/smart_pointers/rc_pointers.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | let c = ListRc::Cons(4, Rc::clone(&a)); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_c` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `post` [INFO] [stdout] --> learning/src/oop/pattern_state_example.rs:41:27 [INFO] [stdout] | [INFO] [stdout] 41 | fn content<'a>(&self, post: &'a Post) -> &'a str { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_post` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:125:28 [INFO] [stdout] | [INFO] [stdout] 125 | return Err(format!("Stored hash for Block #{} \ [INFO] [stdout] | ____________________________^ [INFO] [stdout] 126 | | does not match calculated hash (Code: 665234234)", block_num + 1).into()); [INFO] [stdout] | |____________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing `.into()` [INFO] [stdout] | [INFO] [stdout] 125 ~ return Err(format!("Stored hash for Block #{} \ [INFO] [stdout] 126 ~ does not match calculated hash (Code: 665234234)", block_num + 1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:139:32 [INFO] [stdout] | [INFO] [stdout] 139 | return Err(format!("Block #{} has no previous hash set", block_num + 1).into()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `format!("Block #{} has no previous hash set", block_num + 1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:146:21 [INFO] [stdout] | [INFO] [stdout] 146 | if !(&block.prev_hash == &self.blocks[block_num - 1].hash) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 146 - if !(&block.prev_hash == &self.blocks[block_num - 1].hash) { [INFO] [stdout] 146 + if !(block.prev_hash == self.blocks[block_num - 1].hash) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:147:32 [INFO] [stdout] | [INFO] [stdout] 147 | return Err(format!("Block #{} is not connected to previous block (Hashes do \ [INFO] [stdout] | ________________________________^ [INFO] [stdout] 148 | | not match. Should be `{}` but is `{}`)", block_num, prev_hash_proposed, [INFO] [stdout] 149 | | prev_hash_actual).into()); [INFO] [stdout] | |_______________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing `.into()` [INFO] [stdout] | [INFO] [stdout] 147 ~ return Err(format!("Block #{} is not connected to previous block (Hashes do \ [INFO] [stdout] 148 + not match. Should be `{}` but is `{}`)", block_num, prev_hash_proposed, [INFO] [stdout] 149 ~ prev_hash_actual)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `feet` [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:73:11 [INFO] [stdout] | [INFO] [stdout] 73 | let ((feet, inches), Point { x, y }) = ((3, 10), Point { x: 3, y: -10 }); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_feet` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `inches` [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:73:17 [INFO] [stdout] | [INFO] [stdout] 73 | let ((feet, inches), Point { x, y }) = ((3, 10), Point { x: 3, y: -10 }); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_inches` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `x` [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:73:34 [INFO] [stdout] | [INFO] [stdout] 73 | let ((feet, inches), Point { x, y }) = ((3, 10), Point { x: 3, y: -10 }); [INFO] [stdout] | ^ help: try ignoring the field: `x: _` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:73:37 [INFO] [stdout] | [INFO] [stdout] 73 | let ((feet, inches), Point { x, y }) = ((3, 10), Point { x: 3, y: -10 }); [INFO] [stdout] | ^ help: try ignoring the field: `y: _` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> learning/src/patterns_mappings/wildcards.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | let y = 10; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `x` [INFO] [stdout] --> learning/src/patterns_mappings/extra_conditions.rs:6:14 [INFO] [stdout] | [INFO] [stdout] 6 | Some(x) => {} [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_x` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `r` [INFO] [stdout] --> learning/src/unsafe_rust/dereference_raw_pointers.rs:15:9 [INFO] [stdout] | [INFO] [stdout] 15 | let r = address as *const i32; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_r` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:170:9 [INFO] [stdout] | [INFO] [stdout] 170 | self.accounts.keys().map(|s| s.clone()).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `self.accounts.keys().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | let f: Box = Box::new(|| println!("hi")); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:16:24 [INFO] [stdout] | [INFO] [stdout] 16 | fn takes_long_type(f: Box) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> basic_blockchain_example/src/structures/blockchain.rs:181:9 [INFO] [stdout] | [INFO] [stdout] 181 | / return if !self.get_user_ids().contains(&id) { [INFO] [stdout] 182 | | let acc = Account::new(account_type); [INFO] [stdout] 183 | | self.accounts.insert(id, Arc::new(RwLock::new(acc))); [INFO] [stdout] 184 | | Ok(()) [INFO] [stdout] 185 | | } else { [INFO] [stdout] 186 | | Err("User already exists! (Code: 934823094)") [INFO] [stdout] 187 | | }; [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] 181 ~ if !self.get_user_ids().contains(&id) { [INFO] [stdout] 182 + let acc = Account::new(account_type); [INFO] [stdout] 183 + self.accounts.insert(id, Arc::new(RwLock::new(acc))); [INFO] [stdout] 184 + Ok(()) [INFO] [stdout] 185 + } else { [INFO] [stdout] 186 + Err("User already exists! (Code: 934823094)") [INFO] [stdout] 187 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | let f: Thunk = Box::new(|| println!("hi")); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:31:24 [INFO] [stdout] | [INFO] [stdout] 31 | fn takes_long_type(f: Thunk) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `dynamic_s1` [INFO] [stdout] --> learning/src/advanced_types/sized_types.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 6 | let dynamic_s1: &str = "str_1"; [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_dynamic_s1` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `dynamic_s2` [INFO] [stdout] --> learning/src/advanced_types/sized_types.rs:7:9 [INFO] [stdout] | [INFO] [stdout] 7 | let dynamic_s2 = Rc::::from("foo"); [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_dynamic_s2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `t` [INFO] [stdout] --> learning/src/advanced_types/sized_types.rs:12:27 [INFO] [stdout] | [INFO] [stdout] 12 | pub fn generic(t: &T) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_t` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v` [INFO] [stdout] --> learning/src/macros/macros_rules.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let v: Vec = vec![1, 2, 3]; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_v` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `value` is never read [INFO] [stdout] --> learning/src/structures.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 21 | pub struct Guess { [INFO] [stdout] | ----- field in this struct [INFO] [stdout] 22 | value: i32, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `update_rewrite_old_values` is never used [INFO] [stdout] --> learning/src/collections/hashmap.rs:42:4 [INFO] [stdout] | [INFO] [stdout] 42 | fn update_rewrite_old_values() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `insert_if_no_key_in_map` is never used [INFO] [stdout] --> learning/src/collections/hashmap.rs:51:4 [INFO] [stdout] | [INFO] [stdout] 51 | fn insert_if_no_key_in_map() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `new_value_based_on_old` is never used [INFO] [stdout] --> learning/src/collections/hashmap.rs:61:4 [INFO] [stdout] | [INFO] [stdout] 61 | fn new_value_based_on_old() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `create_string` is never used [INFO] [stdout] --> learning/src/collections/string.rs:1:4 [INFO] [stdout] | [INFO] [stdout] 1 | fn create_string() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `push_to_string` is never used [INFO] [stdout] --> learning/src/collections/string.rs:10:4 [INFO] [stdout] | [INFO] [stdout] 10 | fn push_to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `create_vector` is never used [INFO] [stdout] --> learning/src/collections/vector.rs:4:4 [INFO] [stdout] | [INFO] [stdout] 4 | fn create_vector() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `change_vector` is never used [INFO] [stdout] --> learning/src/collections/vector.rs:12:4 [INFO] [stdout] | [INFO] [stdout] 12 | fn change_vector() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_values_from_vector` is never used [INFO] [stdout] --> learning/src/collections/vector.rs:22:4 [INFO] [stdout] | [INFO] [stdout] 22 | fn get_values_from_vector() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `iterate_over_vector` is never used [INFO] [stdout] --> learning/src/collections/vector.rs:37:4 [INFO] [stdout] | [INFO] [stdout] 37 | fn iterate_over_vector() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `enums_to_store_different_types` is never used [INFO] [stdout] --> learning/src/collections/vector.rs:55:4 [INFO] [stdout] | [INFO] [stdout] 55 | fn enums_to_store_different_types() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `crash_and_burn` is never used [INFO] [stdout] --> learning/src/exceptions/non_recoverable_panic.rs:13:4 [INFO] [stdout] | [INFO] [stdout] 13 | fn crash_and_burn() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `reverse_trace_panic` is never used [INFO] [stdout] --> learning/src/exceptions/non_recoverable_panic.rs:17:4 [INFO] [stdout] | [INFO] [stdout] 17 | fn reverse_trace_panic() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Point` is never constructed [INFO] [stdout] --> learning/src/generics/generic_structures.rs:13:8 [INFO] [stdout] | [INFO] [stdout] 13 | struct Point { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `PointCombined` is never constructed [INFO] [stdout] --> learning/src/generics/generic_structures.rs:18:8 [INFO] [stdout] | [INFO] [stdout] 18 | struct PointCombined { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `declare_structure` is never used [INFO] [stdout] --> learning/src/generics/generic_structures.rs:23:4 [INFO] [stdout] | [INFO] [stdout] 23 | fn declare_structure() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Point` is never constructed [INFO] [stdout] --> learning/src/generics/generic_methods.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | struct Point { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `x` is never used [INFO] [stdout] --> learning/src/generics/generic_methods.rs:7:8 [INFO] [stdout] | [INFO] [stdout] 6 | impl Point { [INFO] [stdout] | ---------------- method in this implementation [INFO] [stdout] 7 | fn x(&self) -> &T { [INFO] [stdout] | ^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `distance_from_origin` is never used [INFO] [stdout] --> learning/src/generics/generic_methods.rs:14:8 [INFO] [stdout] | [INFO] [stdout] 13 | impl Point { [INFO] [stdout] | --------------- method in this implementation [INFO] [stdout] 14 | fn distance_from_origin(&self) -> f32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `non_compiled_example` is never used [INFO] [stdout] --> learning/src/lifetimes/lifetime_in_functions.rs:45:4 [INFO] [stdout] | [INFO] [stdout] 45 | fn non_compiled_example() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `call` is never used [INFO] [stdout] --> learning/src/lifetimes/lifetime_in_struct.rs:5:4 [INFO] [stdout] | [INFO] [stdout] 5 | fn call() { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `first_word` is never used [INFO] [stdout] --> learning/src/lifetimes/lifetime_elision.rs:8:4 [INFO] [stdout] | [INFO] [stdout] 8 | fn first_word<'a>(s: &'a str) -> &'a str { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `return_part` is never used [INFO] [stdout] --> learning/src/lifetimes/lifetime_in_methods.rs:6:8 [INFO] [stdout] | [INFO] [stdout] 5 | impl<'a> ImportantExcerpt<'a> { [INFO] [stdout] | ----------------------------- method in this implementation [INFO] [stdout] 6 | fn return_part(&self, announcement: &str) -> &str { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `example` is never used [INFO] [stdout] --> learning/src/lifetimes/static_lifetime.rs:1:4 [INFO] [stdout] | [INFO] [stdout] 1 | fn example() { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `example_closure_with_variable` is never used [INFO] [stdout] --> learning/src/closures/closures_as_variables.rs:4:4 [INFO] [stdout] | [INFO] [stdout] 4 | fn example_closure_with_variable() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `example_with_and_without_type_annotation` is never used [INFO] [stdout] --> learning/src/closures/closures_as_variables.rs:12:4 [INFO] [stdout] | [INFO] [stdout] 12 | fn example_with_and_without_type_annotation() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `height` is never read [INFO] [stdout] --> learning/src/closures/links_and_ownership.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 38 | struct Rectangle { [INFO] [stdout] | --------- field in this struct [INFO] [stdout] 39 | width: u32, [INFO] [stdout] 40 | height: u32, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Rectangle` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> basic_blockchain_example/src/structures/world_state.rs:16:37 [INFO] [stdout] | [INFO] [stdout] 16 | fn get_account_by_id(&self, id: &String) -> Option>>; [INFO] [stdout] | ^^^^^^^ help: change this to: `&str` [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] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `balance_sender_new` after checking its variant with `is_some` [INFO] [stdout] --> basic_blockchain_example/src/structures/transaction.rs:90:98 [INFO] [stdout] | [INFO] [stdout] 89 | return if balance_recv_new.is_some() && balance_sender_new.is_some() { [INFO] [stdout] | ---------------------------- the check is happening here [INFO] [stdout] 90 | world_state.get_account_by_id(&self.from).unwrap().write().unwrap().tokens = balance_sender_new.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [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: called `unwrap` on `balance_recv_new` after checking its variant with `is_some` [INFO] [stdout] --> basic_blockchain_example/src/structures/transaction.rs:91:90 [INFO] [stdout] | [INFO] [stdout] 89 | return if balance_recv_new.is_some() && balance_sender_new.is_some() { [INFO] [stdout] | -------------------------- the check is happening here [INFO] [stdout] 90 | world_state.get_account_by_id(&self.from).unwrap().write().unwrap().tokens = balance_sender_new.unwrap(); [INFO] [stdout] 91 | world_state.get_account_by_id(to).unwrap().write().unwrap().tokens = balance_recv_new.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [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] --> basic_blockchain_example/src/structures/transaction.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | / return match &self.record { [INFO] [stdout] 52 | | TransactionData::CreateUserAccount(account) => { [INFO] [stdout] 53 | | world_state.create_account(account.into(), AccountType::User) [INFO] [stdout] ... | [INFO] [stdout] 101 | | }; [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] 51 ~ match &self.record { [INFO] [stdout] 52 + TransactionData::CreateUserAccount(account) => { [INFO] [stdout] 53 + world_state.create_account(account.into(), AccountType::User) [INFO] [stdout] 54 + } [INFO] [stdout] 55 + [INFO] [stdout] 56 + TransactionData::CreateTokens { receiver, amount } => { [INFO] [stdout] 57 + if !is_initial { [INFO] [stdout] 58 + return Err("Token creation is only available on initial creation (Code: 2394233)"); [INFO] [stdout] 59 + } [INFO] [stdout] 60 + // Get the receiving user (must exist) [INFO] [stdout] 61 + return if let Some(account) = world_state.get_account_by_id(receiver) { [INFO] [stdout] 62 + account.write().unwrap().tokens += *amount; [INFO] [stdout] 63 + Ok(()) [INFO] [stdout] 64 + } else { [INFO] [stdout] 65 + Err("Receiver Account does not exist (Code: 23482309)") [INFO] [stdout] 66 + }; [INFO] [stdout] 67 + } [INFO] [stdout] 68 + [INFO] [stdout] 69 + TransactionData::TransferTokens { to, amount } => { [INFO] [stdout] 70 + let recv_tokens: u128; [INFO] [stdout] 71 + let sender_tokens: u128; [INFO] [stdout] 72 + [INFO] [stdout] 73 + if let Some(recv) = world_state.get_account_by_id(to) { [INFO] [stdout] 74 + // Be extra careful here, even in the genesis block the sender account has to exist [INFO] [stdout] 75 + recv_tokens = recv.read().unwrap().tokens; [INFO] [stdout] 76 + } else { [INFO] [stdout] 77 + return Err("Receiver Account does not exist! (Code: 3242342380)"); [INFO] [stdout] 78 + } [INFO] [stdout] 79 + [INFO] [stdout] 80 + if let Some(sender) = world_state.get_account_by_id(&self.from) { [INFO] [stdout] 81 + sender_tokens = sender.read().unwrap().tokens; [INFO] [stdout] 82 + } else { [INFO] [stdout] 83 + return Err("That account does not exist! (Code: 23423923)"); [INFO] [stdout] 84 + } [INFO] [stdout] 85 + [INFO] [stdout] 86 + let balance_recv_new = recv_tokens.checked_add(*amount); [INFO] [stdout] 87 + let balance_sender_new = sender_tokens.checked_sub(*amount); [INFO] [stdout] 88 + [INFO] [stdout] 89 + return if balance_recv_new.is_some() && balance_sender_new.is_some() { [INFO] [stdout] 90 + world_state.get_account_by_id(&self.from).unwrap().write().unwrap().tokens = balance_sender_new.unwrap(); [INFO] [stdout] 91 + world_state.get_account_by_id(to).unwrap().write().unwrap().tokens = balance_recv_new.unwrap(); [INFO] [stdout] 92 + Ok(()) [INFO] [stdout] 93 + } else { [INFO] [stdout] 94 + Err("Overspent or Arithmetic error (Code: 48239084203)") [INFO] [stdout] 95 + }; [INFO] [stdout] 96 + } [INFO] [stdout] 97 + [INFO] [stdout] 98 + _ => { // Not implemented transaction type [INFO] [stdout] 99 + Err("Unknown Transaction type (not implemented) (Code: 487289724389)") [INFO] [stdout] 100 + } [INFO] [stdout] 101 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `1` is never read [INFO] [stdout] --> learning/src/smart_pointers/rc_pointers.rs:11:13 [INFO] [stdout] | [INFO] [stdout] 11 | Cons(T, Rc>), [INFO] [stdout] | ---- ^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 11 - Cons(T, Rc>), [INFO] [stdout] 11 + Cons(T, ()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `0` and `1` are never read [INFO] [stdout] --> learning/src/smart_pointers/rc_with_refcell.rs:6:10 [INFO] [stdout] | [INFO] [stdout] 6 | Cons(Rc>, Rc), [INFO] [stdout] | ---- ^^^^^^^^^^^^^^^^ ^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | fields in this variant [INFO] [stdout] | [INFO] [stdout] = note: `List` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields [INFO] [stdout] | [INFO] [stdout] 6 - Cons(Rc>, Rc), [INFO] [stdout] 6 + Cons((), ()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `reject` is never used [INFO] [stdout] --> learning/src/oop/pattern_state_example.rs:44:8 [INFO] [stdout] | [INFO] [stdout] 38 | trait State { [INFO] [stdout] | ----- method in this trait [INFO] [stdout] ... [INFO] [stdout] 44 | fn reject(self: Box) -> Box; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Rejected` is never constructed [INFO] [stdout] --> learning/src/oop/pattern_state_example.rs:106:8 [INFO] [stdout] | [INFO] [stdout] 106 | struct Rejected {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Point` is never constructed [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | struct Point { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Color` is never used [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:6:6 [INFO] [stdout] | [INFO] [stdout] 6 | enum Color { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Message` is never used [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:11:6 [INFO] [stdout] | [INFO] [stdout] 11 | enum Message { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `desctructurization_struct` is never used [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:19:8 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn desctructurization_struct() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `desctructurization_struct_shorter` is never used [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:27:8 [INFO] [stdout] | [INFO] [stdout] 27 | pub fn desctructurization_struct_shorter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `desctructurization_struct_with_match` is never used [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:35:8 [INFO] [stdout] | [INFO] [stdout] 35 | pub fn desctructurization_struct_with_match() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `desctructurization_enum` is never used [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:47:8 [INFO] [stdout] | [INFO] [stdout] 47 | pub fn desctructurization_enum() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `desctructurization_tuples` is never used [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:72:8 [INFO] [stdout] | [INFO] [stdout] 72 | pub fn desctructurization_tuples() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `y` and `z` are never read [INFO] [stdout] --> learning/src/patterns_mappings/wildcards.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 1 | struct Point { [INFO] [stdout] | ----- fields in this struct [INFO] [stdout] 2 | x: i32, [INFO] [stdout] 3 | y: i32, [INFO] [stdout] | ^ [INFO] [stdout] 4 | z: i32, [INFO] [stdout] | ^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Millimeters` is never constructed [INFO] [stdout] --> learning/src/advanced_traits/default_common_types_and_operator_overload.rs:39:8 [INFO] [stdout] | [INFO] [stdout] 39 | struct Millimeters(u32); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Meters` is never constructed [INFO] [stdout] --> learning/src/advanced_traits/default_common_types_and_operator_overload.rs:40:8 [INFO] [stdout] | [INFO] [stdout] 40 | struct Meters(u32); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `baby_name` is never used [INFO] [stdout] --> learning/src/advanced_traits/call_methods_and_functions_with_the_same_name.rs:49:8 [INFO] [stdout] | [INFO] [stdout] 48 | impl Dog { [INFO] [stdout] | -------- associated function in this implementation [INFO] [stdout] 49 | fn baby_name() -> String { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `takes_long_type` is never used [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:16:8 [INFO] [stdout] | [INFO] [stdout] 16 | fn takes_long_type(f: Box) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `returns_long_type` is never used [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:20:8 [INFO] [stdout] | [INFO] [stdout] 20 | fn returns_long_type() -> Box { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `takes_long_type` is never used [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:31:8 [INFO] [stdout] | [INFO] [stdout] 31 | fn takes_long_type(f: Thunk) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `returns_long_type` is never used [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:35:8 [INFO] [stdout] | [INFO] [stdout] 35 | fn returns_long_type() -> Thunk { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `Result` is never used [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:42:10 [INFO] [stdout] | [INFO] [stdout] 42 | type Result = std::result::Result; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Write` is never used [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:44:15 [INFO] [stdout] | [INFO] [stdout] 44 | pub trait Write { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> learning/src/advanced_functions_and_closures/function_pointer.rs:23:15 [INFO] [stdout] | [INFO] [stdout] 23 | Value(u32), [INFO] [stdout] | ----- ^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 23 - Value(u32), [INFO] [stdout] 23 + Value(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Stop` is never constructed [INFO] [stdout] --> learning/src/advanced_functions_and_closures/function_pointer.rs:24:9 [INFO] [stdout] | [INFO] [stdout] 22 | enum Status { [INFO] [stdout] | ------ variant in this enum [INFO] [stdout] 23 | Value(u32), [INFO] [stdout] 24 | Stop, [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `returns_closure` is never used [INFO] [stdout] --> learning/src/advanced_functions_and_closures/return_closures.rs:3:4 [INFO] [stdout] | [INFO] [stdout] 3 | fn returns_closure() -> Box i32> { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> learning/src/structures.rs:27:12 [INFO] [stdout] | [INFO] [stdout] 27 | if value < 1 || value > 100 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=100).contains(&value)` [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: unneeded `return` statement [INFO] [stdout] --> basic_blockchain_example/src/structures/account.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | / return Self { [INFO] [stdout] 23 | | tokens: 0, [INFO] [stdout] 24 | | acc_type: account_type, [INFO] [stdout] 25 | | store: HashMap::new() [INFO] [stdout] 26 | | } [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] 22 ~ Self { [INFO] [stdout] 23 + tokens: 0, [INFO] [stdout] 24 + acc_type: account_type, [INFO] [stdout] 25 + store: HashMap::new() [INFO] [stdout] 26 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> managing_projects/tests/rand_math.rs:3:1 [INFO] [stdout] | [INFO] [stdout] 3 | use managing_projects; [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> basic_blockchain_example/src/structures.rs:9:35 [INFO] [stdout] | [INFO] [stdout] 9 | pub fn byte_vector_to_string(arr: &Vec) -> String { [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 byte_vector_to_string(arr: &Vec) -> String { [INFO] [stdout] 9 + pub fn byte_vector_to_string(arr: &[u8]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> learning/src/collections/vector.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | / let mut v = Vec::new(); [INFO] [stdout] 15 | | [INFO] [stdout] 16 | | v.push(5); [INFO] [stdout] 17 | | v.push(6); [INFO] [stdout] 18 | | v.push(7); [INFO] [stdout] 19 | | v.push(8); [INFO] [stdout] | |______________^ help: consider using the `vec![]` macro: `let v = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: statement with no effect [INFO] [stdout] --> learning/src/exceptions/non_recoverable_panic.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | v[99]; // code will produce panic! [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect [INFO] [stdout] = note: `#[warn(clippy::no_effect)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> learning/src/exceptions/propagating_error.rs:8:29 [INFO] [stdout] | [INFO] [stdout] 8 | let mut username_file = match username_file_result { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 9 | | Ok(fs) => fs, [INFO] [stdout] 10 | | Err(e) => return Err(e), [INFO] [stdout] 11 | | }; [INFO] [stdout] | |_____^ help: try instead: `username_file_result?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> learning/src/lifetimes/lifetime_elision.rs:8:15 [INFO] [stdout] | [INFO] [stdout] 8 | fn first_word<'a>(s: &'a str) -> &'a str { [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] 8 - fn first_word<'a>(s: &'a str) -> &'a str { [INFO] [stdout] 8 + fn first_word(s: &str) -> &str { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant slicing of the whole range [INFO] [stdout] --> learning/src/lifetimes/lifetime_elision.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | &s[..] [INFO] [stdout] | ^^^^^^ help: use the original value instead: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing [INFO] [stdout] = note: `#[warn(clippy::redundant_slicing)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> managing_projects/src/main.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | use managing_projects; [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: unused import: `managing_projects` [INFO] [stdout] --> managing_projects/src/main.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use managing_projects; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `another_module` is never used [INFO] [stdout] --> managing_projects/src/bin/third_bin/another_module.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn another_module() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> managing_projects/src/main.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | use managing_projects; [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: unused import: `managing_projects` [INFO] [stdout] --> managing_projects/src/main.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use managing_projects; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Post` [INFO] [stdout] --> learning/src/oop/pattern_state_example.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | / pub fn new() -> Post { [INFO] [stdout] 11 | | Post { [INFO] [stdout] 12 | | state: Some(Box::new(Draft {})), [INFO] [stdout] 13 | | content: String::new(), [INFO] [stdout] 14 | | } [INFO] [stdout] 15 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 9 + impl Default for Post { [INFO] [stdout] 10 + fn default() -> Self { [INFO] [stdout] 11 + Self::new() [INFO] [stdout] 12 + } [INFO] [stdout] 13 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `new` usually return `Self` [INFO] [stdout] --> learning/src/oop/pattern_state_example_with_types_change.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | / pub fn new() -> DraftPost { [INFO] [stdout] 11 | | DraftPost { [INFO] [stdout] 12 | | content: String::new(), [INFO] [stdout] 13 | | } [INFO] [stdout] 14 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_ret_no_self [INFO] [stdout] = note: `#[warn(clippy::new_ret_no_self)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be written as a `let` statement [INFO] [stdout] --> learning/src/patterns_mappings/wildcards.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | / match numbers { [INFO] [stdout] 31 | | (first, _, third, _, fifth) => { [INFO] [stdout] 32 | | println!("Some numbers: {first}, {third}, {fifth}") [INFO] [stdout] 33 | | } [INFO] [stdout] 34 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using a `let` statement [INFO] [stdout] | [INFO] [stdout] 30 ~ let (first, _, third, _, fifth) = numbers; [INFO] [stdout] 31 + println!("Some numbers: {first}, {third}, {fifth}") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> learning/src/patterns_mappings/wildcards.rs:45:12 [INFO] [stdout] | [INFO] [stdout] 45 | if let Some(_) = s { [INFO] [stdout] | -------^^^^^^^---- help: try: `if s.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `sender` [INFO] [stdout] --> server_with_standard_library/src/lib.rs:126:14 [INFO] [stdout] | [INFO] [stdout] 126 | let (sender, receiver) = mpsc::channel(); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_sender` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be written as a `let` statement [INFO] [stdout] --> learning/src/patterns_mappings/wildcards.rs:55:5 [INFO] [stdout] | [INFO] [stdout] 55 | / match origin { [INFO] [stdout] 56 | | Point { x, .. } => println!("x is {x}"), [INFO] [stdout] 57 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] help: consider using a `let` statement [INFO] [stdout] | [INFO] [stdout] 55 ~ let Point { x, .. } = origin; [INFO] [stdout] 56 + println!("x is {x}"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ThreadPool` [INFO] [stdout] --> server_with_standard_library/src/lib.rs:101:5 [INFO] [stdout] | [INFO] [stdout] 101 | / pub fn new() -> ThreadPool { [INFO] [stdout] 102 | | ThreadPool::build(1).unwrap() [INFO] [stdout] 103 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 66 + impl Default for ThreadPool { [INFO] [stdout] 67 + fn default() -> Self { [INFO] [stdout] 68 + Self::new() [INFO] [stdout] 69 + } [INFO] [stdout] 70 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap_err` on `worker_result` after checking its variant with `is_err` [INFO] [stdout] --> server_with_standard_library/src/lib.rs:88:96 [INFO] [stdout] | [INFO] [stdout] 87 | if worker_result.is_err() { [INFO] [stdout] | ------------------------- help: try: `if let Err() = worker_result` [INFO] [stdout] 88 | return Err(PoolCreationError { msg: format!("Cannot create pool worker: {:?}", worker_result.unwrap_err()) }); [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 match could be written as a `let` statement [INFO] [stdout] --> learning/src/patterns_mappings/wildcards.rs:61:5 [INFO] [stdout] | [INFO] [stdout] 61 | / match numbers { [INFO] [stdout] 62 | | (first, .., last) => { [INFO] [stdout] 63 | | println!("Some numbers: {first}, {last}"); [INFO] [stdout] 64 | | } [INFO] [stdout] 65 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] help: consider using a `let` statement [INFO] [stdout] | [INFO] [stdout] 61 ~ let (first, .., last) = numbers; [INFO] [stdout] 62 + { [INFO] [stdout] 63 + println!("Some numbers: {first}, {last}"); [INFO] [stdout] 64 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this OR pattern can be rewritten using a range [INFO] [stdout] --> learning/src/patterns_mappings/extra_conditions.rs:27:9 [INFO] [stdout] | [INFO] [stdout] 27 | 4 | 5 | 6 if y => println!("yes"), [INFO] [stdout] | ^^^^^^^^^ help: try: `4..=6` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns [INFO] [stdout] = note: `#[warn(clippy::manual_range_patterns)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> learning/src/collections/vector.rs:9:19 [INFO] [stdout] | [INFO] [stdout] 9 | let macro_v = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> learning/src/collections/vector.rs:23:13 [INFO] [stdout] | [INFO] [stdout] 23 | let v = vec![1, 2, 3, 4, 5]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3, 4, 5]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> learning/src/exceptions/non_recoverable_panic.rs:18:13 [INFO] [stdout] | [INFO] [stdout] 18 | let v = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> learning/src/iterator/trait_iterator_and_next.rs:18:16 [INFO] [stdout] | [INFO] [stdout] 18 | let list = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> learning/src/advanced_functions_and_closures/function_pointer.rs:16:23 [INFO] [stdout] | [INFO] [stdout] 16 | let vec_example = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing [INFO] [stdout] --> learning/src/unsafe_rust/call_unsafe_functions_or_methods.rs:10:9 [INFO] [stdout] | [INFO] [stdout] 10 | drop(*ptr); [INFO] [stdout] | ^^^^^----^ [INFO] [stdout] | | [INFO] [stdout] | argument has type `i32` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dropping_copy_types)]` on by default [INFO] [stdout] help: use `let _ = ...` to ignore the expression or result [INFO] [stdout] | [INFO] [stdout] 10 - drop(*ptr); [INFO] [stdout] 10 + let _ = *ptr; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> learning/src/unsafe_rust/access_change_static_variables.rs:13:29 [INFO] [stdout] | [INFO] [stdout] 13 | println!("COUNTER: {COUNTER}"); [INFO] [stdout] | ^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused return value of `std::iter::Iterator::collect` that must be used [INFO] [stdout] --> learning/src/advanced_functions_and_closures/function_pointer.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | vec_example.iter().map(|i| i.to_string()).collect::(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: if you really need to exhaust the iterator, consider `.for_each(drop)` instead [INFO] [stdout] = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 17 | let _ = vec_example.iter().map(|i| i.to_string()).collect::(); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused return value of `std::iter::Iterator::collect` that must be used [INFO] [stdout] --> learning/src/advanced_functions_and_closures/function_pointer.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | vec_example.iter().map(ToString::to_string).collect::(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: if you really need to exhaust the iterator, consider `.for_each(drop)` instead [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 18 | let _ = vec_example.iter().map(ToString::to_string).collect::(); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> learning/src/concurrency.rs:4:1 [INFO] [stdout] | [INFO] [stdout] 4 | / /// Manually implementing Sync and Send is not safe [INFO] [stdout] 5 | | [INFO] [stdout] | |_^ [INFO] [stdout] 6 | pub mod concurrent_work_with_threads; [INFO] [stdout] | ------------------------------------ the comment documents this module [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] help: if the comment should document the parent module use an inner doc comment [INFO] [stdout] | [INFO] [stdout] 1 ~ //! Traits [INFO] [stdout] 2 ~ //! Send - allow to send the data between threads (channels) [INFO] [stdout] 3 ~ //! Sync - we can access the type safely from different threads [INFO] [stdout] 4 ~ //! Manually implementing Sync and Send is not safe [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::cell::RefCell` [INFO] [stdout] --> learning/src/oop/pattern_state_example.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use std::cell::RefCell; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::ops::Add` [INFO] [stdout] --> learning/src/oop/pattern_state_example.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | use std::ops::Add; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> learning/src/advanced_traits/default_common_types_and_operator_overload.rs:3:1 [INFO] [stdout] | [INFO] [stdout] 3 | / /// For add the type is , meaning by default other type will be itself [INFO] [stdout] 4 | | /* [INFO] [stdout] 5 | | trait Add { [INFO] [stdout] 6 | | type Output; [INFO] [stdout] ... | [INFO] [stdout] 10 | | */ [INFO] [stdout] 11 | | [INFO] [stdout] | |_^ [INFO] [stdout] 12 | use std::ops::Add; [INFO] [stdout] | - the comment documents this `use` import [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] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the doc comment should not document the following item then comment it out [INFO] [stdout] | [INFO] [stdout] 1 ~ // /// default type could be point out by using [INFO] [stdout] 2 ~ // /// We can overload operators, like + by using function trait Add (std::ops::Add) [INFO] [stdout] 3 ~ // /// For add the type is , meaning by default other type will be itself [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> learning/src/advanced_traits/call_methods_and_functions_with_the_same_name.rs:40:1 [INFO] [stdout] | [INFO] [stdout] 40 | / /// Call functions [INFO] [stdout] 41 | | [INFO] [stdout] | |_^ [INFO] [stdout] 42 | trait Animal { [INFO] [stdout] | ------------ the comment documents this trait [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] = help: if the empty line is unintentional, remove it [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> learning/src/collections/string.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let mut s = String::new(); [INFO] [stdout] | ----^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> learning/src/collections/string.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let mut s = String::new(); [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> learning/src/collections/string.rs:5:9 [INFO] [stdout] | [INFO] [stdout] 5 | let s = data.to_string(); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> learning/src/collections/string.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 6 | let s = "initial content".to_string(); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> learning/src/collections/string.rs:7:9 [INFO] [stdout] | [INFO] [stdout] 7 | let s = String::from("initial content"); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> learning/src/collections/string.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | let s = &hello[0..4]; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> learning/tests/integration_test.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | use learning; [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: unused variable: `v` [INFO] [stdout] --> learning/src/collections/vector.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 6 | let v: Vec = Vec::new(); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_v` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `macro_v` [INFO] [stdout] --> learning/src/collections/vector.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 9 | let macro_v = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_macro_v` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `point_integer` [INFO] [stdout] --> learning/src/generics/generic_structures.rs:24:9 [INFO] [stdout] | [INFO] [stdout] 24 | let point_integer = Point {x: 5, y: 10}; [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_point_integer` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `point_float` [INFO] [stdout] --> learning/src/generics/generic_structures.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | let point_float = Point {x: 5.0, y: 10.0}; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_point_float` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `point_combined` [INFO] [stdout] --> learning/src/generics/generic_structures.rs:27:9 [INFO] [stdout] | [INFO] [stdout] 27 | let point_combined = PointCombined{x: 5, y: 10.0}; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_point_combined` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item` [INFO] [stdout] --> learning/src/traits/traits_with_generics.rs:9:33 [INFO] [stdout] | [INFO] [stdout] 9 | pub fn notify_with_restrictions(item: &(impl Summary + Display)) {} [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item` [INFO] [stdout] --> learning/src/traits/traits_with_generics.rs:11:64 [INFO] [stdout] | [INFO] [stdout] 11 | pub fn notify_with_restrictions_generics(item: &T) {} [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `t` [INFO] [stdout] --> learning/src/traits/traits_with_generics.rs:13:78 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn functions_with_complex_generics(t: &T, u: &U) -> i32 { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_t` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `u` [INFO] [stdout] --> learning/src/traits/traits_with_generics.rs:13:85 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn functions_with_complex_generics(t: &T, u: &U) -> i32 { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_u` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `t` [INFO] [stdout] --> learning/src/traits/traits_with_generics.rs:17:35 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn functions_with_where(t: &T, u: &U) -> i32 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_t` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `u` [INFO] [stdout] --> learning/src/traits/traits_with_generics.rs:17:42 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn functions_with_where(t: &T, u: &U) -> i32 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_u` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `r` is assigned to, but never used [INFO] [stdout] --> learning/src/lifetimes/lifetime_in_functions.rs:46:9 [INFO] [stdout] | [INFO] [stdout] 46 | let r; [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_r` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `r` is never read [INFO] [stdout] --> learning/src/lifetimes/lifetime_in_functions.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | r = &x; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> learning/src/lifetimes/lifetime_in_struct.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | let i = ImportantExcerpt { part: first_sentence }; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> learning/src/lifetimes/static_lifetime.rs:3:9 [INFO] [stdout] | [INFO] [stdout] 3 | let s: &'static str = "I have a static lifetime"; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `expensive_closure` [INFO] [stdout] --> learning/src/closures/closures_as_variables.rs:5:9 [INFO] [stdout] | [INFO] [stdout] 5 | let expensive_closure = |num: u32| -> u32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_expensive_closure` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `add_one_v2` [INFO] [stdout] --> learning/src/closures/closures_as_variables.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | let add_one_v2 = |x: u32| -> u32 { x + 1 }; [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_add_one_v2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `b` [INFO] [stdout] --> learning/src/smart_pointers/rc_pointers.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 6 | let b = Cons(3, Box::new(a)); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_b` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `b` [INFO] [stdout] --> learning/src/smart_pointers/rc_pointers.rs:18:9 [INFO] [stdout] | [INFO] [stdout] 18 | let b = ListRc::Cons(3, Rc::clone(&a)); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_b` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `c` [INFO] [stdout] --> learning/src/smart_pointers/rc_pointers.rs:21:13 [INFO] [stdout] | [INFO] [stdout] 21 | let c = ListRc::Cons(4, Rc::clone(&a)); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_c` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `post` [INFO] [stdout] --> learning/src/oop/pattern_state_example.rs:41:27 [INFO] [stdout] | [INFO] [stdout] 41 | fn content<'a>(&self, post: &'a Post) -> &'a str { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_post` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `feet` [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:73:11 [INFO] [stdout] | [INFO] [stdout] 73 | let ((feet, inches), Point { x, y }) = ((3, 10), Point { x: 3, y: -10 }); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_feet` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `inches` [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:73:17 [INFO] [stdout] | [INFO] [stdout] 73 | let ((feet, inches), Point { x, y }) = ((3, 10), Point { x: 3, y: -10 }); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_inches` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `x` [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:73:34 [INFO] [stdout] | [INFO] [stdout] 73 | let ((feet, inches), Point { x, y }) = ((3, 10), Point { x: 3, y: -10 }); [INFO] [stdout] | ^ help: try ignoring the field: `x: _` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:73:37 [INFO] [stdout] | [INFO] [stdout] 73 | let ((feet, inches), Point { x, y }) = ((3, 10), Point { x: 3, y: -10 }); [INFO] [stdout] | ^ help: try ignoring the field: `y: _` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> learning/src/patterns_mappings/wildcards.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | let y = 10; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `x` [INFO] [stdout] --> learning/src/patterns_mappings/extra_conditions.rs:6:14 [INFO] [stdout] | [INFO] [stdout] 6 | Some(x) => {} [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_x` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `r` [INFO] [stdout] --> learning/src/unsafe_rust/dereference_raw_pointers.rs:15:9 [INFO] [stdout] | [INFO] [stdout] 15 | let r = address as *const i32; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_r` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | let f: Box = Box::new(|| println!("hi")); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:16:24 [INFO] [stdout] | [INFO] [stdout] 16 | fn takes_long_type(f: Box) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | let f: Thunk = Box::new(|| println!("hi")); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:31:24 [INFO] [stdout] | [INFO] [stdout] 31 | fn takes_long_type(f: Thunk) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `dynamic_s1` [INFO] [stdout] --> learning/src/advanced_types/sized_types.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 6 | let dynamic_s1: &str = "str_1"; [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_dynamic_s1` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `dynamic_s2` [INFO] [stdout] --> learning/src/advanced_types/sized_types.rs:7:9 [INFO] [stdout] | [INFO] [stdout] 7 | let dynamic_s2 = Rc::::from("foo"); [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_dynamic_s2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `t` [INFO] [stdout] --> learning/src/advanced_types/sized_types.rs:12:27 [INFO] [stdout] | [INFO] [stdout] 12 | pub fn generic(t: &T) { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_t` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v` [INFO] [stdout] --> learning/src/macros/macros_rules.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let v: Vec = vec![1, 2, 3]; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_v` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `value` is never read [INFO] [stdout] --> learning/src/structures.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 21 | pub struct Guess { [INFO] [stdout] | ----- field in this struct [INFO] [stdout] 22 | value: i32, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `update_rewrite_old_values` is never used [INFO] [stdout] --> learning/src/collections/hashmap.rs:42:4 [INFO] [stdout] | [INFO] [stdout] 42 | fn update_rewrite_old_values() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `insert_if_no_key_in_map` is never used [INFO] [stdout] --> learning/src/collections/hashmap.rs:51:4 [INFO] [stdout] | [INFO] [stdout] 51 | fn insert_if_no_key_in_map() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `new_value_based_on_old` is never used [INFO] [stdout] --> learning/src/collections/hashmap.rs:61:4 [INFO] [stdout] | [INFO] [stdout] 61 | fn new_value_based_on_old() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `create_string` is never used [INFO] [stdout] --> learning/src/collections/string.rs:1:4 [INFO] [stdout] | [INFO] [stdout] 1 | fn create_string() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `push_to_string` is never used [INFO] [stdout] --> learning/src/collections/string.rs:10:4 [INFO] [stdout] | [INFO] [stdout] 10 | fn push_to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `create_vector` is never used [INFO] [stdout] --> learning/src/collections/vector.rs:4:4 [INFO] [stdout] | [INFO] [stdout] 4 | fn create_vector() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `change_vector` is never used [INFO] [stdout] --> learning/src/collections/vector.rs:12:4 [INFO] [stdout] | [INFO] [stdout] 12 | fn change_vector() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_values_from_vector` is never used [INFO] [stdout] --> learning/src/collections/vector.rs:22:4 [INFO] [stdout] | [INFO] [stdout] 22 | fn get_values_from_vector() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `iterate_over_vector` is never used [INFO] [stdout] --> learning/src/collections/vector.rs:37:4 [INFO] [stdout] | [INFO] [stdout] 37 | fn iterate_over_vector() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `enums_to_store_different_types` is never used [INFO] [stdout] --> learning/src/collections/vector.rs:55:4 [INFO] [stdout] | [INFO] [stdout] 55 | fn enums_to_store_different_types() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `crash_and_burn` is never used [INFO] [stdout] --> learning/src/exceptions/non_recoverable_panic.rs:13:4 [INFO] [stdout] | [INFO] [stdout] 13 | fn crash_and_burn() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `reverse_trace_panic` is never used [INFO] [stdout] --> learning/src/exceptions/non_recoverable_panic.rs:17:4 [INFO] [stdout] | [INFO] [stdout] 17 | fn reverse_trace_panic() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Point` is never constructed [INFO] [stdout] --> learning/src/generics/generic_structures.rs:13:8 [INFO] [stdout] | [INFO] [stdout] 13 | struct Point { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `PointCombined` is never constructed [INFO] [stdout] --> learning/src/generics/generic_structures.rs:18:8 [INFO] [stdout] | [INFO] [stdout] 18 | struct PointCombined { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `declare_structure` is never used [INFO] [stdout] --> learning/src/generics/generic_structures.rs:23:4 [INFO] [stdout] | [INFO] [stdout] 23 | fn declare_structure() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Point` is never constructed [INFO] [stdout] --> learning/src/generics/generic_methods.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | struct Point { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `x` is never used [INFO] [stdout] --> learning/src/generics/generic_methods.rs:7:8 [INFO] [stdout] | [INFO] [stdout] 6 | impl Point { [INFO] [stdout] | ---------------- method in this implementation [INFO] [stdout] 7 | fn x(&self) -> &T { [INFO] [stdout] | ^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `distance_from_origin` is never used [INFO] [stdout] --> learning/src/generics/generic_methods.rs:14:8 [INFO] [stdout] | [INFO] [stdout] 13 | impl Point { [INFO] [stdout] | --------------- method in this implementation [INFO] [stdout] 14 | fn distance_from_origin(&self) -> f32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `non_compiled_example` is never used [INFO] [stdout] --> learning/src/lifetimes/lifetime_in_functions.rs:45:4 [INFO] [stdout] | [INFO] [stdout] 45 | fn non_compiled_example() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `call` is never used [INFO] [stdout] --> learning/src/lifetimes/lifetime_in_struct.rs:5:4 [INFO] [stdout] | [INFO] [stdout] 5 | fn call() { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `first_word` is never used [INFO] [stdout] --> learning/src/lifetimes/lifetime_elision.rs:8:4 [INFO] [stdout] | [INFO] [stdout] 8 | fn first_word<'a>(s: &'a str) -> &'a str { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `return_part` is never used [INFO] [stdout] --> learning/src/lifetimes/lifetime_in_methods.rs:6:8 [INFO] [stdout] | [INFO] [stdout] 5 | impl<'a> ImportantExcerpt<'a> { [INFO] [stdout] | ----------------------------- method in this implementation [INFO] [stdout] 6 | fn return_part(&self, announcement: &str) -> &str { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `example` is never used [INFO] [stdout] --> learning/src/lifetimes/static_lifetime.rs:1:4 [INFO] [stdout] | [INFO] [stdout] 1 | fn example() { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `example_closure_with_variable` is never used [INFO] [stdout] --> learning/src/closures/closures_as_variables.rs:4:4 [INFO] [stdout] | [INFO] [stdout] 4 | fn example_closure_with_variable() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `example_with_and_without_type_annotation` is never used [INFO] [stdout] --> learning/src/closures/closures_as_variables.rs:12:4 [INFO] [stdout] | [INFO] [stdout] 12 | fn example_with_and_without_type_annotation() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `height` is never read [INFO] [stdout] --> learning/src/closures/links_and_ownership.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 38 | struct Rectangle { [INFO] [stdout] | --------- field in this struct [INFO] [stdout] 39 | width: u32, [INFO] [stdout] 40 | height: u32, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Rectangle` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `1` is never read [INFO] [stdout] --> learning/src/smart_pointers/rc_pointers.rs:11:13 [INFO] [stdout] | [INFO] [stdout] 11 | Cons(T, Rc>), [INFO] [stdout] | ---- ^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 11 - Cons(T, Rc>), [INFO] [stdout] 11 + Cons(T, ()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `0` and `1` are never read [INFO] [stdout] --> learning/src/smart_pointers/rc_with_refcell.rs:6:10 [INFO] [stdout] | [INFO] [stdout] 6 | Cons(Rc>, Rc), [INFO] [stdout] | ---- ^^^^^^^^^^^^^^^^ ^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | fields in this variant [INFO] [stdout] | [INFO] [stdout] = note: `List` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields [INFO] [stdout] | [INFO] [stdout] 6 - Cons(Rc>, Rc), [INFO] [stdout] 6 + Cons((), ()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `reject` is never used [INFO] [stdout] --> learning/src/oop/pattern_state_example.rs:44:8 [INFO] [stdout] | [INFO] [stdout] 38 | trait State { [INFO] [stdout] | ----- method in this trait [INFO] [stdout] ... [INFO] [stdout] 44 | fn reject(self: Box) -> Box; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Rejected` is never constructed [INFO] [stdout] --> learning/src/oop/pattern_state_example.rs:106:8 [INFO] [stdout] | [INFO] [stdout] 106 | struct Rejected {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Point` is never constructed [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | struct Point { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Color` is never used [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:6:6 [INFO] [stdout] | [INFO] [stdout] 6 | enum Color { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Message` is never used [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:11:6 [INFO] [stdout] | [INFO] [stdout] 11 | enum Message { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `desctructurization_struct` is never used [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:19:8 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn desctructurization_struct() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `desctructurization_struct_shorter` is never used [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:27:8 [INFO] [stdout] | [INFO] [stdout] 27 | pub fn desctructurization_struct_shorter() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `desctructurization_struct_with_match` is never used [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:35:8 [INFO] [stdout] | [INFO] [stdout] 35 | pub fn desctructurization_struct_with_match() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `desctructurization_enum` is never used [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:47:8 [INFO] [stdout] | [INFO] [stdout] 47 | pub fn desctructurization_enum() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `desctructurization_tuples` is never used [INFO] [stdout] --> learning/src/patterns_mappings/destructurization.rs:72:8 [INFO] [stdout] | [INFO] [stdout] 72 | pub fn desctructurization_tuples() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `y` and `z` are never read [INFO] [stdout] --> learning/src/patterns_mappings/wildcards.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 1 | struct Point { [INFO] [stdout] | ----- fields in this struct [INFO] [stdout] 2 | x: i32, [INFO] [stdout] 3 | y: i32, [INFO] [stdout] | ^ [INFO] [stdout] 4 | z: i32, [INFO] [stdout] | ^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Millimeters` is never constructed [INFO] [stdout] --> learning/src/advanced_traits/default_common_types_and_operator_overload.rs:39:8 [INFO] [stdout] | [INFO] [stdout] 39 | struct Millimeters(u32); [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Meters` is never constructed [INFO] [stdout] --> learning/src/advanced_traits/default_common_types_and_operator_overload.rs:40:8 [INFO] [stdout] | [INFO] [stdout] 40 | struct Meters(u32); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `baby_name` is never used [INFO] [stdout] --> learning/src/advanced_traits/call_methods_and_functions_with_the_same_name.rs:49:8 [INFO] [stdout] | [INFO] [stdout] 48 | impl Dog { [INFO] [stdout] | -------- associated function in this implementation [INFO] [stdout] 49 | fn baby_name() -> String { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `takes_long_type` is never used [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:16:8 [INFO] [stdout] | [INFO] [stdout] 16 | fn takes_long_type(f: Box) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `returns_long_type` is never used [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:20:8 [INFO] [stdout] | [INFO] [stdout] 20 | fn returns_long_type() -> Box { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `takes_long_type` is never used [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:31:8 [INFO] [stdout] | [INFO] [stdout] 31 | fn takes_long_type(f: Thunk) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `returns_long_type` is never used [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:35:8 [INFO] [stdout] | [INFO] [stdout] 35 | fn returns_long_type() -> Thunk { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `Result` is never used [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:42:10 [INFO] [stdout] | [INFO] [stdout] 42 | type Result = std::result::Result; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Write` is never used [INFO] [stdout] --> learning/src/advanced_types/synonym_types.rs:44:15 [INFO] [stdout] | [INFO] [stdout] 44 | pub trait Write { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> learning/src/advanced_functions_and_closures/function_pointer.rs:23:15 [INFO] [stdout] | [INFO] [stdout] 23 | Value(u32), [INFO] [stdout] | ----- ^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 23 - Value(u32), [INFO] [stdout] 23 + Value(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Stop` is never constructed [INFO] [stdout] --> learning/src/advanced_functions_and_closures/function_pointer.rs:24:9 [INFO] [stdout] | [INFO] [stdout] 22 | enum Status { [INFO] [stdout] | ------ variant in this enum [INFO] [stdout] 23 | Value(u32), [INFO] [stdout] 24 | Stop, [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `returns_closure` is never used [INFO] [stdout] --> learning/src/advanced_functions_and_closures/return_closures.rs:3:4 [INFO] [stdout] | [INFO] [stdout] 3 | fn returns_closure() -> Box i32> { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> learning/src/structures.rs:27:12 [INFO] [stdout] | [INFO] [stdout] 27 | if value < 1 || value > 100 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(1..=100).contains(&value)` [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: calls to `push` immediately after creation [INFO] [stdout] --> learning/src/collections/vector.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | / let mut v = Vec::new(); [INFO] [stdout] 15 | | [INFO] [stdout] 16 | | v.push(5); [INFO] [stdout] 17 | | v.push(6); [INFO] [stdout] 18 | | v.push(7); [INFO] [stdout] 19 | | v.push(8); [INFO] [stdout] | |______________^ help: consider using the `vec![]` macro: `let v = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: statement with no effect [INFO] [stdout] --> learning/src/exceptions/non_recoverable_panic.rs:20:5 [INFO] [stdout] | [INFO] [stdout] 20 | v[99]; // code will produce panic! [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#no_effect [INFO] [stdout] = note: `#[warn(clippy::no_effect)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> learning/src/exceptions/propagating_error.rs:8:29 [INFO] [stdout] | [INFO] [stdout] 8 | let mut username_file = match username_file_result { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 9 | | Ok(fs) => fs, [INFO] [stdout] 10 | | Err(e) => return Err(e), [INFO] [stdout] 11 | | }; [INFO] [stdout] | |_____^ help: try instead: `username_file_result?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> learning/src/lifetimes/lifetime_elision.rs:8:15 [INFO] [stdout] | [INFO] [stdout] 8 | fn first_word<'a>(s: &'a str) -> &'a str { [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] 8 - fn first_word<'a>(s: &'a str) -> &'a str { [INFO] [stdout] 8 + fn first_word(s: &str) -> &str { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant slicing of the whole range [INFO] [stdout] --> learning/src/lifetimes/lifetime_elision.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | &s[..] [INFO] [stdout] | ^^^^^^ help: use the original value instead: `s` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing [INFO] [stdout] = note: `#[warn(clippy::redundant_slicing)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Post` [INFO] [stdout] --> learning/src/oop/pattern_state_example.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | / pub fn new() -> Post { [INFO] [stdout] 11 | | Post { [INFO] [stdout] 12 | | state: Some(Box::new(Draft {})), [INFO] [stdout] 13 | | content: String::new(), [INFO] [stdout] 14 | | } [INFO] [stdout] 15 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 9 + impl Default for Post { [INFO] [stdout] 10 + fn default() -> Self { [INFO] [stdout] 11 + Self::new() [INFO] [stdout] 12 + } [INFO] [stdout] 13 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods called `new` usually return `Self` [INFO] [stdout] --> learning/src/oop/pattern_state_example_with_types_change.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | / pub fn new() -> DraftPost { [INFO] [stdout] 11 | | DraftPost { [INFO] [stdout] 12 | | content: String::new(), [INFO] [stdout] 13 | | } [INFO] [stdout] 14 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_ret_no_self [INFO] [stdout] = note: `#[warn(clippy::new_ret_no_self)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be written as a `let` statement [INFO] [stdout] --> learning/src/patterns_mappings/wildcards.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | / match numbers { [INFO] [stdout] 31 | | (first, _, third, _, fifth) => { [INFO] [stdout] 32 | | println!("Some numbers: {first}, {third}, {fifth}") [INFO] [stdout] 33 | | } [INFO] [stdout] 34 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] help: consider using a `let` statement [INFO] [stdout] | [INFO] [stdout] 30 ~ let (first, _, third, _, fifth) = numbers; [INFO] [stdout] 31 + println!("Some numbers: {first}, {third}, {fifth}") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> learning/src/patterns_mappings/wildcards.rs:45:12 [INFO] [stdout] | [INFO] [stdout] 45 | if let Some(_) = s { [INFO] [stdout] | -------^^^^^^^---- help: try: `if s.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be written as a `let` statement [INFO] [stdout] --> learning/src/patterns_mappings/wildcards.rs:55:5 [INFO] [stdout] | [INFO] [stdout] 55 | / match origin { [INFO] [stdout] 56 | | Point { x, .. } => println!("x is {x}"), [INFO] [stdout] 57 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] help: consider using a `let` statement [INFO] [stdout] | [INFO] [stdout] 55 ~ let Point { x, .. } = origin; [INFO] [stdout] 56 + println!("x is {x}"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be written as a `let` statement [INFO] [stdout] --> learning/src/patterns_mappings/wildcards.rs:61:5 [INFO] [stdout] | [INFO] [stdout] 61 | / match numbers { [INFO] [stdout] 62 | | (first, .., last) => { [INFO] [stdout] 63 | | println!("Some numbers: {first}, {last}"); [INFO] [stdout] 64 | | } [INFO] [stdout] 65 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] help: consider using a `let` statement [INFO] [stdout] | [INFO] [stdout] 61 ~ let (first, .., last) = numbers; [INFO] [stdout] 62 + { [INFO] [stdout] 63 + println!("Some numbers: {first}, {last}"); [INFO] [stdout] 64 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this OR pattern can be rewritten using a range [INFO] [stdout] --> learning/src/patterns_mappings/extra_conditions.rs:27:9 [INFO] [stdout] | [INFO] [stdout] 27 | 4 | 5 | 6 if y => println!("yes"), [INFO] [stdout] | ^^^^^^^^^ help: try: `4..=6` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns [INFO] [stdout] = note: `#[warn(clippy::manual_range_patterns)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> learning/src/collections/vector.rs:9:19 [INFO] [stdout] | [INFO] [stdout] 9 | let macro_v = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> learning/src/collections/vector.rs:23:13 [INFO] [stdout] | [INFO] [stdout] 23 | let v = vec![1, 2, 3, 4, 5]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3, 4, 5]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> learning/src/exceptions/non_recoverable_panic.rs:18:13 [INFO] [stdout] | [INFO] [stdout] 18 | let v = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> learning/src/iterator/trait_iterator_and_next.rs:18:16 [INFO] [stdout] | [INFO] [stdout] 18 | let list = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> learning/src/advanced_functions_and_closures/function_pointer.rs:16:23 [INFO] [stdout] | [INFO] [stdout] 16 | let vec_example = vec![1, 2, 3]; [INFO] [stdout] | ^^^^^^^^^^^^^ help: you can use an array directly: `[1, 2, 3]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `std::mem::drop` with a value that implements `Copy` does nothing [INFO] [stdout] --> learning/src/unsafe_rust/call_unsafe_functions_or_methods.rs:10:9 [INFO] [stdout] | [INFO] [stdout] 10 | drop(*ptr); [INFO] [stdout] | ^^^^^----^ [INFO] [stdout] | | [INFO] [stdout] | argument has type `i32` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dropping_copy_types)]` on by default [INFO] [stdout] help: use `let _ = ...` to ignore the expression or result [INFO] [stdout] | [INFO] [stdout] 10 - drop(*ptr); [INFO] [stdout] 10 + let _ = *ptr; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static [INFO] [stdout] --> learning/src/unsafe_rust/access_change_static_variables.rs:13:29 [INFO] [stdout] | [INFO] [stdout] 13 | println!("COUNTER: {COUNTER}"); [INFO] [stdout] | ^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(static_mut_refs)]` (part of `#[warn(rust_2024_compatibility)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused return value of `std::iter::Iterator::collect` that must be used [INFO] [stdout] --> learning/src/advanced_functions_and_closures/function_pointer.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | vec_example.iter().map(|i| i.to_string()).collect::(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: if you really need to exhaust the iterator, consider `.for_each(drop)` instead [INFO] [stdout] = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 17 | let _ = vec_example.iter().map(|i| i.to_string()).collect::(); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused return value of `std::iter::Iterator::collect` that must be used [INFO] [stdout] --> learning/src/advanced_functions_and_closures/function_pointer.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | vec_example.iter().map(ToString::to_string).collect::(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: if you really need to exhaust the iterator, consider `.for_each(drop)` instead [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 18 | let _ = vec_example.iter().map(ToString::to_string).collect::(); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Compiling time-macros-impl v0.1.2 [INFO] [stderr] Compiling async-attributes v1.1.2 [INFO] [stderr] Compiling derive_more v0.99.17 [INFO] [stderr] Compiling serde_derive v1.0.203 [INFO] [stderr] Compiling tracing-attributes v0.1.27 [INFO] [stderr] Compiling tokio-macros v2.2.0 [INFO] [stderr] Compiling futures-macro v0.3.30 [INFO] [stderr] Compiling thiserror-impl v1.0.61 [INFO] [stderr] Compiling pin-project-internal v1.1.5 [INFO] [stderr] Checking time-macros v0.1.1 [INFO] [stderr] Compiling pear_codegen v0.2.9 [INFO] [stderr] Compiling async-trait v0.1.80 [INFO] [stderr] Checking futures-util v0.3.30 [INFO] [stderr] Compiling ref-cast-impl v1.0.23 [INFO] [stderr] Compiling pear v0.2.9 [INFO] [stderr] Compiling devise_codegen v0.4.1 [INFO] [stderr] Compiling regex v1.10.4 [INFO] [stderr] Compiling async-stream-impl v0.3.5 [INFO] [stderr] Compiling devise v0.4.1 [INFO] [stderr] Compiling actix-macros v0.2.4 [INFO] [stderr] Checking pin-project v1.1.5 [INFO] [stderr] Checking async-stream v0.3.5 [INFO] [stderr] Checking zstd v0.13.1 [INFO] [stderr] Checking futures v0.3.30 [INFO] [stderr] Checking serde_fmt v1.0.3 [INFO] [stderr] Checking erased-serde v0.4.5 [INFO] [stderr] Checking indexmap v2.2.6 [INFO] [stderr] Checking url v2.5.0 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking chrono v0.4.38 [INFO] [stderr] Checking serde_qs v0.8.5 [INFO] [stderr] Checking serde_spanned v0.6.6 [INFO] [stderr] Checking toml_datetime v0.6.6 [INFO] [stderr] Checking uuid v1.8.0 [INFO] [stderr] Checking bincode v1.3.3 [INFO] [stderr] Checking ubyte v0.10.4 [INFO] [stderr] Checking value-bag-serde1 v1.9.0 [INFO] [stderr] Checking value-bag v1.9.0 [INFO] [stderr] Checking toml_edit v0.22.13 [INFO] [stderr] Checking log v0.4.21 [INFO] [stderr] Checking tracing v0.1.40 [INFO] [stderr] Checking mio v0.8.11 [INFO] [stderr] Checking kv-log-macro v1.0.7 [INFO] [stderr] Checking tungstenite v0.21.0 [INFO] [stderr] Checking femme v2.2.1 [INFO] [stderr] Checking polling v3.7.0 [INFO] [stderr] Checking actix-router v0.5.3 [INFO] [stderr] Checking tasks v0.1.0 (/opt/rustwide/workdir/tasks) [INFO] [stderr] Checking tokio v1.37.0 [INFO] [stdout] warning: unused imports: `Add` and `Sub` [INFO] [stdout] --> tasks/src/has_a_deadline_been_reached.rs:1:16 [INFO] [stdout] | [INFO] [stdout] 1 | use std::ops::{Add, Sub}; [INFO] [stdout] | ^^^ ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `TimeDelta` [INFO] [stdout] --> tasks/src/has_a_deadline_been_reached.rs:2:25 [INFO] [stdout] | [INFO] [stdout] 2 | use chrono::{NaiveDate, TimeDelta, Utc}; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `decode` and `encode` [INFO] [stdout] --> tasks/src/run_length_encoding.rs:1:55 [INFO] [stdout] | [INFO] [stdout] 1 | use crate::run_length_encoding::run_length_encoding::{decode, encode}; [INFO] [stdout] | ^^^^^^ ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `vigenere::*` [INFO] [stdout] --> tasks/src/vigenere_cipher.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | use vigenere::*; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `median` is never used [INFO] [stdout] --> tasks/src/calculate_the_median.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn median(mut arr: Vec) -> Option { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `unique` is never used [INFO] [stdout] --> tasks/src/find_unique_items.rs:4:4 [INFO] [stdout] | [INFO] [stdout] 4 | fn unique<'a, T>(arr: &'a Vec) -> Vec [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `info` is never used [INFO] [stdout] --> tasks/src/print_any_text_type.rs:3:4 [INFO] [stdout] | [INFO] [stdout] 3 | fn info(a: &T) { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `sort_usernames` is never used [INFO] [stdout] --> tasks/src/case_insensitive_sort.rs:1:4 [INFO] [stdout] | [INFO] [stdout] 1 | fn sort_usernames>(usernames: &mut Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Pulse` is never used [INFO] [stdout] --> tasks/src/convert_text_to_morse_code.rs:2:6 [INFO] [stdout] | [INFO] [stdout] 2 | enum Pulse { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `Letter` is never used [INFO] [stdout] --> tasks/src/convert_text_to_morse_code.rs:8:6 [INFO] [stdout] | [INFO] [stdout] 8 | type Letter = Vec; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `Message` is never used [INFO] [stdout] --> tasks/src/convert_text_to_morse_code.rs:11:6 [INFO] [stdout] | [INFO] [stdout] 11 | type Message = Vec; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `MorseCode` is never used [INFO] [stdout] --> tasks/src/convert_text_to_morse_code.rs:13:7 [INFO] [stdout] | [INFO] [stdout] 13 | trait MorseCode { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ImportantEvent` is never constructed [INFO] [stdout] --> tasks/src/has_a_deadline_been_reached.rs:4:8 [INFO] [stdout] | [INFO] [stdout] 4 | struct ImportantEvent { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `Deadline` is never used [INFO] [stdout] --> tasks/src/has_a_deadline_been_reached.rs:8:7 [INFO] [stdout] | [INFO] [stdout] 8 | trait Deadline { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Temperature` is never constructed [INFO] [stdout] --> tasks/src/convert_between_celsius_and_fahrenheit.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | struct Temperature { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new`, `to_celsius`, and `to_fahrenheit` are never used [INFO] [stdout] --> tasks/src/convert_between_celsius_and_fahrenheit.rs:6:8 [INFO] [stdout] | [INFO] [stdout] 5 | impl Temperature { [INFO] [stdout] | ---------------- associated items in this implementation [INFO] [stdout] 6 | fn new(degrees: f32) -> Temperature { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 12 | fn to_celsius(&self) -> f32 { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 16 | fn to_fahrenheit(&self) -> f32 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `sum_with_missing` is never used [INFO] [stdout] --> tasks/src/sum_a_list_of_numbers_with_missing_values.rs:1:4 [INFO] [stdout] | [INFO] [stdout] 1 | fn sum_with_missing(numbers: Vec>) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `weeks_between` is never used [INFO] [stdout] --> tasks/src/calculate_the_number_of_weeks_between_two_dates.rs:3:4 [INFO] [stdout] | [INFO] [stdout] 3 | fn weeks_between(a: &str, b: &str) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Isbn` is never constructed [INFO] [stdout] --> tasks/src/validate_isbn_number.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 3 | struct Isbn { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `calculate_check_digit` is never used [INFO] [stdout] --> tasks/src/validate_isbn_number.rs:44:4 [INFO] [stdout] | [INFO] [stdout] 44 | fn calculate_check_digit(digits: &[u8]) -> u8 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `FileMetadata` is never used [INFO] [stdout] --> tasks/src/check_if_a_file_exists.rs:5:7 [INFO] [stdout] | [INFO] [stdout] 5 | trait FileMetadata { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Rgb` is never constructed [INFO] [stdout] --> tasks/src/interpret_an_rgb_hex_color.rs:5:8 [INFO] [stdout] | [INFO] [stdout] 5 | struct Rgb { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `RgbChannels` is never used [INFO] [stdout] --> tasks/src/interpret_an_rgb_hex_color.rs:11:7 [INFO] [stdout] | [INFO] [stdout] 11 | trait RgbChannels { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `ParseColorError` is never used [INFO] [stdout] --> tasks/src/interpret_an_rgb_hex_color.rs:34:6 [INFO] [stdout] | [INFO] [stdout] 34 | enum ParseColorError { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `process_stack` is never used [INFO] [stdout] --> tasks/src/run_length_encoding.rs:6:8 [INFO] [stdout] | [INFO] [stdout] 6 | fn process_stack(stack: &mut VecDeque) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `encode` is never used [INFO] [stdout] --> tasks/src/run_length_encoding.rs:24:12 [INFO] [stdout] | [INFO] [stdout] 24 | pub fn encode(text: &str) -> String { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `encode_no_stack` is never used [INFO] [stdout] --> tasks/src/run_length_encoding.rs:43:12 [INFO] [stdout] | [INFO] [stdout] 43 | pub fn encode_no_stack(text: &str) -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `decode` is never used [INFO] [stdout] --> tasks/src/run_length_encoding.rs:66:12 [INFO] [stdout] | [INFO] [stdout] 66 | pub fn decode(text: &str) -> String { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `flexible_date_parse` is never used [INFO] [stdout] --> tasks/src/handle_inconsistent_dates.rs:5:4 [INFO] [stdout] | [INFO] [stdout] 5 | fn flexible_date_parse(text: &str) -> Option { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `Node` is never used [INFO] [stdout] --> tasks/src/travel_planner.rs:4:6 [INFO] [stdout] | [INFO] [stdout] 4 | type Node = usize; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type alias `Cost` is never used [INFO] [stdout] --> tasks/src/travel_planner.rs:5:6 [INFO] [stdout] | [INFO] [stdout] 5 | type Cost = usize; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Graph` is never constructed [INFO] [stdout] --> tasks/src/travel_planner.rs:7:8 [INFO] [stdout] | [INFO] [stdout] 7 | struct Graph { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `from_edge_list` is never used [INFO] [stdout] --> tasks/src/travel_planner.rs:13:8 [INFO] [stdout] | [INFO] [stdout] 12 | impl Graph { [INFO] [stdout] | ---------- associated function in this implementation [INFO] [stdout] 13 | fn from_edge_list(edge_list: &Vec<(Node, Node, Cost)>) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `HeapNode` is never constructed [INFO] [stdout] --> tasks/src/travel_planner.rs:36:8 [INFO] [stdout] | [INFO] [stdout] 36 | struct HeapNode { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `shortest_path` is never used [INFO] [stdout] --> tasks/src/travel_planner.rs:61:4 [INFO] [stdout] | [INFO] [stdout] 61 | fn shortest_path(g: &Graph, start: Node, goal: Node) -> Option<(Vec, Cost)> { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `encrypt` is never used [INFO] [stdout] --> tasks/src/vigenere_cipher.rs:2:12 [INFO] [stdout] | [INFO] [stdout] 2 | pub fn encrypt(plaintext: &str, key: &str) -> String { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking async-io v2.3.2 [INFO] [stdout] warning: function `decrypt` is never used [INFO] [stdout] --> tasks/src/vigenere_cipher.rs:21:12 [INFO] [stdout] | [INFO] [stdout] 21 | pub fn decrypt(ciphertext: &str, key: &str) -> String { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> tasks/src/calculate_the_median.rs:8:12 [INFO] [stdout] | [INFO] [stdout] 8 | if n % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^ help: replace with: `n.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` 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] --> tasks/src/find_unique_items.rs:4:23 [INFO] [stdout] | [INFO] [stdout] 4 | fn unique<'a, T>(arr: &'a 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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 4 - fn unique<'a, T>(arr: &'a Vec) -> Vec [INFO] [stdout] 4 + fn unique<'a, T>(arr: &'a [T]) -> Vec [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> tasks/src/case_insensitive_sort.rs:1:45 [INFO] [stdout] | [INFO] [stdout] 1 | fn sort_usernames>(usernames: &mut 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] 1 - fn sort_usernames>(usernames: &mut Vec) { [INFO] [stdout] 1 + fn sort_usernames>(usernames: &mut [T]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_ok()` [INFO] [stdout] --> tasks/src/check_if_a_file_exists.rs:31:16 [INFO] [stdout] | [INFO] [stdout] 31 | if let Ok(_) = self.fetch_permissions() { [INFO] [stdout] | -------^^^^^--------------------------- help: try: `if self.fetch_permissions().is_ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> tasks/src/interpret_an_rgb_hex_color.rs:46:23 [INFO] [stdout] | [INFO] [stdout] 46 | let red = u8::from_str_radix(&hex[0..2], 16) [INFO] [stdout] | _______________________^ [INFO] [stdout] 47 | | .or_else(|_| Err(ParseColorError::RedChannelOutOfBounds))?; [INFO] [stdout] | |_________________________________________________________________________^ help: try: `u8::from_str_radix(&hex[0..2], 16).map_err(|_| ParseColorError::RedChannelOutOfBounds)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> tasks/src/interpret_an_rgb_hex_color.rs:48:25 [INFO] [stdout] | [INFO] [stdout] 48 | let green = u8::from_str_radix(&hex[2..4], 16) [INFO] [stdout] | _________________________^ [INFO] [stdout] 49 | | .or_else(|_| Err(ParseColorError::GreenChannelOutOfBounds))?; [INFO] [stdout] | |___________________________________________________________________________^ help: try: `u8::from_str_radix(&hex[2..4], 16).map_err(|_| ParseColorError::GreenChannelOutOfBounds)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> tasks/src/interpret_an_rgb_hex_color.rs:50:24 [INFO] [stdout] | [INFO] [stdout] 50 | let blue = u8::from_str_radix(&hex[4..6], 16) [INFO] [stdout] | ________________________^ [INFO] [stdout] 51 | | .or_else(|_| Err(ParseColorError::BlueChannelOutOfBounds))?; [INFO] [stdout] | |__________________________________________________________________________^ help: try: `u8::from_str_radix(&hex[4..6], 16).map_err(|_| ParseColorError::BlueChannelOutOfBounds)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> tasks/src/run_length_encoding.rs:3:1 [INFO] [stdout] | [INFO] [stdout] 3 | / mod run_length_encoding { [INFO] [stdout] 4 | | use std::collections::VecDeque; [INFO] [stdout] 5 | | [INFO] [stdout] 6 | | fn process_stack(stack: &mut VecDeque) -> String { [INFO] [stdout] ... | [INFO] [stdout] 84 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> tasks/src/run_length_encoding.rs:13:19 [INFO] [stdout] | [INFO] [stdout] 13 | while let Some(_) = stack.pop_back() { [INFO] [stdout] | ----------^^^^^^^------------------- help: try: `while stack.pop_back().is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `text_bytes` [INFO] [stdout] --> tasks/src/run_length_encoding.rs:31:18 [INFO] [stdout] | [INFO] [stdout] 31 | for i in 0..text_bytes.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 31 - for i in 0..text_bytes.len() { [INFO] [stdout] 31 + for in &text_bytes { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> tasks/src/run_length_encoding.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | while let Some(c) = chars.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for c in chars` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `text_bytes` [INFO] [stdout] --> tasks/src/run_length_encoding.rs:73:18 [INFO] [stdout] | [INFO] [stdout] 73 | for i in 0..text_bytes.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 73 - for i in 0..text_bytes.len() { [INFO] [stdout] 73 + for (i, ) in text_bytes.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `parse_result` after checking its variant with `is_ok` [INFO] [stdout] --> tasks/src/handle_inconsistent_dates.rs:8:21 [INFO] [stdout] | [INFO] [stdout] 7 | if parse_result.is_ok() { [INFO] [stdout] | ----------------------- help: try: `if let Ok() = parse_result` [INFO] [stdout] 8 | return Some(parse_result.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: called `unwrap` on `parse_result` after checking its variant with `is_ok` [INFO] [stdout] --> tasks/src/handle_inconsistent_dates.rs:12:21 [INFO] [stdout] | [INFO] [stdout] 11 | if parse_result.is_ok() { [INFO] [stdout] | ----------------------- help: try: `if let Ok() = parse_result` [INFO] [stdout] 12 | return Some(parse_result.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: called `unwrap` on `parse_result` after checking its variant with `is_ok` [INFO] [stdout] --> tasks/src/handle_inconsistent_dates.rs:16:21 [INFO] [stdout] | [INFO] [stdout] 15 | if parse_result.is_ok() { [INFO] [stdout] | ----------------------- help: try: `if let Ok() = parse_result` [INFO] [stdout] 16 | return Some(parse_result.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: called `unwrap` on `parse_result` after checking its variant with `is_ok` [INFO] [stdout] --> tasks/src/handle_inconsistent_dates.rs:20:21 [INFO] [stdout] | [INFO] [stdout] 19 | if parse_result.is_ok() { [INFO] [stdout] | ----------------------- help: try: `if let Ok() = parse_result` [INFO] [stdout] 20 | return Some(parse_result.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> tasks/src/travel_planner.rs:13:34 [INFO] [stdout] | [INFO] [stdout] 13 | fn from_edge_list(edge_list: &Vec<(Node, Node, Cost)>) -> Self { [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] 13 - fn from_edge_list(edge_list: &Vec<(Node, Node, Cost)>) -> Self { [INFO] [stdout] 13 + fn from_edge_list(edge_list: &[(Node, Node, Cost)]) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> tasks/src/travel_planner.rs:20:33 [INFO] [stdout] | [INFO] [stdout] 20 | .or_insert_with(|| Vec::new()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vec::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking toml v0.8.13 [INFO] [stdout] warning: unused import: `encode` [INFO] [stdout] --> tasks/src/run_length_encoding.rs:1:63 [INFO] [stdout] | [INFO] [stdout] 1 | use crate::run_length_encoding::run_length_encoding::{decode, encode}; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated associated function `chrono::NaiveDate::from_ymd`: use `from_ymd_opt()` instead [INFO] [stdout] --> tasks/src/handle_inconsistent_dates.rs:27:67 [INFO] [stdout] | [INFO] [stdout] 27 | assert_eq!(flexible_date_parse("2010-12-11"), Some(NaiveDate::from_ymd(2010, 12, 11))) [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(deprecated)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated associated function `chrono::NaiveDate::from_ymd`: use `from_ymd_opt()` instead [INFO] [stdout] --> tasks/src/handle_inconsistent_dates.rs:32:68 [INFO] [stdout] | [INFO] [stdout] 32 | assert_eq!(flexible_date_parse("1999/Mar/02"), Some(NaiveDate::from_ymd(1999, 3, 2))) [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated associated function `chrono::NaiveDate::from_ymd`: use `from_ymd_opt()` instead [INFO] [stdout] --> tasks/src/handle_inconsistent_dates.rs:37:68 [INFO] [stdout] | [INFO] [stdout] 37 | assert_eq!(flexible_date_parse("01.Mar.2021"), Some(NaiveDate::from_ymd(2021, 3, 1))) [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of deprecated associated function `chrono::NaiveDate::from_ymd`: use `from_ymd_opt()` instead [INFO] [stdout] --> tasks/src/handle_inconsistent_dates.rs:42:68 [INFO] [stdout] | [INFO] [stdout] 42 | assert_eq!(flexible_date_parse("Apr.05.2021"), Some(NaiveDate::from_ymd(2021, 4, 5))) [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking async-signal v0.2.6 [INFO] [stderr] Checking async-global-executor v2.4.1 [INFO] [stderr] Checking async-process v1.8.1 [INFO] [stderr] Checking async-std v1.12.0 [INFO] [stdout] warning: methods `exists` and `is_readable` are never used [INFO] [stdout] --> tasks/src/check_if_a_file_exists.rs:6:8 [INFO] [stdout] | [INFO] [stdout] 5 | trait FileMetadata { [INFO] [stdout] | ------------ methods in this trait [INFO] [stdout] 6 | fn exists(&self) -> bool; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 10 | fn is_readable(&self) -> bool; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> tasks/src/calculate_the_median.rs:8:12 [INFO] [stdout] | [INFO] [stdout] 8 | if n % 2 == 0 { [INFO] [stdout] | ^^^^^^^^^^ help: replace with: `n.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` 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] --> tasks/src/find_unique_items.rs:4:23 [INFO] [stdout] | [INFO] [stdout] 4 | fn unique<'a, T>(arr: &'a 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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 4 - fn unique<'a, T>(arr: &'a Vec) -> Vec [INFO] [stdout] 4 + fn unique<'a, T>(arr: &'a [T]) -> Vec [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> tasks/src/case_insensitive_sort.rs:1:45 [INFO] [stdout] | [INFO] [stdout] 1 | fn sort_usernames>(usernames: &mut 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] 1 - fn sort_usernames>(usernames: &mut Vec) { [INFO] [stdout] 1 + fn sort_usernames>(usernames: &mut [T]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_ok()` [INFO] [stdout] --> tasks/src/check_if_a_file_exists.rs:31:16 [INFO] [stdout] | [INFO] [stdout] 31 | if let Ok(_) = self.fetch_permissions() { [INFO] [stdout] | -------^^^^^--------------------------- help: try: `if self.fetch_permissions().is_ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> tasks/src/check_if_a_file_exists.rs:62:5 [INFO] [stdout] | [INFO] [stdout] 62 | assert_eq!(f.path().is_writeable(), false); [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] 62 - assert_eq!(f.path().is_writeable(), false); [INFO] [stdout] 62 + assert!(!f.path().is_writeable()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> tasks/src/interpret_an_rgb_hex_color.rs:46:23 [INFO] [stdout] | [INFO] [stdout] 46 | let red = u8::from_str_radix(&hex[0..2], 16) [INFO] [stdout] | _______________________^ [INFO] [stdout] 47 | | .or_else(|_| Err(ParseColorError::RedChannelOutOfBounds))?; [INFO] [stdout] | |_________________________________________________________________________^ help: try: `u8::from_str_radix(&hex[0..2], 16).map_err(|_| ParseColorError::RedChannelOutOfBounds)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> tasks/src/interpret_an_rgb_hex_color.rs:48:25 [INFO] [stdout] | [INFO] [stdout] 48 | let green = u8::from_str_radix(&hex[2..4], 16) [INFO] [stdout] | _________________________^ [INFO] [stdout] 49 | | .or_else(|_| Err(ParseColorError::GreenChannelOutOfBounds))?; [INFO] [stdout] | |___________________________________________________________________________^ help: try: `u8::from_str_radix(&hex[2..4], 16).map_err(|_| ParseColorError::GreenChannelOutOfBounds)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)` [INFO] [stdout] --> tasks/src/interpret_an_rgb_hex_color.rs:50:24 [INFO] [stdout] | [INFO] [stdout] 50 | let blue = u8::from_str_radix(&hex[4..6], 16) [INFO] [stdout] | ________________________^ [INFO] [stdout] 51 | | .or_else(|_| Err(ParseColorError::BlueChannelOutOfBounds))?; [INFO] [stdout] | |__________________________________________________________________________^ help: try: `u8::from_str_radix(&hex[4..6], 16).map_err(|_| ParseColorError::BlueChannelOutOfBounds)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> tasks/src/run_length_encoding.rs:3:1 [INFO] [stdout] | [INFO] [stdout] 3 | / mod run_length_encoding { [INFO] [stdout] 4 | | use std::collections::VecDeque; [INFO] [stdout] 5 | | [INFO] [stdout] 6 | | fn process_stack(stack: &mut VecDeque) -> String { [INFO] [stdout] ... | [INFO] [stdout] 84 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> tasks/src/run_length_encoding.rs:13:19 [INFO] [stdout] | [INFO] [stdout] 13 | while let Some(_) = stack.pop_back() { [INFO] [stdout] | ----------^^^^^^^------------------- help: try: `while stack.pop_back().is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `text_bytes` [INFO] [stdout] --> tasks/src/run_length_encoding.rs:31:18 [INFO] [stdout] | [INFO] [stdout] 31 | for i in 0..text_bytes.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 31 - for i in 0..text_bytes.len() { [INFO] [stdout] 31 + for in &text_bytes { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> tasks/src/run_length_encoding.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | while let Some(c) = chars.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for c in chars` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `text_bytes` [INFO] [stdout] --> tasks/src/run_length_encoding.rs:73:18 [INFO] [stdout] | [INFO] [stdout] 73 | for i in 0..text_bytes.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 73 - for i in 0..text_bytes.len() { [INFO] [stdout] 73 + for (i, ) in text_bytes.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `parse_result` after checking its variant with `is_ok` [INFO] [stdout] --> tasks/src/handle_inconsistent_dates.rs:8:21 [INFO] [stdout] | [INFO] [stdout] 7 | if parse_result.is_ok() { [INFO] [stdout] | ----------------------- help: try: `if let Ok() = parse_result` [INFO] [stdout] 8 | return Some(parse_result.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: called `unwrap` on `parse_result` after checking its variant with `is_ok` [INFO] [stdout] --> tasks/src/handle_inconsistent_dates.rs:12:21 [INFO] [stdout] | [INFO] [stdout] 11 | if parse_result.is_ok() { [INFO] [stdout] | ----------------------- help: try: `if let Ok() = parse_result` [INFO] [stdout] 12 | return Some(parse_result.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: called `unwrap` on `parse_result` after checking its variant with `is_ok` [INFO] [stdout] --> tasks/src/handle_inconsistent_dates.rs:16:21 [INFO] [stdout] | [INFO] [stdout] 15 | if parse_result.is_ok() { [INFO] [stdout] | ----------------------- help: try: `if let Ok() = parse_result` [INFO] [stdout] 16 | return Some(parse_result.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: called `unwrap` on `parse_result` after checking its variant with `is_ok` [INFO] [stdout] --> tasks/src/handle_inconsistent_dates.rs:20:21 [INFO] [stdout] | [INFO] [stdout] 19 | if parse_result.is_ok() { [INFO] [stdout] | ----------------------- help: try: `if let Ok() = parse_result` [INFO] [stdout] 20 | return Some(parse_result.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> tasks/src/travel_planner.rs:13:34 [INFO] [stdout] | [INFO] [stdout] 13 | fn from_edge_list(edge_list: &Vec<(Node, Node, Cost)>) -> Self { [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] 13 - fn from_edge_list(edge_list: &Vec<(Node, Node, Cost)>) -> Self { [INFO] [stdout] 13 + fn from_edge_list(edge_list: &[(Node, Node, Cost)]) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> tasks/src/travel_planner.rs:20:33 [INFO] [stdout] | [INFO] [stdout] 20 | .or_insert_with(|| Vec::new()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vec::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Compiling actix-web-codegen v4.2.2 [INFO] [stderr] Checking async-session v2.0.1 [INFO] [stderr] Checking tokio-util v0.7.11 [INFO] [stderr] Checking tokio-stream v0.1.15 [INFO] [stderr] Checking tokio-tungstenite v0.21.0 [INFO] [stderr] Checking actix-rt v2.9.0 [INFO] [stderr] Checking tokio_async v0.1.0 (/opt/rustwide/workdir/tokio_async) [INFO] [stderr] Checking chat-tokio-stream v0.1.0 (/opt/rustwide/workdir/chat-tokio-stream) [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> chat-tokio-stream/src/main.rs:43:45 [INFO] [stdout] | [INFO] [stdout] 43 | ... write.write_all(&msg.as_bytes()).await.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `msg.as_bytes()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> chat-tokio-stream/src/main.rs:43:45 [INFO] [stdout] | [INFO] [stdout] 43 | ... write.write_all(&msg.as_bytes()).await.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `msg.as_bytes()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking async-sse v4.1.0 [INFO] [stderr] Checking async-h1 v2.3.4 [INFO] [stderr] Checking http-client v6.5.3 [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> tokio_async/src/basics/tokio_spawn.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | return hello_blocking("Blocking Name"); [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] 32 - return hello_blocking("Blocking Name"); [INFO] [stdout] 32 + hello_blocking("Blocking Name") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> tokio_async/src/basics/examples.rs:17:9 [INFO] [stdout] | [INFO] [stdout] 17 | return blocking_call(); [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] 17 - return blocking_call(); [INFO] [stdout] 17 + blocking_call() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::ops::Range` [INFO] [stdout] --> tokio_async/src/async_primitives/semaphore_example.rs:33:17 [INFO] [stdout] | [INFO] [stdout] 33 | let names = (0..10).into_iter().map(|v| format!("{} name", v).to_string()).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `(0..10)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> tokio_async/src/basics/tokio_spawn.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | return hello_blocking("Blocking Name"); [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] 32 - return hello_blocking("Blocking Name"); [INFO] [stdout] 32 + hello_blocking("Blocking Name") [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> tokio_async/src/basics/examples.rs:17:9 [INFO] [stdout] | [INFO] [stdout] 17 | return blocking_call(); [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] 17 - return blocking_call(); [INFO] [stdout] 17 + blocking_call() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> tokio_async/src/channels/mpsc_channel.rs:7:92 [INFO] [stdout] | [INFO] [stdout] 7 | sender.send(format!("Thread name: {}, Message {}", format!("# {}", random::()).to_string(), i).to_string()).await.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::ops::Range` [INFO] [stdout] --> tokio_async/src/async_primitives/semaphore_example.rs:33:17 [INFO] [stdout] | [INFO] [stdout] 33 | let names = (0..10).into_iter().map(|v| format!("{} name", v).to_string()).collect::>(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider removing `.into_iter()`: `(0..10)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> tokio_async/src/async_primitives/mutex_example.rs:14:17 [INFO] [stdout] | [INFO] [stdout] 14 | let names = vec!["Andrew".to_string(), "John".to_string(), "Josh".to_string(), "Peter".to_string()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `["Andrew".to_string(), "John".to_string(), "Josh".to_string(), "Peter".to_string()]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking actix-server v2.3.0 [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> tokio_async/src/channels/mpsc_channel.rs:7:92 [INFO] [stdout] | [INFO] [stdout] 7 | sender.send(format!("Thread name: {}, Message {}", format!("# {}", random::()).to_string(), i).to_string()).await.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> tokio_async/src/async_primitives/mutex_example.rs:14:17 [INFO] [stdout] | [INFO] [stdout] 14 | let names = vec!["Andrew".to_string(), "John".to_string(), "Josh".to_string(), "Peter".to_string()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `["Andrew".to_string(), "John".to_string(), "Josh".to_string(), "Peter".to_string()]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking h2 v0.3.26 [INFO] [stderr] Checking actix-codec v0.5.2 [INFO] [stderr] Checking tide v0.16.0 [INFO] [stderr] Checking server_with_tide v0.1.0 (/opt/rustwide/workdir/server_with_tide) [INFO] [stderr] Checking hyper v0.14.28 [INFO] [stderr] Checking actix-http v3.7.0 [INFO] [stderr] Checking actix-web v4.6.0 [INFO] [stderr] Checking warp v0.3.7 [INFO] [stderr] Checking rocket_http v0.5.1 [INFO] [stderr] Checking server_with_actix v0.1.0 (/opt/rustwide/workdir/server_with_actix) [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> server_with_actix/src/main.rs:12:18 [INFO] [stdout] | [INFO] [stdout] 12 | Ok(web::Json(datasource.read().unwrap().values().map(|u| u.clone()).collect::>())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `datasource.read().unwrap().values().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found `.or(Some(…)).unwrap()` [INFO] [stdout] --> server_with_actix/src/main.rs:20:10 [INFO] [stdout] | [INFO] [stdout] 20 | .or(Some(HttpResponse::NotFound().finish())) [INFO] [stdout] | __________^ [INFO] [stdout] 21 | | .unwrap() [INFO] [stdout] | |_________________^ help: try: `unwrap_or(HttpResponse::NotFound().finish())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_then_unwrap [INFO] [stdout] = note: `#[warn(clippy::or_then_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> server_with_actix/src/main.rs:12:18 [INFO] [stdout] | [INFO] [stdout] 12 | Ok(web::Json(datasource.read().unwrap().values().map(|u| u.clone()).collect::>())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `datasource.read().unwrap().values().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found `.or(Some(…)).unwrap()` [INFO] [stdout] --> server_with_actix/src/main.rs:20:10 [INFO] [stdout] | [INFO] [stdout] 20 | .or(Some(HttpResponse::NotFound().finish())) [INFO] [stdout] | __________^ [INFO] [stdout] 21 | | .unwrap() [INFO] [stdout] | |_________________^ help: try: `unwrap_or(HttpResponse::NotFound().finish())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_then_unwrap [INFO] [stdout] = note: `#[warn(clippy::or_then_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking rust_websocket v0.1.0 (/opt/rustwide/workdir/rust_websocket) [INFO] [stderr] Checking server_with_warp v0.1.0 (/opt/rustwide/workdir/server_with_warp) [INFO] [stdout] warning: variant `InternalServerError` is never constructed [INFO] [stdout] --> server_with_warp/src/main.rs:45:5 [INFO] [stdout] | [INFO] [stdout] 43 | enum Error { [INFO] [stdout] | ----- variant in this enum [INFO] [stdout] 44 | NotFoundError, [INFO] [stdout] 45 | InternalServerError, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Error` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> server_with_warp/src/main.rs:62:19 [INFO] [stdout] | [INFO] [stdout] 62 | } else if let Some(_) = err.find::() { [INFO] [stdout] | -------^^^^^^^---------------------------------------------------------- help: try: `if err.find::().is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> server_with_warp/src/main.rs:77:19 [INFO] [stdout] | [INFO] [stdout] 77 | } else if let Some(_) = err.find::() { [INFO] [stdout] | -------^^^^^^^----------------------------------------- help: try: `if err.find::().is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `InternalServerError` is never constructed [INFO] [stdout] --> server_with_warp/src/main.rs:45:5 [INFO] [stdout] | [INFO] [stdout] 43 | enum Error { [INFO] [stdout] | ----- variant in this enum [INFO] [stdout] 44 | NotFoundError, [INFO] [stdout] 45 | InternalServerError, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Error` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> server_with_warp/src/main.rs:62:19 [INFO] [stdout] | [INFO] [stdout] 62 | } else if let Some(_) = err.find::() { [INFO] [stdout] | -------^^^^^^^---------------------------------------------------------- help: try: `if err.find::().is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> server_with_warp/src/main.rs:77:19 [INFO] [stdout] | [INFO] [stdout] 77 | } else if let Some(_) = err.find::() { [INFO] [stdout] | -------^^^^^^^----------------------------------------- help: try: `if err.find::().is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> rust_websocket/src/handler/websocket.rs:87:17 [INFO] [stdout] | [INFO] [stdout] 87 | None => return, [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: replace `return` with a unit value [INFO] [stdout] | [INFO] [stdout] 87 ~ None => (), [INFO] [stdout] 88 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> rust_websocket/src/handler/websocket.rs:73:52 [INFO] [stdout] | [INFO] [stdout] 73 | let topics_req: TopicsRequest = match from_str(&message) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `message` [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: unneeded `return` statement [INFO] [stdout] --> rust_websocket/src/handler/websocket.rs:87:17 [INFO] [stdout] | [INFO] [stdout] 87 | None => return, [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: replace `return` with a unit value [INFO] [stdout] | [INFO] [stdout] 87 ~ None => (), [INFO] [stdout] 88 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> rust_websocket/src/handler/websocket.rs:73:52 [INFO] [stdout] | [INFO] [stdout] 73 | let topics_req: TopicsRequest = match from_str(&message) { [INFO] [stdout] | ^^^^^^^^ help: change this to: `message` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> rust_websocket/src/main.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | use rust_websocket; [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: this import is redundant [INFO] [stdout] --> rust_websocket/src/main.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | use rust_websocket; [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] [stderr] Compiling rocket_codegen v0.5.1 [INFO] [stderr] Checking server_with_rocket v0.1.0 (/opt/rustwide/workdir/server_with_rocket) [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> server_with_rocket/src/main.rs:70:64 [INFO] [stdout] | [INFO] [stdout] 70 | Some(json) => Response::build_from(json.respond_to(&req).unwrap()) [INFO] [stdout] | ^^^^ help: change this to: `req` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> server_with_rocket/src/main.rs:70:64 [INFO] [stdout] | [INFO] [stdout] 70 | Some(json) => Response::build_from(json.respond_to(&req).unwrap()) [INFO] [stdout] | ^^^^ help: change this to: `req` [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: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> server_with_rocket/src/main.rs:144:5 [INFO] [stdout] | [INFO] [stdout] 144 | config.address = IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `rocket::Config { address: IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), port: 8080, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> server_with_rocket/src/main.rs:143:5 [INFO] [stdout] | [INFO] [stdout] 143 | let mut config = Config::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> server_with_rocket/src/main.rs:144:5 [INFO] [stdout] | [INFO] [stdout] 144 | config.address = IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `rocket::Config { address: IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), port: 8080, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> server_with_rocket/src/main.rs:143:5 [INFO] [stdout] | [INFO] [stdout] 143 | let mut config = Config::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 23s [INFO] running `Command { std: "docker" "inspect" "c1ca3b2b71b7605e6d455a599e1a4b6c82a3f4b165341c04e3032d805b074246", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c1ca3b2b71b7605e6d455a599e1a4b6c82a3f4b165341c04e3032d805b074246", kill_on_drop: false }` [INFO] [stdout] c1ca3b2b71b7605e6d455a599e1a4b6c82a3f4b165341c04e3032d805b074246