[INFO] cloning repository https://github.com/PizzasBear/NEAT.rs [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/PizzasBear/NEAT.rs" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FPizzasBear%2FNEAT.rs", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FPizzasBear%2FNEAT.rs'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 10cca9af282b34a35750114cad3fdb0ec84e348e [INFO] linting PizzasBear/NEAT.rs against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FPizzasBear%2FNEAT.rs" "/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/PizzasBear/NEAT.rs [INFO] finished tweaking git repo https://github.com/PizzasBear/NEAT.rs [INFO] tweaked toml for git repo https://github.com/PizzasBear/NEAT.rs written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/PizzasBear/NEAT.rs 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/PizzasBear/NEAT.rs 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] 561c3c6b34bffba7a85d49dbaa60cac28947128993166784ffa7a9ef3fc36e85 [INFO] running `Command { std: "docker" "start" "-a" "561c3c6b34bffba7a85d49dbaa60cac28947128993166784ffa7a9ef3fc36e85", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "561c3c6b34bffba7a85d49dbaa60cac28947128993166784ffa7a9ef3fc36e85", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "561c3c6b34bffba7a85d49dbaa60cac28947128993166784ffa7a9ef3fc36e85", kill_on_drop: false }` [INFO] [stdout] 561c3c6b34bffba7a85d49dbaa60cac28947128993166784ffa7a9ef3fc36e85 [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] 76006e04f6ffb6b1605649318b028987d91cb1fe74e52d96e2c1a15891840486 [INFO] running `Command { std: "docker" "start" "-a" "76006e04f6ffb6b1605649318b028987d91cb1fe74e52d96e2c1a15891840486", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.69 [INFO] [stderr] Compiling getrandom v0.1.14 [INFO] [stderr] Checking rand_core v0.5.1 [INFO] [stderr] Checking rand_chacha v0.2.2 [INFO] [stderr] Checking rand v0.7.3 [INFO] [stderr] Checking rand_distr v0.2.2 [INFO] [stderr] Checking neat v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/neat/neuralnet.rs:47:13 [INFO] [stdout] | [INFO] [stdout] 47 | inputs_count: inputs_count, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `inputs_count` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/neat/neuralnet.rs:48:13 [INFO] [stdout] | [INFO] [stdout] 48 | outputs_count: outputs_count, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `outputs_count` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/neat/neuralnet.rs:127:17 [INFO] [stdout] | [INFO] [stdout] 127 | from: from, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `from` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/neat/neuralnet.rs:128:17 [INFO] [stdout] | [INFO] [stdout] 128 | to: to, [INFO] [stdout] | ^^^^^^ help: replace it with: `to` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/neat/neuralnet.rs:134:13 [INFO] [stdout] | [INFO] [stdout] 134 | innov: innov, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `innov` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/neat/neuralnet.rs:135:13 [INFO] [stdout] | [INFO] [stdout] 135 | weight: weight, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `weight` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/neat/population.rs:13:13 [INFO] [stdout] | [INFO] [stdout] 13 | size: size, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `size` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type `cfg` should have an upper camel case name [INFO] [stdout] --> src/neat/mod.rs:11:8 [INFO] [stdout] | [INFO] [stdout] 11 | struct cfg; [INFO] [stdout] | ^^^ help: convert the identifier to upper camel case (notice the capitalization): `Cfg` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_camel_case_types)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/neat/neuralnet.rs:47:13 [INFO] [stdout] | [INFO] [stdout] 47 | inputs_count: inputs_count, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `inputs_count` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/neat/neuralnet.rs:48:13 [INFO] [stdout] | [INFO] [stdout] 48 | outputs_count: outputs_count, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `outputs_count` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/neat/neuralnet.rs:127:17 [INFO] [stdout] | [INFO] [stdout] 127 | from: from, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `from` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/neat/neuralnet.rs:128:17 [INFO] [stdout] | [INFO] [stdout] 128 | to: to, [INFO] [stdout] | ^^^^^^ help: replace it with: `to` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/neat/neuralnet.rs:134:13 [INFO] [stdout] | [INFO] [stdout] 134 | innov: innov, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `innov` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/neat/neuralnet.rs:135:13 [INFO] [stdout] | [INFO] [stdout] 135 | weight: weight, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `weight` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/neat/population.rs:13:13 [INFO] [stdout] | [INFO] [stdout] 13 | size: size, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `size` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type `cfg` should have an upper camel case name [INFO] [stdout] --> src/neat/mod.rs:11:8 [INFO] [stdout] | [INFO] [stdout] 11 | struct cfg; [INFO] [stdout] | ^^^ help: convert the identifier to upper camel case (notice the capitalization): `Cfg` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_camel_case_types)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/neat/neuralnet.rs:81:16 [INFO] [stdout] | [INFO] [stdout] 81 | if !(j < net2.links.len()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(j >= net2.links.len())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression assigns a bool literal [INFO] [stdout] --> src/neat/neuralnet.rs:93:21 [INFO] [stdout] | [INFO] [stdout] 93 | / if Uniform::from(0.0..1.0).sample(&mut thread_rng()) [INFO] [stdout] 94 | | < conf.link_enabling_in_child_prob() [INFO] [stdout] 95 | | { [INFO] [stdout] 96 | | out_link.enabled = true; [INFO] [stdout] 97 | | } else { [INFO] [stdout] 98 | | out_link.enabled = false; [INFO] [stdout] 99 | | } [INFO] [stdout] | |_____________________^ help: you can reduce it to: `out_link.enabled = Uniform::from(0.0..1.0).sample(&mut thread_rng()) < conf.link_enabling_in_child_prob();` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign [INFO] [stdout] = note: `#[warn(clippy::needless_bool_assign)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `innovs` [INFO] [stdout] --> src/neat/neuralnet.rs:118:18 [INFO] [stdout] | [INFO] [stdout] 118 | for i in old_innovs_count..innov { [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 118 - for i in old_innovs_count..innov { [INFO] [stdout] 118 + for (i, ) in innovs.iter().enumerate().take(innov).skip(old_innovs_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping `to` and `from` manually [INFO] [stdout] --> src/neat/neuralnet.rs:165:13 [INFO] [stdout] | [INFO] [stdout] 165 | / let tmp = to; [INFO] [stdout] 166 | | to = from; [INFO] [stdout] 167 | | from = tmp; [INFO] [stdout] | |_______________________^ help: try: `std::mem::swap(&mut to, &mut from);` [INFO] [stdout] | [INFO] [stdout] = note: or maybe you should use `std::mem::replace`? [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] = note: `#[warn(clippy::manual_swap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/neat/neuralnet.rs:268:66 [INFO] [stdout] | [INFO] [stdout] 268 | pub fn creates_cycles(&self, from: usize, to: usize, innovs: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 268 - pub fn creates_cycles(&self, from: usize, to: usize, innovs: &Vec) -> bool { [INFO] [stdout] 268 + pub fn creates_cycles(&self, from: usize, to: usize, innovs: &[Innov]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/neat/population.rs:59:16 [INFO] [stdout] | [INFO] [stdout] 59 | if species.members.len() == 0 || conf.get_staleness_threshold() <= species.staleness { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `species.members.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/neat/species.rs:24:48 [INFO] [stdout] | [INFO] [stdout] 24 | pub fn choose_random_repr(&mut self, nets: &Vec) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 24 - pub fn choose_random_repr(&mut self, nets: &Vec) { [INFO] [stdout] 24 + pub fn choose_random_repr(&mut self, nets: &[Net]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/neat/species.rs:69:45 [INFO] [stdout] | [INFO] [stdout] 69 | pub fn fitness_sharing(&mut self, nets: &Vec) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 69 - pub fn fitness_sharing(&mut self, nets: &Vec) { [INFO] [stdout] 69 + pub fn fitness_sharing(&mut self, nets: &[Net]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping `to_p1_shared_fitness_sum` and `to_p2_shared_fitness_sum` manually [INFO] [stdout] --> src/neat/species.rs:113:13 [INFO] [stdout] | [INFO] [stdout] 113 | / let tmp = to_p1_shared_fitness_sum; [INFO] [stdout] 114 | | to_p1_shared_fitness_sum = to_p2_shared_fitness_sum; [INFO] [stdout] 115 | | to_p2_shared_fitness_sum = tmp; [INFO] [stdout] | |___________________________________________^ help: try: `std::mem::swap(&mut to_p1_shared_fitness_sum, &mut to_p2_shared_fitness_sum);` [INFO] [stdout] | [INFO] [stdout] = note: or maybe you should use `std::mem::replace`? [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/neat/species.rs:140:34 [INFO] [stdout] | [INFO] [stdout] 140 | pub fn cull(&mut self, nets: &Vec, conf: &dyn Conf) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 140 - pub fn cull(&mut self, nets: &Vec, conf: &dyn Conf) { [INFO] [stdout] 140 + pub fn cull(&mut self, nets: &[Net], conf: &dyn Conf) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/neat/species.rs:158:15 [INFO] [stdout] | [INFO] [stdout] 158 | nets: &Vec, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 158 - nets: &Vec, [INFO] [stdout] 158 + nets: &[Net], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/neat/neuralnet.rs:81:16 [INFO] [stdout] | [INFO] [stdout] 81 | if !(j < net2.links.len()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(j >= net2.links.len())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression assigns a bool literal [INFO] [stdout] --> src/neat/neuralnet.rs:93:21 [INFO] [stdout] | [INFO] [stdout] 93 | / if Uniform::from(0.0..1.0).sample(&mut thread_rng()) [INFO] [stdout] 94 | | < conf.link_enabling_in_child_prob() [INFO] [stdout] 95 | | { [INFO] [stdout] 96 | | out_link.enabled = true; [INFO] [stdout] 97 | | } else { [INFO] [stdout] 98 | | out_link.enabled = false; [INFO] [stdout] 99 | | } [INFO] [stdout] | |_____________________^ help: you can reduce it to: `out_link.enabled = Uniform::from(0.0..1.0).sample(&mut thread_rng()) < conf.link_enabling_in_child_prob();` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign [INFO] [stdout] = note: `#[warn(clippy::needless_bool_assign)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `innovs` [INFO] [stdout] --> src/neat/neuralnet.rs:118:18 [INFO] [stdout] | [INFO] [stdout] 118 | for i in old_innovs_count..innov { [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 and enumerate() [INFO] [stdout] | [INFO] [stdout] 118 - for i in old_innovs_count..innov { [INFO] [stdout] 118 + for (i, ) in innovs.iter().enumerate().take(innov).skip(old_innovs_count) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping `to` and `from` manually [INFO] [stdout] --> src/neat/neuralnet.rs:165:13 [INFO] [stdout] | [INFO] [stdout] 165 | / let tmp = to; [INFO] [stdout] 166 | | to = from; [INFO] [stdout] 167 | | from = tmp; [INFO] [stdout] | |_______________________^ help: try: `std::mem::swap(&mut to, &mut from);` [INFO] [stdout] | [INFO] [stdout] = note: or maybe you should use `std::mem::replace`? [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] = note: `#[warn(clippy::manual_swap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/neat/neuralnet.rs:268:66 [INFO] [stdout] | [INFO] [stdout] 268 | pub fn creates_cycles(&self, from: usize, to: usize, innovs: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 268 - pub fn creates_cycles(&self, from: usize, to: usize, innovs: &Vec) -> bool { [INFO] [stdout] 268 + pub fn creates_cycles(&self, from: usize, to: usize, innovs: &[Innov]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/neat/population.rs:59:16 [INFO] [stdout] | [INFO] [stdout] 59 | if species.members.len() == 0 || conf.get_staleness_threshold() <= species.staleness { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `species.members.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/neat/species.rs:24:48 [INFO] [stdout] | [INFO] [stdout] 24 | pub fn choose_random_repr(&mut self, nets: &Vec) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 24 - pub fn choose_random_repr(&mut self, nets: &Vec) { [INFO] [stdout] 24 + pub fn choose_random_repr(&mut self, nets: &[Net]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/neat/species.rs:69:45 [INFO] [stdout] | [INFO] [stdout] 69 | pub fn fitness_sharing(&mut self, nets: &Vec) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 69 - pub fn fitness_sharing(&mut self, nets: &Vec) { [INFO] [stdout] 69 + pub fn fitness_sharing(&mut self, nets: &[Net]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like you are swapping `to_p1_shared_fitness_sum` and `to_p2_shared_fitness_sum` manually [INFO] [stdout] --> src/neat/species.rs:113:13 [INFO] [stdout] | [INFO] [stdout] 113 | / let tmp = to_p1_shared_fitness_sum; [INFO] [stdout] 114 | | to_p1_shared_fitness_sum = to_p2_shared_fitness_sum; [INFO] [stdout] 115 | | to_p2_shared_fitness_sum = tmp; [INFO] [stdout] | |___________________________________________^ help: try: `std::mem::swap(&mut to_p1_shared_fitness_sum, &mut to_p2_shared_fitness_sum);` [INFO] [stdout] | [INFO] [stdout] = note: or maybe you should use `std::mem::replace`? [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_swap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/neat/species.rs:140:34 [INFO] [stdout] | [INFO] [stdout] 140 | pub fn cull(&mut self, nets: &Vec, conf: &dyn Conf) { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 140 - pub fn cull(&mut self, nets: &Vec, conf: &dyn Conf) { [INFO] [stdout] 140 + pub fn cull(&mut self, nets: &[Net], conf: &dyn Conf) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/neat/species.rs:158:15 [INFO] [stdout] | [INFO] [stdout] 158 | nets: &Vec, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 158 - nets: &Vec, [INFO] [stdout] 158 + nets: &[Net], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 2.84s [INFO] running `Command { std: "docker" "inspect" "76006e04f6ffb6b1605649318b028987d91cb1fe74e52d96e2c1a15891840486", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "76006e04f6ffb6b1605649318b028987d91cb1fe74e52d96e2c1a15891840486", kill_on_drop: false }` [INFO] [stdout] 76006e04f6ffb6b1605649318b028987d91cb1fe74e52d96e2c1a15891840486