[INFO] cloning repository https://github.com/skarlman/Codingame-SpringChallenge-2021 [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/skarlman/Codingame-SpringChallenge-2021" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fskarlman%2FCodingame-SpringChallenge-2021", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fskarlman%2FCodingame-SpringChallenge-2021'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 314f6fc5dc7cfe9bfccb2d4dd69af384c9624bb1 [INFO] linting skarlman/Codingame-SpringChallenge-2021 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fskarlman%2FCodingame-SpringChallenge-2021" "/workspace/builds/worker-7-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-7-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/skarlman/Codingame-SpringChallenge-2021 [INFO] finished tweaking git repo https://github.com/skarlman/Codingame-SpringChallenge-2021 [INFO] tweaked toml for git repo https://github.com/skarlman/Codingame-SpringChallenge-2021 written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/skarlman/Codingame-SpringChallenge-2021 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/skarlman/Codingame-SpringChallenge-2021 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] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] bfa43ee732264eec41ba75260671646b9933fd5b70ac6314ebc607702bb61492 [INFO] running `Command { std: "docker" "start" "-a" "bfa43ee732264eec41ba75260671646b9933fd5b70ac6314ebc607702bb61492", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "bfa43ee732264eec41ba75260671646b9933fd5b70ac6314ebc607702bb61492", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "bfa43ee732264eec41ba75260671646b9933fd5b70ac6314ebc607702bb61492", kill_on_drop: false }` [INFO] [stdout] bfa43ee732264eec41ba75260671646b9933fd5b70ac6314ebc607702bb61492 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] 25e5a815b6ade3a85a5cdb6c61017f2cfa14075b6720b97e08ac62383e140fbd [INFO] running `Command { std: "docker" "start" "-a" "25e5a815b6ade3a85a5cdb6c61017f2cfa14075b6720b97e08ac62383e140fbd", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.94 [INFO] [stderr] Checking getrandom v0.2.2 [INFO] [stderr] Checking rand_core v0.6.2 [INFO] [stderr] Checking rand_chacha v0.3.0 [INFO] [stderr] Checking rand v0.8.3 [INFO] [stderr] Checking rustbot v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `std::panic::resume_unwind` [INFO] [stdout] --> src/main.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use std::panic::resume_unwind; [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: `Duration` [INFO] [stdout] --> src/main.rs:7:17 [INFO] [stdout] | [INFO] [stdout] 7 | use std::time::{Duration, Instant}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::arch::x86_64::_mm_sha1rnds4_epu32` [INFO] [stdout] --> src/main.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | use std::arch::x86_64::_mm_sha1rnds4_epu32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/main.rs:422:12 [INFO] [stdout] | [INFO] [stdout] 422 | if (current_sun_balance[player] < 4 || possible_choices.len() == 0) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 422 - if (current_sun_balance[player] < 4 || possible_choices.len() == 0) { [INFO] [stdout] 422 + if current_sun_balance[player] < 4 || possible_choices.len() == 0 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::panic::resume_unwind` [INFO] [stdout] --> src/main.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use std::panic::resume_unwind; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around assigned value [INFO] [stdout] --> src/main.rs:516:36 [INFO] [stdout] | [INFO] [stdout] 516 | shadow_cost += (match board.get(&cell_index).unwrap().richness { [INFO] [stdout] | ^ [INFO] [stdout] ... [INFO] [stdout] 520 | }); [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 516 ~ shadow_cost += match board.get(&cell_index).unwrap().richness { [INFO] [stdout] 517 | 2 => nutrients + 2, [INFO] [stdout] 518 | 3 => nutrients + 4, [INFO] [stdout] 519 | _ => nutrients [INFO] [stdout] 520 ~ } ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Duration` [INFO] [stdout] --> src/main.rs:7:17 [INFO] [stdout] | [INFO] [stdout] 7 | use std::time::{Duration, Instant}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::arch::x86_64::_mm_sha1rnds4_epu32` [INFO] [stdout] --> src/main.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | use std::arch::x86_64::_mm_sha1rnds4_epu32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/main.rs:422:12 [INFO] [stdout] | [INFO] [stdout] 422 | if (current_sun_balance[player] < 4 || possible_choices.len() == 0) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 422 - if (current_sun_balance[player] < 4 || possible_choices.len() == 0) { [INFO] [stdout] 422 + if current_sun_balance[player] < 4 || possible_choices.len() == 0 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around assigned value [INFO] [stdout] --> src/main.rs:516:36 [INFO] [stdout] | [INFO] [stdout] 516 | shadow_cost += (match board.get(&cell_index).unwrap().richness { [INFO] [stdout] | ^ [INFO] [stdout] ... [INFO] [stdout] 520 | }); [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 516 ~ shadow_cost += match board.get(&cell_index).unwrap().richness { [INFO] [stdout] 517 | 2 => nutrients + 2, [INFO] [stdout] 518 | 3 => nutrients + 4, [INFO] [stdout] 519 | _ => nutrients [INFO] [stdout] 520 ~ } ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable expression [INFO] [stdout] --> src/main.rs:65:17 [INFO] [stdout] | [INFO] [stdout] 64 | panic!("Wrong action input"); [INFO] [stdout] | ---------------------------- any code following this expression is unreachable [INFO] [stdout] 65 | Action::Wait [INFO] [stdout] | ^^^^^^^^^^^^ unreachable expression [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unreachable_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable expression [INFO] [stdout] --> src/main.rs:65:17 [INFO] [stdout] | [INFO] [stdout] 64 | panic!("Wrong action input"); [INFO] [stdout] | ---------------------------- any code following this expression is unreachable [INFO] [stdout] 65 | Action::Wait [INFO] [stdout] | ^^^^^^^^^^^^ unreachable expression [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unreachable_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/main.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | for i in 0..number_of_trees as usize { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/main.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | for i in 0..number_of_trees as usize { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/main.rs:105:9 [INFO] [stdout] | [INFO] [stdout] 105 | for i in 0..number_of_possible_actions as usize { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/main.rs:105:9 [INFO] [stdout] | [INFO] [stdout] 105 | for i in 0..number_of_possible_actions as usize { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/main.rs:161:9 [INFO] [stdout] | [INFO] [stdout] 161 | for i in 0..number_of_cells as usize { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/main.rs:161:9 [INFO] [stdout] | [INFO] [stdout] 161 | for i in 0..number_of_cells as usize { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `neigh_0` [INFO] [stdout] --> src/main.rs:168:13 [INFO] [stdout] | [INFO] [stdout] 168 | let neigh_0 = parse_input!(inputs[2], i32); // the index of the neighbouring cell for each direction [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_neigh_0` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `neigh_0` [INFO] [stdout] --> src/main.rs:168:13 [INFO] [stdout] | [INFO] [stdout] 168 | let neigh_0 = parse_input!(inputs[2], i32); // the index of the neighbouring cell for each direction [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_neigh_0` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `neigh_1` [INFO] [stdout] --> src/main.rs:169:13 [INFO] [stdout] | [INFO] [stdout] 169 | let neigh_1 = parse_input!(inputs[3], i32); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_neigh_1` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `neigh_2` [INFO] [stdout] --> src/main.rs:170:13 [INFO] [stdout] | [INFO] [stdout] 170 | let neigh_2 = parse_input!(inputs[4], i32); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_neigh_2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `neigh_1` [INFO] [stdout] --> src/main.rs:169:13 [INFO] [stdout] | [INFO] [stdout] 169 | let neigh_1 = parse_input!(inputs[3], i32); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_neigh_1` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `neigh_3` [INFO] [stdout] --> src/main.rs:171:13 [INFO] [stdout] | [INFO] [stdout] 171 | let neigh_3 = parse_input!(inputs[5], i32); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_neigh_3` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `neigh_2` [INFO] [stdout] --> src/main.rs:170:13 [INFO] [stdout] | [INFO] [stdout] 170 | let neigh_2 = parse_input!(inputs[4], i32); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_neigh_2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `neigh_4` [INFO] [stdout] --> src/main.rs:172:13 [INFO] [stdout] | [INFO] [stdout] 172 | let neigh_4 = parse_input!(inputs[6], i32); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_neigh_4` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `neigh_5` [INFO] [stdout] --> src/main.rs:173:13 [INFO] [stdout] | [INFO] [stdout] 173 | let neigh_5 = parse_input!(inputs[7], i32); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_neigh_5` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `neigh_3` [INFO] [stdout] --> src/main.rs:171:13 [INFO] [stdout] | [INFO] [stdout] 171 | let neigh_3 = parse_input!(inputs[5], i32); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_neigh_3` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `neigh_4` [INFO] [stdout] --> src/main.rs:172:13 [INFO] [stdout] | [INFO] [stdout] 172 | let neigh_4 = parse_input!(inputs[6], i32); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_neigh_4` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `neigh_5` [INFO] [stdout] --> src/main.rs:173:13 [INFO] [stdout] | [INFO] [stdout] 173 | let neigh_5 = parse_input!(inputs[7], i32); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_neigh_5` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:189:9 [INFO] [stdout] | [INFO] [stdout] 189 | let mut previous_action = Action::Null; [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: `previous_action` [INFO] [stdout] --> src/main.rs:189:9 [INFO] [stdout] | [INFO] [stdout] 189 | let mut previous_action = Action::Null; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_previous_action` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `is_new_day` is assigned to, but never used [INFO] [stdout] --> src/main.rs:192:9 [INFO] [stdout] | [INFO] [stdout] 192 | let mut is_new_day = false; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_is_new_day` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `is_new_day` is never read [INFO] [stdout] --> src/main.rs:200:13 [INFO] [stdout] | [INFO] [stdout] 200 | is_new_day = true; [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: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:189:9 [INFO] [stdout] | [INFO] [stdout] 189 | let mut previous_action = Action::Null; [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: `previous_action` [INFO] [stdout] --> src/main.rs:189:9 [INFO] [stdout] | [INFO] [stdout] 189 | let mut previous_action = Action::Null; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_previous_action` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `is_new_day` is assigned to, but never used [INFO] [stdout] --> src/main.rs:192:9 [INFO] [stdout] | [INFO] [stdout] 192 | let mut is_new_day = false; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_is_new_day` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `is_new_day` is never read [INFO] [stdout] --> src/main.rs:200:13 [INFO] [stdout] | [INFO] [stdout] 200 | is_new_day = true; [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: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:222:45 [INFO] [stdout] | [INFO] [stdout] 222 | fn playout_moves(context: &GameContext, mut forest: &mut Forest, board: &Area, expected_actions: &ActionList) -> (String, f64, ... [INFO] [stdout] | ----^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:222:45 [INFO] [stdout] | [INFO] [stdout] 222 | fn playout_moves(context: &GameContext, mut forest: &mut Forest, board: &Area, expected_actions: &ActionList) -> (String, f64, ... [INFO] [stdout] | ----^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ak` [INFO] [stdout] --> src/main.rs:332:23 [INFO] [stdout] | [INFO] [stdout] 332 | .max_by(|(ak, (a_count, a_score)), (bk, (b_count, b_score))| a_score.partial_cmp(&b_score).unwrap()) [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_ak` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `a_count` [INFO] [stdout] --> src/main.rs:332:28 [INFO] [stdout] | [INFO] [stdout] 332 | .max_by(|(ak, (a_count, a_score)), (bk, (b_count, b_score))| a_score.partial_cmp(&b_score).unwrap()) [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_a_count` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `bk` [INFO] [stdout] --> src/main.rs:332:49 [INFO] [stdout] | [INFO] [stdout] 332 | .max_by(|(ak, (a_count, a_score)), (bk, (b_count, b_score))| a_score.partial_cmp(&b_score).unwrap()) [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_bk` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `b_count` [INFO] [stdout] --> src/main.rs:332:54 [INFO] [stdout] | [INFO] [stdout] 332 | .max_by(|(ak, (a_count, a_score)), (bk, (b_count, b_score))| a_score.partial_cmp(&b_score).unwrap()) [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_b_count` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `i` is assigned to, but never used [INFO] [stdout] --> src/main.rs:242:13 [INFO] [stdout] | [INFO] [stdout] 242 | let mut i = 0; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_i` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `i` is never read [INFO] [stdout] --> src/main.rs:244:13 [INFO] [stdout] | [INFO] [stdout] 244 | i += 1; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ak` [INFO] [stdout] --> src/main.rs:332:23 [INFO] [stdout] | [INFO] [stdout] 332 | .max_by(|(ak, (a_count, a_score)), (bk, (b_count, b_score))| a_score.partial_cmp(&b_score).unwrap()) [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_ak` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `a_count` [INFO] [stdout] --> src/main.rs:332:28 [INFO] [stdout] | [INFO] [stdout] 332 | .max_by(|(ak, (a_count, a_score)), (bk, (b_count, b_score))| a_score.partial_cmp(&b_score).unwrap()) [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_a_count` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `bk` [INFO] [stdout] --> src/main.rs:332:49 [INFO] [stdout] | [INFO] [stdout] 332 | .max_by(|(ak, (a_count, a_score)), (bk, (b_count, b_score))| a_score.partial_cmp(&b_score).unwrap()) [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_bk` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `b_count` [INFO] [stdout] --> src/main.rs:332:54 [INFO] [stdout] | [INFO] [stdout] 332 | .max_by(|(ak, (a_count, a_score)), (bk, (b_count, b_score))| a_score.partial_cmp(&b_score).unwrap()) [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_b_count` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `i` is assigned to, but never used [INFO] [stdout] --> src/main.rs:242:13 [INFO] [stdout] | [INFO] [stdout] 242 | let mut i = 0; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_i` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `i` is never read [INFO] [stdout] --> src/main.rs:244:13 [INFO] [stdout] | [INFO] [stdout] 244 | i += 1; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `expected_actions` [INFO] [stdout] --> src/main.rs:338:298 [INFO] [stdout] | [INFO] [stdout] 338 | ...&mut ThreadRng, expected_actions: &ActionList) -> ([i32; 2], [i32; 2], i32, Action, GameContext, [[i32; 4]; 2], [bool; 2]) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_expected_actions` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `k` [INFO] [stdout] --> src/main.rs:497:26 [INFO] [stdout] | [INFO] [stdout] 497 | for (k, t) in trees { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_k` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `expected_actions` [INFO] [stdout] --> src/main.rs:338:298 [INFO] [stdout] | [INFO] [stdout] 338 | ...&mut ThreadRng, expected_actions: &ActionList) -> ([i32; 2], [i32; 2], i32, Action, GameContext, [[i32; 4]; 2], [bool; 2]) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_expected_actions` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `k` [INFO] [stdout] --> src/main.rs:497:26 [INFO] [stdout] | [INFO] [stdout] 497 | for (k, t) in trees { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_k` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `x` [INFO] [stdout] --> src/main.rs:532:109 [INFO] [stdout] | [INFO] [stdout] 532 | let n:i32 = board[target_id].neighbors_ids.iter().filter(|id| !trees.contains_key(id)).map(|x| 1).sum(); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_x` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `origin_id` [INFO] [stdout] --> src/main.rs:531:37 [INFO] [stdout] | [INFO] [stdout] 531 | Action::Seed(target_id, origin_id) => { [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_origin_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `x` [INFO] [stdout] --> src/main.rs:532:109 [INFO] [stdout] | [INFO] [stdout] 532 | let n:i32 = board[target_id].neighbors_ids.iter().filter(|id| !trees.contains_key(id)).map(|x| 1).sum(); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_x` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `origin_id` [INFO] [stdout] --> src/main.rs:531:37 [INFO] [stdout] | [INFO] [stdout] 531 | Action::Seed(target_id, origin_id) => { [INFO] [stdout] | ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_origin_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:588:13 [INFO] [stdout] | [INFO] [stdout] 588 | let mut visited: HashSet = HashSet::new(); [INFO] [stdout] | ----^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `visited` [INFO] [stdout] --> src/main.rs:588:13 [INFO] [stdout] | [INFO] [stdout] 588 | let mut visited: HashSet = HashSet::new(); [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_visited` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:588:13 [INFO] [stdout] | [INFO] [stdout] 588 | let mut visited: HashSet = HashSet::new(); [INFO] [stdout] | ----^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `visited` [INFO] [stdout] --> src/main.rs:588:13 [INFO] [stdout] | [INFO] [stdout] 588 | let mut visited: HashSet = HashSet::new(); [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_visited` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `id` [INFO] [stdout] --> src/main.rs:640:20 [INFO] [stdout] | [INFO] [stdout] 640 | .map(|(id, tree)| Action::Complete(tree.cell_index)) [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `id` [INFO] [stdout] --> src/main.rs:639:23 [INFO] [stdout] | [INFO] [stdout] 639 | .filter(|(id, tree)| (tree.is_mine && player == 0 || !tree.is_mine && player == 1) && !tree.is_dormant && tree.size == 3) [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `id` [INFO] [stdout] --> src/main.rs:640:20 [INFO] [stdout] | [INFO] [stdout] 640 | .map(|(id, tree)| Action::Complete(tree.cell_index)) [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `id` [INFO] [stdout] --> src/main.rs:639:23 [INFO] [stdout] | [INFO] [stdout] 639 | .filter(|(id, tree)| (tree.is_mine && player == 0 || !tree.is_mine && player == 1) && !tree.is_dormant && tree.size == 3) [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:649:13 [INFO] [stdout] | [INFO] [stdout] 649 | let mut tree_costs = [0 + my_trees_counts[0], 1 + my_trees_counts[1], 3 + my_trees_counts[2], 7 + my_trees_counts[3]]; [INFO] [stdout] | ----^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `id` [INFO] [stdout] --> src/main.rs:667:23 [INFO] [stdout] | [INFO] [stdout] 667 | ... .filter(|(id, tree)| (tree.is_mine && player == 0 || !tree.is_mine && player == 1) && !tree.is_dormant && tree.size < 3 && tr... [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:649:13 [INFO] [stdout] | [INFO] [stdout] 649 | let mut tree_costs = [0 + my_trees_counts[0], 1 + my_trees_counts[1], 3 + my_trees_counts[2], 7 + my_trees_counts[3]]; [INFO] [stdout] | ----^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `id` [INFO] [stdout] --> src/main.rs:667:23 [INFO] [stdout] | [INFO] [stdout] 667 | ... .filter(|(id, tree)| (tree.is_mine && player == 0 || !tree.is_mine && player == 1) && !tree.is_dormant && tree.size < 3 && tr... [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `id` [INFO] [stdout] --> src/main.rs:711:24 [INFO] [stdout] | [INFO] [stdout] 711 | .map(|(id, tree)| get_sun_points_from_tree(&tree, &board, &trees, sun_direction)).sum(); [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `id` [INFO] [stdout] --> src/main.rs:710:27 [INFO] [stdout] | [INFO] [stdout] 710 | .filter(|(id, tree)| (tree.is_mine && player == 0 || !tree.is_mine && player == 1) && tree.size > 0) [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `id` [INFO] [stdout] --> src/main.rs:711:24 [INFO] [stdout] | [INFO] [stdout] 711 | .map(|(id, tree)| get_sun_points_from_tree(&tree, &board, &trees, sun_direction)).sum(); [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `op_is_waiting` is never read [INFO] [stdout] --> src/main.rs:122:5 [INFO] [stdout] | [INFO] [stdout] 115 | struct GameContext { [INFO] [stdout] | ----------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 122 | op_is_waiting: bool, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `GameContext` has a derived impl for the trait `Clone`, 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: field `index` is never read [INFO] [stdout] --> src/main.rs:148:5 [INFO] [stdout] | [INFO] [stdout] 147 | struct Cell { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] 148 | index: i32, [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `id` [INFO] [stdout] --> src/main.rs:710:27 [INFO] [stdout] | [INFO] [stdout] 710 | .filter(|(id, tree)| (tree.is_mine && player == 0 || !tree.is_mine && player == 1) && tree.size > 0) [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_id` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `op_is_waiting` is never read [INFO] [stdout] --> src/main.rs:122:5 [INFO] [stdout] | [INFO] [stdout] 115 | struct GameContext { [INFO] [stdout] | ----------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 122 | op_is_waiting: bool, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `GameContext` has a derived impl for the trait `Clone`, 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: field `index` is never read [INFO] [stdout] --> src/main.rs:148:5 [INFO] [stdout] | [INFO] [stdout] 147 | struct Cell { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] 148 | index: i32, [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `inputs` [INFO] [stdout] --> src/main.rs:174:18 [INFO] [stdout] | [INFO] [stdout] 174 | for i in 2..8 { [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] 174 - for i in 2..8 { [INFO] [stdout] 174 + for in inputs.iter().take(8).skip(2) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `inputs` [INFO] [stdout] --> src/main.rs:174:18 [INFO] [stdout] | [INFO] [stdout] 174 | for i in 2..8 { [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] 174 - for i in 2..8 { [INFO] [stdout] 174 + for in inputs.iter().take(8).skip(2) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GameContext` which implements the `Copy` trait [INFO] [stdout] --> src/main.rs:245:45 [INFO] [stdout] | [INFO] [stdout] 245 | let mut new_game: GameContext = context.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*context` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[i32; 4]` which implements the `Copy` trait [INFO] [stdout] --> src/main.rs:259:45 [INFO] [stdout] | [INFO] [stdout] 259 | let mut current_trees_counts = [my_trees_counts.clone(), opp_trees_counts.clone()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `my_trees_counts` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GameContext` which implements the `Copy` trait [INFO] [stdout] --> src/main.rs:245:45 [INFO] [stdout] | [INFO] [stdout] 245 | let mut new_game: GameContext = context.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*context` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[i32; 4]` which implements the `Copy` trait [INFO] [stdout] --> src/main.rs:259:70 [INFO] [stdout] | [INFO] [stdout] 259 | let mut current_trees_counts = [my_trees_counts.clone(), opp_trees_counts.clone()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `opp_trees_counts` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:266:74 [INFO] [stdout] | [INFO] [stdout] 266 | ... let mut result = choose_next_move(new_game, &mut new_forest, &board, current_sun_point_balance, current_game_points, new_last... [INFO] [stdout] | ^^^^^^ help: change this to: `board` [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: using `clone` on type `[i32; 4]` which implements the `Copy` trait [INFO] [stdout] --> src/main.rs:259:45 [INFO] [stdout] | [INFO] [stdout] 259 | let mut current_trees_counts = [my_trees_counts.clone(), opp_trees_counts.clone()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `my_trees_counts` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[i32; 4]` which implements the `Copy` trait [INFO] [stdout] --> src/main.rs:259:70 [INFO] [stdout] | [INFO] [stdout] 259 | let mut current_trees_counts = [my_trees_counts.clone(), opp_trees_counts.clone()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `opp_trees_counts` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:266:74 [INFO] [stdout] | [INFO] [stdout] 266 | ... let mut result = choose_next_move(new_game, &mut new_forest, &board, current_sun_point_balance, current_game_points, new_last... [INFO] [stdout] | ^^^^^^ help: change this to: `board` [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] --> src/main.rs:292:70 [INFO] [stdout] | [INFO] [stdout] 292 | ... result = choose_next_move(new_game, &mut new_forest, &board, current_sun_point_balance, current_game_points, new_last_day, cu... [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:292:70 [INFO] [stdout] | [INFO] [stdout] 292 | ... result = choose_next_move(new_game, &mut new_forest, &board, current_sun_point_balance, current_game_points, new_last_day, cu... [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:332:94 [INFO] [stdout] | [INFO] [stdout] 332 | .max_by(|(ak, (a_count, a_score)), (bk, (b_count, b_score))| a_score.partial_cmp(&b_score).unwrap()) [INFO] [stdout] | ^^^^^^^^ help: change this to: `b_score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/main.rs:338:332 [INFO] [stdout] | [INFO] [stdout] 338 | ...ed_actions: &ActionList) -> ([i32; 2], [i32; 2], i32, Action, GameContext, [[i32; 4]; 2], [bool; 2]) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (12/7) [INFO] [stdout] --> src/main.rs:338:5 [INFO] [stdout] | [INFO] [stdout] 338 | fn choose_next_move(mut game: GameCont...32, Action, GameContext, [[i32; 4]; 2], [bool; 2]) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:332:94 [INFO] [stdout] | [INFO] [stdout] 332 | .max_by(|(ak, (a_count, a_score)), (bk, (b_count, b_score))| a_score.partial_cmp(&b_score).unwrap()) [INFO] [stdout] | ^^^^^^^^ help: change this to: `b_score` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:505:9 [INFO] [stdout] | [INFO] [stdout] 505 | ... return (current_sun_balance, current_game_points, last_day, random_action.clone(), game, current_trees_counts, waiting_players); [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] 505 - return (current_sun_balance, current_game_points, last_day, random_action.clone(), game, current_trees_counts, waiting_players); [INFO] [stdout] 505 + (current_sun_balance, current_game_points, last_day, random_action.clone(), game, current_trees_counts, waiting_players) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/main.rs:338:332 [INFO] [stdout] | [INFO] [stdout] 338 | ...ed_actions: &ActionList) -> ([i32; 2], [i32; 2], i32, Action, GameContext, [[i32; 4]; 2], [bool; 2]) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (12/7) [INFO] [stdout] --> src/main.rs:338:5 [INFO] [stdout] | [INFO] [stdout] 338 | fn choose_next_move(mut game: GameCont...32, Action, GameContext, [[i32; 4]; 2], [bool; 2]) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:365:52 [INFO] [stdout] | [INFO] [stdout] 365 | let sun_point_calc = get_my_sun_points(&board, &game.day, &trees, player); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:505:9 [INFO] [stdout] | [INFO] [stdout] 505 | ... return (current_sun_balance, current_game_points, last_day, random_action.clone(), game, current_trees_counts, waiting_players); [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] 505 - return (current_sun_balance, current_game_points, last_day, random_action.clone(), game, current_trees_counts, waiting_players); [INFO] [stdout] 505 + (current_sun_balance, current_game_points, last_day, random_action.clone(), game, current_trees_counts, waiting_players) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:365:71 [INFO] [stdout] | [INFO] [stdout] 365 | let sun_point_calc = get_my_sun_points(&board, &game.day, &trees, player); [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:376:103 [INFO] [stdout] | [INFO] [stdout] 376 | ...ate_grow_actions(current_sun_balance[player], &trees, current_trees_counts[player], player); [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:365:52 [INFO] [stdout] | [INFO] [stdout] 365 | let sun_point_calc = get_my_sun_points(&board, &game.day, &trees, player); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:388:111 [INFO] [stdout] | [INFO] [stdout] 388 | let mut complete_possibilities: Vec = calculate_complete_actions(current_sun_balance[player], &trees, player); [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:365:71 [INFO] [stdout] | [INFO] [stdout] 365 | let sun_point_calc = get_my_sun_points(&board, &game.day, &trees, player); [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:404:86 [INFO] [stdout] | [INFO] [stdout] 404 | ... seed_possibilities = calculate_seed_actions(current_sun_balance[player], &trees, &board, current_trees_counts[player], player); [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:376:103 [INFO] [stdout] | [INFO] [stdout] 376 | ...ate_grow_actions(current_sun_balance[player], &trees, current_trees_counts[player], player); [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:404:94 [INFO] [stdout] | [INFO] [stdout] 404 | ... seed_possibilities = calculate_seed_actions(current_sun_balance[player], &trees, &board, current_trees_counts[player], player); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:388:111 [INFO] [stdout] | [INFO] [stdout] 388 | let mut complete_possibilities: Vec = calculate_complete_actions(current_sun_balance[player], &trees, player); [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/main.rs:422:48 [INFO] [stdout] | [INFO] [stdout] 422 | if (current_sun_balance[player] < 4 || possible_choices.len() == 0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `possible_choices.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:404:86 [INFO] [stdout] | [INFO] [stdout] 404 | ... seed_possibilities = calculate_seed_actions(current_sun_balance[player], &trees, &board, current_trees_counts[player], player); [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:404:94 [INFO] [stdout] | [INFO] [stdout] 404 | ... seed_possibilities = calculate_seed_actions(current_sun_balance[player], &trees, &board, current_trees_counts[player], player); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/main.rs:422:48 [INFO] [stdout] | [INFO] [stdout] 422 | if (current_sun_balance[player] < 4 || possible_choices.len() == 0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `possible_choices.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:451:46 [INFO] [stdout] | [INFO] [stdout] 451 | let action_cost = get_cost_of_action(&random_action, &trees, current_trees_counts[player]); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `random_action` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:451:62 [INFO] [stdout] | [INFO] [stdout] 451 | let action_cost = get_cost_of_action(&random_action, &trees, current_trees_counts[player]); [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:458:78 [INFO] [stdout] | [INFO] [stdout] 458 | ... current_game_points[player] += calculate_game_points_from_action(&random_action, game.nutrients, &board, &trees, game.day); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `random_action` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:458:110 [INFO] [stdout] | [INFO] [stdout] 458 | ...s_from_action(&random_action, game.nutrients, &board, &trees, game.day); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:458:118 [INFO] [stdout] | [INFO] [stdout] 458 | ...ction(&random_action, game.nutrients, &board, &trees, game.day); [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:451:46 [INFO] [stdout] | [INFO] [stdout] 451 | let action_cost = get_cost_of_action(&random_action, &trees, current_trees_counts[player]); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `random_action` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:463:49 [INFO] [stdout] | [INFO] [stdout] 463 | let mut tree: Tree = *trees.get(&cell_index).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `cell_index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:451:62 [INFO] [stdout] | [INFO] [stdout] 451 | let action_cost = get_cost_of_action(&random_action, &trees, current_trees_counts[player]); [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:458:78 [INFO] [stdout] | [INFO] [stdout] 458 | ... current_game_points[player] += calculate_game_points_from_action(&random_action, game.nutrients, &board, &trees, game.day); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `random_action` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:458:110 [INFO] [stdout] | [INFO] [stdout] 458 | ...s_from_action(&random_action, game.nutrients, &board, &trees, game.day); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:476:49 [INFO] [stdout] | [INFO] [stdout] 476 | let mut tree: Tree = *trees.get(&origin_cell_index).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `origin_cell_index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:458:118 [INFO] [stdout] | [INFO] [stdout] 458 | ...ction(&random_action, game.nutrients, &board, &trees, game.day); [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:463:49 [INFO] [stdout] | [INFO] [stdout] 463 | let mut tree: Tree = *trees.get(&cell_index).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `cell_index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Action` which implements the `Copy` trait [INFO] [stdout] --> src/main.rs:505:69 [INFO] [stdout] | [INFO] [stdout] 505 | ...current_game_points, last_day, random_action.clone(), game, current_trees_counts, waiting_players); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*random_action` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:476:49 [INFO] [stdout] | [INFO] [stdout] 476 | let mut tree: Tree = *trees.get(&origin_cell_index).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `origin_cell_index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:543:9 [INFO] [stdout] | [INFO] [stdout] 543 | return 0; [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] 543 - return 0; [INFO] [stdout] 543 + 0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:513:72 [INFO] [stdout] | [INFO] [stdout] 513 | let mut shadow_cost = -calc_shadow_points(*cell_index, &trees, &board, day + 1, false) [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:513:80 [INFO] [stdout] | [INFO] [stdout] 513 | let mut shadow_cost = -calc_shadow_points(*cell_index, &trees, &board, day + 1, false) [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:514:55 [INFO] [stdout] | [INFO] [stdout] 514 | - calc_shadow_points(*cell_index, &trees, &board, day + 2, false); [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:514:63 [INFO] [stdout] | [INFO] [stdout] 514 | - calc_shadow_points(*cell_index, &trees, &board, day + 2, false); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Action` which implements the `Copy` trait [INFO] [stdout] --> src/main.rs:505:69 [INFO] [stdout] | [INFO] [stdout] 505 | ...current_game_points, last_day, random_action.clone(), game, current_trees_counts, waiting_players); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*random_action` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:516:53 [INFO] [stdout] | [INFO] [stdout] 516 | shadow_cost += (match board.get(&cell_index).unwrap().richness { [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `cell_index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:543:9 [INFO] [stdout] | [INFO] [stdout] 543 | return 0; [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] 543 - return 0; [INFO] [stdout] 543 + 0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/main.rs:522:17 [INFO] [stdout] | [INFO] [stdout] 522 | shadow_cost = shadow_cost+day/20*10; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `shadow_cost += day/20*10` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:513:72 [INFO] [stdout] | [INFO] [stdout] 513 | let mut shadow_cost = -calc_shadow_points(*cell_index, &trees, &board, day + 1, false) [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:526:78 [INFO] [stdout] | [INFO] [stdout] 526 | Action::Grow(target_id) => return calc_shadow_points(*target_id, &trees, &board, day + 1, true) [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:513:80 [INFO] [stdout] | [INFO] [stdout] 513 | let mut shadow_cost = -calc_shadow_points(*cell_index, &trees, &board, day + 1, false) [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:526:86 [INFO] [stdout] | [INFO] [stdout] 526 | Action::Grow(target_id) => return calc_shadow_points(*target_id, &trees, &board, day + 1, true) [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:514:55 [INFO] [stdout] | [INFO] [stdout] 514 | - calc_shadow_points(*cell_index, &trees, &board, day + 2, false); [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:527:50 [INFO] [stdout] | [INFO] [stdout] 527 | + calc_shadow_points(*target_id, &trees, &board, day + 2, true) [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:527:58 [INFO] [stdout] | [INFO] [stdout] 527 | + calc_shadow_points(*target_id, &trees, &board, day + 2, true) [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:514:63 [INFO] [stdout] | [INFO] [stdout] 514 | - calc_shadow_points(*cell_index, &trees, &board, day + 2, false); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:516:53 [INFO] [stdout] | [INFO] [stdout] 516 | shadow_cost += (match board.get(&cell_index).unwrap().richness { [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `cell_index` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/main.rs:522:17 [INFO] [stdout] | [INFO] [stdout] 522 | shadow_cost = shadow_cost+day/20*10; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `shadow_cost += day/20*10` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:559:16 [INFO] [stdout] | [INFO] [stdout] 559 | if !action_grow || (action_grow && i == tree_size) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 559 - if !action_grow || (action_grow && i == tree_size) { [INFO] [stdout] 559 + if !(action_grow && i != tree_size) { [INFO] [stdout] | [INFO] [stdout] 559 - if !action_grow || (action_grow && i == tree_size) { [INFO] [stdout] 559 + if !action_grow || i == tree_size { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:526:78 [INFO] [stdout] | [INFO] [stdout] 526 | Action::Grow(target_id) => return calc_shadow_points(*target_id, &trees, &board, day + 1, true) [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:526:86 [INFO] [stdout] | [INFO] [stdout] 526 | Action::Grow(target_id) => return calc_shadow_points(*target_id, &trees, &board, day + 1, true) [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:527:50 [INFO] [stdout] | [INFO] [stdout] 527 | + calc_shadow_points(*target_id, &trees, &board, day + 2, true) [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:527:58 [INFO] [stdout] | [INFO] [stdout] 527 | + calc_shadow_points(*target_id, &trees, &board, day + 2, true) [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:559:13 [INFO] [stdout] | [INFO] [stdout] 559 | / if !action_grow || (action_grow && i == tree_size) { [INFO] [stdout] 560 | | if trees.contains_key(¤t_id) { [INFO] [stdout] 561 | | let tree = trees[¤t_id]; [INFO] [stdout] 562 | | points += if tree.is_mine { [INFO] [stdout] ... | [INFO] [stdout] 571 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 559 ~ if (!action_grow || (action_grow && i == tree_size)) { [INFO] [stdout] 560 ~ && trees.contains_key(¤t_id) { [INFO] [stdout] 561 | let tree = trees[¤t_id]; [INFO] [stdout] ... [INFO] [stdout] 569 | } [INFO] [stdout] 570 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:628:9 [INFO] [stdout] | [INFO] [stdout] 628 | return result_actions; [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] 628 - return result_actions; [INFO] [stdout] 628 + result_actions [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:559:16 [INFO] [stdout] | [INFO] [stdout] 559 | if !action_grow || (action_grow && i == tree_size) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 559 - if !action_grow || (action_grow && i == tree_size) { [INFO] [stdout] 559 + if !(action_grow && i != tree_size) { [INFO] [stdout] | [INFO] [stdout] 559 - if !action_grow || (action_grow && i == tree_size) { [INFO] [stdout] 559 + if !action_grow || i == tree_size { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/main.rs:607:48 [INFO] [stdout] | [INFO] [stdout] 607 | ... = board[&ex_cell].neighbors_ids.iter().filter(|i| **i != -1 && board[i].richness > 0 && !trees.contains_key(i)).map(|i| *i).col... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `board[&ex_cell].neighbors_ids.iter().filter(|i| **i != -1 && board[i].richness > 0 && !trees.contains_key(i)).copied()` [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: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:559:13 [INFO] [stdout] | [INFO] [stdout] 559 | / if !action_grow || (action_grow && i == tree_size) { [INFO] [stdout] 560 | | if trees.contains_key(¤t_id) { [INFO] [stdout] 561 | | let tree = trees[¤t_id]; [INFO] [stdout] 562 | | points += if tree.is_mine { [INFO] [stdout] ... | [INFO] [stdout] 571 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 559 ~ if (!action_grow || (action_grow && i == tree_size)) { [INFO] [stdout] 560 ~ && trees.contains_key(¤t_id) { [INFO] [stdout] 561 | let tree = trees[¤t_id]; [INFO] [stdout] ... [INFO] [stdout] 569 | } [INFO] [stdout] 570 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:628:9 [INFO] [stdout] | [INFO] [stdout] 628 | return result_actions; [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] 628 - return result_actions; [INFO] [stdout] 628 + result_actions [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:644:9 [INFO] [stdout] | [INFO] [stdout] 644 | return result; [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] 644 - return result; [INFO] [stdout] 644 + result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:673:9 [INFO] [stdout] | [INFO] [stdout] 673 | return result; [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] 673 - return result; [INFO] [stdout] 673 + result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/main.rs:607:48 [INFO] [stdout] | [INFO] [stdout] 607 | ... = board[&ex_cell].neighbors_ids.iter().filter(|i| **i != -1 && board[i].richness > 0 && !trees.contains_key(i)).map(|i| *i).col... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `board[&ex_cell].neighbors_ids.iter().filter(|i| **i != -1 && board[i].richness > 0 && !trees.contains_key(i)).copied()` [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: this operation has no effect [INFO] [stdout] --> src/main.rs:649:31 [INFO] [stdout] | [INFO] [stdout] 649 | let mut tree_costs = [0 + my_trees_counts[0], 1 + my_trees_counts[1], 3 + my_trees_counts[2], 7 + my_trees_counts[3]]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `my_trees_counts[0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:644:9 [INFO] [stdout] | [INFO] [stdout] 644 | return result; [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] 644 - return result; [INFO] [stdout] 644 + result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:676:9 [INFO] [stdout] | [INFO] [stdout] 676 | / return match previous_action { [INFO] [stdout] 677 | | Action::Wait => 0, [INFO] [stdout] 678 | | Action::Complete(_) => 4, [INFO] [stdout] 679 | | Action::Seed(_, _) => my_trees_counts[0], [INFO] [stdout] ... | [INFO] [stdout] 696 | | _ => 0 [INFO] [stdout] 697 | | }; [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] 676 ~ match previous_action { [INFO] [stdout] 677 + Action::Wait => 0, [INFO] [stdout] 678 + Action::Complete(_) => 4, [INFO] [stdout] 679 + Action::Seed(_, _) => my_trees_counts[0], [INFO] [stdout] 680 + Action::Grow(target_cell_id) => { [INFO] [stdout] 681 + let tree_size = trees.get(&target_cell_id).unwrap().size + 1; [INFO] [stdout] 682 + let extra_cost = my_trees_counts[tree_size as usize]; [INFO] [stdout] 683 + [INFO] [stdout] 684 + [INFO] [stdout] 685 + if tree_size == 1 { [INFO] [stdout] 686 + return 1 + extra_cost; [INFO] [stdout] 687 + } else if tree_size == 2 { [INFO] [stdout] 688 + return 3 + extra_cost; [INFO] [stdout] 689 + } else if tree_size == 3 { [INFO] [stdout] 690 + return 7 + extra_cost; [INFO] [stdout] 691 + } else { [INFO] [stdout] 692 + //eprintln!("ERROR invalid tree_size {}", tree_size); [INFO] [stdout] 693 + 0 [INFO] [stdout] 694 + } [INFO] [stdout] 695 + } [INFO] [stdout] 696 + _ => 0 [INFO] [stdout] 697 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:681:43 [INFO] [stdout] | [INFO] [stdout] 681 | let tree_size = trees.get(&target_cell_id).unwrap().size + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `target_cell_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:673:9 [INFO] [stdout] | [INFO] [stdout] 673 | return result; [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] 673 - return result; [INFO] [stdout] 673 + result [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/main.rs:649:31 [INFO] [stdout] | [INFO] [stdout] 649 | let mut tree_costs = [0 + my_trees_counts[0], 1 + my_trees_counts[1], 3 + my_trees_counts[2], 7 + my_trees_counts[3]]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `my_trees_counts[0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:714:9 [INFO] [stdout] | [INFO] [stdout] 714 | return sun_points; [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] 714 - return sun_points; [INFO] [stdout] 714 + sun_points [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:711:60 [INFO] [stdout] | [INFO] [stdout] 711 | .map(|(id, tree)| get_sun_points_from_tree(&tree, &board, &trees, sun_direction)).sum(); [INFO] [stdout] | ^^^^^ help: change this to: `tree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:711:67 [INFO] [stdout] | [INFO] [stdout] 711 | .map(|(id, tree)| get_sun_points_from_tree(&tree, &board, &trees, sun_direction)).sum(); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:711:75 [INFO] [stdout] | [INFO] [stdout] 711 | .map(|(id, tree)| get_sun_points_from_tree(&tree, &board, &trees, sun_direction)).sum(); [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:738:9 [INFO] [stdout] | [INFO] [stdout] 738 | return tree.size; [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] 738 - return tree.size; [INFO] [stdout] 738 + tree.size [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:676:9 [INFO] [stdout] | [INFO] [stdout] 676 | / return match previous_action { [INFO] [stdout] 677 | | Action::Wait => 0, [INFO] [stdout] 678 | | Action::Complete(_) => 4, [INFO] [stdout] 679 | | Action::Seed(_, _) => my_trees_counts[0], [INFO] [stdout] ... | [INFO] [stdout] 696 | | _ => 0 [INFO] [stdout] 697 | | }; [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] 676 ~ match previous_action { [INFO] [stdout] 677 + Action::Wait => 0, [INFO] [stdout] 678 + Action::Complete(_) => 4, [INFO] [stdout] 679 + Action::Seed(_, _) => my_trees_counts[0], [INFO] [stdout] 680 + Action::Grow(target_cell_id) => { [INFO] [stdout] 681 + let tree_size = trees.get(&target_cell_id).unwrap().size + 1; [INFO] [stdout] 682 + let extra_cost = my_trees_counts[tree_size as usize]; [INFO] [stdout] 683 + [INFO] [stdout] 684 + [INFO] [stdout] 685 + if tree_size == 1 { [INFO] [stdout] 686 + return 1 + extra_cost; [INFO] [stdout] 687 + } else if tree_size == 2 { [INFO] [stdout] 688 + return 3 + extra_cost; [INFO] [stdout] 689 + } else if tree_size == 3 { [INFO] [stdout] 690 + return 7 + extra_cost; [INFO] [stdout] 691 + } else { [INFO] [stdout] 692 + //eprintln!("ERROR invalid tree_size {}", tree_size); [INFO] [stdout] 693 + 0 [INFO] [stdout] 694 + } [INFO] [stdout] 695 + } [INFO] [stdout] 696 + _ => 0 [INFO] [stdout] 697 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:681:43 [INFO] [stdout] | [INFO] [stdout] 681 | let tree_size = trees.get(&target_cell_id).unwrap().size + 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `target_cell_id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:714:9 [INFO] [stdout] | [INFO] [stdout] 714 | return sun_points; [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] 714 - return sun_points; [INFO] [stdout] 714 + sun_points [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:711:60 [INFO] [stdout] | [INFO] [stdout] 711 | .map(|(id, tree)| get_sun_points_from_tree(&tree, &board, &trees, sun_direction)).sum(); [INFO] [stdout] | ^^^^^ help: change this to: `tree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:711:67 [INFO] [stdout] | [INFO] [stdout] 711 | .map(|(id, tree)| get_sun_points_from_tree(&tree, &board, &trees, sun_direction)).sum(); [INFO] [stdout] | ^^^^^^ help: change this to: `board` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:711:75 [INFO] [stdout] | [INFO] [stdout] 711 | .map(|(id, tree)| get_sun_points_from_tree(&tree, &board, &trees, sun_direction)).sum(); [INFO] [stdout] | ^^^^^^ help: change this to: `trees` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:738:9 [INFO] [stdout] | [INFO] [stdout] 738 | return tree.size; [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] 738 - return tree.size; [INFO] [stdout] 738 + tree.size [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.25s [INFO] running `Command { std: "docker" "inspect" "25e5a815b6ade3a85a5cdb6c61017f2cfa14075b6720b97e08ac62383e140fbd", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "25e5a815b6ade3a85a5cdb6c61017f2cfa14075b6720b97e08ac62383e140fbd", kill_on_drop: false }` [INFO] [stdout] 25e5a815b6ade3a85a5cdb6c61017f2cfa14075b6720b97e08ac62383e140fbd