[INFO] fetching crate genx 0.4.0... [INFO] linting genx-0.4.0 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate genx 0.4.0 into /workspace/builds/worker-1-tc1/source [INFO] started tweaking crates.io crate genx 0.4.0 [INFO] finished tweaking crates.io crate genx 0.4.0 [INFO] tweaked toml for crates.io crate genx 0.4.0 written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate genx 0.4.0 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 crates.io crate genx 0.4.0 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded getrandom v0.2.3 [INFO] [stderr] Downloaded either v1.6.1 [INFO] [stderr] Downloaded rand_hc v0.3.1 [INFO] [stderr] Downloaded wasi v0.10.0+wasi-snapshot-preview1 [INFO] [stderr] Downloaded ppv-lite86 v0.2.15 [INFO] [stderr] Downloaded rand v0.8.4 [INFO] [stderr] Downloaded itertools v0.10.1 [INFO] [stderr] Downloaded libc v0.2.106 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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] 8ace9aeae9d749090f8a9c3388bde9f477ee13e1079c5247cfe416667abd5233 [INFO] running `Command { std: "docker" "start" "-a" "8ace9aeae9d749090f8a9c3388bde9f477ee13e1079c5247cfe416667abd5233", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "8ace9aeae9d749090f8a9c3388bde9f477ee13e1079c5247cfe416667abd5233", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "8ace9aeae9d749090f8a9c3388bde9f477ee13e1079c5247cfe416667abd5233", kill_on_drop: false }` [INFO] [stdout] 8ace9aeae9d749090f8a9c3388bde9f477ee13e1079c5247cfe416667abd5233 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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] ca9c94b7deb7847318bfeb89ae36ce9333a530316114eca094f0820f17ebebb2 [INFO] running `Command { std: "docker" "start" "-a" "ca9c94b7deb7847318bfeb89ae36ce9333a530316114eca094f0820f17ebebb2", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.106 [INFO] [stderr] Checking cfg-if v1.0.0 [INFO] [stderr] Checking ppv-lite86 v0.2.15 [INFO] [stderr] Checking either v1.6.1 [INFO] [stderr] Checking itertools v0.10.1 [INFO] [stderr] Checking getrandom v0.2.3 [INFO] [stderr] Checking rand_core v0.6.3 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand v0.8.4 [INFO] [stderr] Checking genx v0.4.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: value assigned to `random_offset` is never read [INFO] [stdout] --> src/selection/stochastic_universal.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | random_offset += fitness_step; [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: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mutation/flipping.rs:28:38 [INFO] [stdout] | [INFO] [stdout] 28 | pub fn flipping_mutation(individual: &mut Vec, mutation_probability: f32, seed: Option) -> Result<(), &'static str> { [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] 28 - pub fn flipping_mutation(individual: &mut Vec, mutation_probability: f32, seed: Option) -> Result<(), &'static str> { [INFO] [stdout] 28 + pub fn flipping_mutation(individual: &mut [bool], mutation_probability: f32, seed: Option) -> Result<(), &'static str> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/mutation/flipping.rs:29:6 [INFO] [stdout] | [INFO] [stdout] 29 | if mutation_probability < 0.0 || mutation_probability > 1.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(0.0..=1.0).contains(&mutation_probability)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mutation/inversion.rs:24:39 [INFO] [stdout] | [INFO] [stdout] 24 | pub fn inversion_mutation(individual: &mut Vec, seed: Option) { [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 inversion_mutation(individual: &mut Vec, seed: Option) { [INFO] [stdout] 24 + pub fn inversion_mutation(individual: &mut [bool], seed: Option) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `idx` is only used to index `individual` [INFO] [stdout] --> src/mutation/inversion.rs:39:14 [INFO] [stdout] | [INFO] [stdout] 39 | for idx in idx1..=idx2 { [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] 39 - for idx in idx1..=idx2 { [INFO] [stdout] 39 + for in individual.iter_mut().take(idx2 + 1).skip(idx1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/mutation/polynomial.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | return 1.0 - (2.0*(1.0 - random_value).powf(1.0/(distribution_index + 1.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] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 36 - return 1.0 - (2.0*(1.0 - random_value).powf(1.0/(distribution_index + 1.0))); [INFO] [stdout] 36 + 1.0 - (2.0*(1.0 - random_value).powf(1.0/(distribution_index + 1.0))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mutation/scramble.rs:24:41 [INFO] [stdout] | [INFO] [stdout] 24 | pub fn scramble_mutation(individual: &mut Vec, seed: Option) { [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 scramble_mutation(individual: &mut Vec, seed: Option) { [INFO] [stdout] 24 + pub fn scramble_mutation(individual: &mut [T], seed: Option) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mutation/swap.rs:21:37 [INFO] [stdout] | [INFO] [stdout] 21 | pub fn swap_mutation(individual: &mut Vec, seed: Option) -> Result<(), &'static str> [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] 21 - pub fn swap_mutation(individual: &mut Vec, seed: Option) -> Result<(), &'static str> [INFO] [stdout] 21 + pub fn swap_mutation(individual: &mut [T], seed: Option) -> Result<(), &'static str> [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/mutation/swap.rs:39:28 [INFO] [stdout] | [INFO] [stdout] 39 | let selected_indices = fitness_values_with_index [INFO] [stdout] | ____________________________^ [INFO] [stdout] 40 | | .choose_multiple(&mut prng, 2) [INFO] [stdout] 41 | | .map(|&x| x) [INFO] [stdout] | |____________________^ [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] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 39 ~ let selected_indices = fitness_values_with_index [INFO] [stdout] 40 + .choose_multiple(&mut prng, 2).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/selection/random.rs:31:23 [INFO] [stdout] | [INFO] [stdout] 31 | (0..population_size).map(|x| x).choose_multiple(&mut prng, min(num_parents, population_size)) [INFO] [stdout] | ^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] = note: `#[warn(clippy::map_identity)]` 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/selection/rank.rs:28:39 [INFO] [stdout] | [INFO] [stdout] 28 | pub fn rank_selection(fitness_values: &Vec, num_parents: usize, seed: Option) -> 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] 28 - pub fn rank_selection(fitness_values: &Vec, num_parents: usize, seed: Option) -> Vec { [INFO] [stdout] 28 + pub fn rank_selection(fitness_values: &[f32], num_parents: usize, seed: Option) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `random_offset` is never read [INFO] [stdout] --> src/selection/stochastic_universal.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | random_offset += fitness_step; [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/selection/roulette_wheel.rs:27:49 [INFO] [stdout] | [INFO] [stdout] 27 | pub fn roulette_wheel_selection(fitness_values: &Vec, num_parents: usize, seed: Option) -> 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] 27 - pub fn roulette_wheel_selection(fitness_values: &Vec, num_parents: usize, seed: Option) -> Vec { [INFO] [stdout] 27 + pub fn roulette_wheel_selection(fitness_values: &[f32], num_parents: usize, seed: Option) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/selection/steady_state.rs:22:47 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn steady_state_selection(fitness_values: &Vec, num_parents: usize) -> 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] 22 - pub fn steady_state_selection(fitness_values: &Vec, num_parents: usize) -> Vec { [INFO] [stdout] 22 + pub fn steady_state_selection(fitness_values: &[f32], num_parents: usize) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/selection/stochastic_universal.rs:27:21 [INFO] [stdout] | [INFO] [stdout] 27 | fitness_values: &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] 27 - fitness_values: &Vec, [INFO] [stdout] 27 + fitness_values: &[f32], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/selection/stochastic_universal.rs:39:13 [INFO] [stdout] | [INFO] [stdout] 39 | back = val + back; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `back += val` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/selection/tournament.rs:26:45 [INFO] [stdout] | [INFO] [stdout] 26 | pub fn tournament_selection(fitness_values: &Vec, num_parents: usize, tournament_size: usize, seed: Option) -> 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] 26 - pub fn tournament_selection(fitness_values: &Vec, num_parents: usize, tournament_size: usize, seed: Option) -> Vec { [INFO] [stdout] 26 + pub fn tournament_selection(fitness_values: &[f32], num_parents: usize, tournament_size: usize, seed: Option) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/selection/tournament.rs:39:36 [INFO] [stdout] | [INFO] [stdout] 39 | ...nament = fitness_values_with_index.choose_multiple(&mut prng, min(tournament_size, number_individuals)).map(|&x| x).collect:: src/crossover/single_point.rs:31:5 [INFO] [stdout] | [INFO] [stdout] 31 | return (child1, child2); [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] 31 - return (child1, child2); [INFO] [stdout] 31 + (child1, child2) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/crossover/multi_point.rs:58:5 [INFO] [stdout] | [INFO] [stdout] 58 | return (child1, child2); [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] 58 - return (child1, child2); [INFO] [stdout] 58 + (child1, child2) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/crossover/multi_point.rs:20:23 [INFO] [stdout] | [INFO] [stdout] 20 | let mut indices = (0..n) [INFO] [stdout] | _______________________^ [INFO] [stdout] 21 | | .collect::>() [INFO] [stdout] 22 | | .choose_multiple(&mut prng, k) [INFO] [stdout] 23 | | .map(|&x| x) [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 20 ~ let mut indices = (0..n) [INFO] [stdout] 21 + .collect::>() [INFO] [stdout] 22 + .choose_multiple(&mut prng, k).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/crossover/shuffle.rs:29:3 [INFO] [stdout] | [INFO] [stdout] 29 | return (child1, child2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 29 - return (child1, child2); [INFO] [stdout] 29 + (child1, child2) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/crossover/uniform.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | return (child1, child2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 29 - return (child1, child2); [INFO] [stdout] 29 + (child1, child2) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/crossover/partially_mapped.rs:18:28 [INFO] [stdout] | [INFO] [stdout] 18 | let mut selected = (0..n).map(|x| x).choose_multiple(&mut prng, 2); [INFO] [stdout] | ^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/crossover/order.rs:20:30 [INFO] [stdout] | [INFO] [stdout] 20 | let mut selected = (0..n).map(|x| x).choose_multiple(&mut prng, 2); [INFO] [stdout] | ^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/crossover/cycle.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | while !set.get(¤t_val.0).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `set.get(¤t_val.0).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/crossover/cycle.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | while !set.get(¤t_val.0).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `set.get(¤t_val.0).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(¤t_val.0).is_some()` [INFO] [stdout] --> src/crossover/cycle.rs:25:14 [INFO] [stdout] | [INFO] [stdout] 25 | while !set.get(¤t_val.0).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains(¤t_val.0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(¤t_val.0).is_some()` [INFO] [stdout] --> src/crossover/cycle.rs:33:14 [INFO] [stdout] | [INFO] [stdout] 33 | while !set.get(¤t_val.0).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains(¤t_val.0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/crossover/linear.rs:1:65 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn linear_crossover(parent1: f32, parent2: f32, parameters: &Vec<(f32, f32)>) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 1 - pub fn linear_crossover(parent1: f32, parent2: f32, parameters: &Vec<(f32, f32)>) -> Vec { [INFO] [stdout] 1 + pub fn linear_crossover(parent1: f32, parent2: f32, parameters: &[(f32, f32)]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/crossover/simulated_binary.rs:11:7 [INFO] [stdout] | [INFO] [stdout] 11 | return (2.0*ui).powf(1.0/(operator + 1.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] 11 - return (2.0*ui).powf(1.0/(operator + 1.0)); [INFO] [stdout] 11 + (2.0*ui).powf(1.0/(operator + 1.0)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/crossover/simulated_binary.rs:14:7 [INFO] [stdout] | [INFO] [stdout] 14 | return (1.0/(2.0*(1.0 - ui))).powf(1.0/(operator + 1.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] 14 - return (1.0/(2.0*(1.0 - ui))).powf(1.0/(operator + 1.0)); [INFO] [stdout] 14 + (1.0/(2.0*(1.0 - ui))).powf(1.0/(operator + 1.0)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/crossover/uniform_partially_mapped.rs:28:30 [INFO] [stdout] | [INFO] [stdout] 28 | let mut selected = (0..n).map(|x| x).choose_multiple(&mut prng, 2); [INFO] [stdout] | ^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mutation/flipping.rs:28:38 [INFO] [stdout] | [INFO] [stdout] 28 | pub fn flipping_mutation(individual: &mut Vec, mutation_probability: f32, seed: Option) -> Result<(), &'static str> { [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] 28 - pub fn flipping_mutation(individual: &mut Vec, mutation_probability: f32, seed: Option) -> Result<(), &'static str> { [INFO] [stdout] 28 + pub fn flipping_mutation(individual: &mut [bool], mutation_probability: f32, seed: Option) -> Result<(), &'static str> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> src/mutation/flipping.rs:29:6 [INFO] [stdout] | [INFO] [stdout] 29 | if mutation_probability < 0.0 || mutation_probability > 1.0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(0.0..=1.0).contains(&mutation_probability)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/crossover/mod.rs:47:26 [INFO] [stdout] | [INFO] [stdout] 47 | fn check_continuous(vec: &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] help: change this to [INFO] [stdout] | [INFO] [stdout] 47 - fn check_continuous(vec: &Vec) -> bool { [INFO] [stdout] 47 + fn check_continuous(vec: &[usize]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mutation/inversion.rs:24:39 [INFO] [stdout] | [INFO] [stdout] 24 | pub fn inversion_mutation(individual: &mut Vec, seed: Option) { [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 inversion_mutation(individual: &mut Vec, seed: Option) { [INFO] [stdout] 24 + pub fn inversion_mutation(individual: &mut [bool], seed: Option) { [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/crossover/mod.rs:60:30 [INFO] [stdout] | [INFO] [stdout] 60 | fn check_length(parent1 : &Vec, parent2 : &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] 60 - fn check_length(parent1 : &Vec, parent2 : &Vec) { [INFO] [stdout] 60 + fn check_length(parent1 : &[T], parent2 : &Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `idx` is only used to index `individual` [INFO] [stdout] --> src/mutation/inversion.rs:39:14 [INFO] [stdout] | [INFO] [stdout] 39 | for idx in idx1..=idx2 { [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] 39 - for idx in idx1..=idx2 { [INFO] [stdout] 39 + for in individual.iter_mut().take(idx2 + 1).skip(idx1) { [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/crossover/mod.rs:60:49 [INFO] [stdout] | [INFO] [stdout] 60 | fn check_length(parent1 : &Vec, parent2 : &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] 60 - fn check_length(parent1 : &Vec, parent2 : &Vec) { [INFO] [stdout] 60 + fn check_length(parent1 : &Vec, parent2 : &[T]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/mutation/polynomial.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | return 1.0 - (2.0*(1.0 - random_value).powf(1.0/(distribution_index + 1.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] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 36 - return 1.0 - (2.0*(1.0 - random_value).powf(1.0/(distribution_index + 1.0))); [INFO] [stdout] 36 + 1.0 - (2.0*(1.0 - random_value).powf(1.0/(distribution_index + 1.0))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this multiplication by -1 can be written more succinctly [INFO] [stdout] --> src/scaling/linear.rs:23:28 [INFO] [stdout] | [INFO] [stdout] 23 | if *minimum_fitness <= -1.0 * b / a { [INFO] [stdout] | ^^^^^^^^ help: consider using: `-b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [INFO] [stdout] = note: `#[warn(clippy::neg_multiply)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mutation/scramble.rs:24:41 [INFO] [stdout] | [INFO] [stdout] 24 | pub fn scramble_mutation(individual: &mut Vec, seed: Option) { [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 scramble_mutation(individual: &mut Vec, seed: Option) { [INFO] [stdout] 24 + pub fn scramble_mutation(individual: &mut [T], seed: Option) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/scaling/sigma.rs:14:7 [INFO] [stdout] | [INFO] [stdout] 14 | *x = *x - worst_fitness; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*x -= worst_fitness` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/scaling/sigma.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | *x = *x + 1.0; [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace it with: `*x += 1.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mutation/swap.rs:21:37 [INFO] [stdout] | [INFO] [stdout] 21 | pub fn swap_mutation(individual: &mut Vec, seed: Option) -> Result<(), &'static str> [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] 21 - pub fn swap_mutation(individual: &mut Vec, seed: Option) -> Result<(), &'static str> [INFO] [stdout] 21 + pub fn swap_mutation(individual: &mut [T], seed: Option) -> Result<(), &'static str> [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/mutation/swap.rs:39:28 [INFO] [stdout] | [INFO] [stdout] 39 | let selected_indices = fitness_values_with_index [INFO] [stdout] | ____________________________^ [INFO] [stdout] 40 | | .choose_multiple(&mut prng, 2) [INFO] [stdout] 41 | | .map(|&x| x) [INFO] [stdout] | |____________________^ [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] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 39 ~ let selected_indices = fitness_values_with_index [INFO] [stdout] 40 + .choose_multiple(&mut prng, 2).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/selection/random.rs:31:23 [INFO] [stdout] | [INFO] [stdout] 31 | (0..population_size).map(|x| x).choose_multiple(&mut prng, min(num_parents, population_size)) [INFO] [stdout] | ^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] = note: `#[warn(clippy::map_identity)]` 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/selection/rank.rs:28:39 [INFO] [stdout] | [INFO] [stdout] 28 | pub fn rank_selection(fitness_values: &Vec, num_parents: usize, seed: Option) -> 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] 28 - pub fn rank_selection(fitness_values: &Vec, num_parents: usize, seed: Option) -> Vec { [INFO] [stdout] 28 + pub fn rank_selection(fitness_values: &[f32], num_parents: usize, seed: Option) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/selection/roulette_wheel.rs:27:49 [INFO] [stdout] | [INFO] [stdout] 27 | pub fn roulette_wheel_selection(fitness_values: &Vec, num_parents: usize, seed: Option) -> 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] 27 - pub fn roulette_wheel_selection(fitness_values: &Vec, num_parents: usize, seed: Option) -> Vec { [INFO] [stdout] 27 + pub fn roulette_wheel_selection(fitness_values: &[f32], num_parents: usize, seed: Option) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/selection/steady_state.rs:22:47 [INFO] [stdout] | [INFO] [stdout] 22 | pub fn steady_state_selection(fitness_values: &Vec, num_parents: usize) -> 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] 22 - pub fn steady_state_selection(fitness_values: &Vec, num_parents: usize) -> Vec { [INFO] [stdout] 22 + pub fn steady_state_selection(fitness_values: &[f32], num_parents: usize) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/selection/stochastic_universal.rs:27:21 [INFO] [stdout] | [INFO] [stdout] 27 | fitness_values: &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] 27 - fitness_values: &Vec, [INFO] [stdout] 27 + fitness_values: &[f32], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/selection/stochastic_universal.rs:39:13 [INFO] [stdout] | [INFO] [stdout] 39 | back = val + back; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `back += val` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/selection/tournament.rs:26:45 [INFO] [stdout] | [INFO] [stdout] 26 | pub fn tournament_selection(fitness_values: &Vec, num_parents: usize, tournament_size: usize, seed: Option) -> 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] 26 - pub fn tournament_selection(fitness_values: &Vec, num_parents: usize, tournament_size: usize, seed: Option) -> Vec { [INFO] [stdout] 26 + pub fn tournament_selection(fitness_values: &[f32], num_parents: usize, tournament_size: usize, seed: Option) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/selection/tournament.rs:39:36 [INFO] [stdout] | [INFO] [stdout] 39 | ...nament = fitness_values_with_index.choose_multiple(&mut prng, min(tournament_size, number_individuals)).map(|&x| x).collect:: src/crossover/single_point.rs:31:5 [INFO] [stdout] | [INFO] [stdout] 31 | return (child1, child2); [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] 31 - return (child1, child2); [INFO] [stdout] 31 + (child1, child2) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/crossover/multi_point.rs:58:5 [INFO] [stdout] | [INFO] [stdout] 58 | return (child1, child2); [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] 58 - return (child1, child2); [INFO] [stdout] 58 + (child1, child2) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/crossover/multi_point.rs:20:23 [INFO] [stdout] | [INFO] [stdout] 20 | let mut indices = (0..n) [INFO] [stdout] | _______________________^ [INFO] [stdout] 21 | | .collect::>() [INFO] [stdout] 22 | | .choose_multiple(&mut prng, k) [INFO] [stdout] 23 | | .map(|&x| x) [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] help: consider calling the dedicated `copied` method [INFO] [stdout] | [INFO] [stdout] 20 ~ let mut indices = (0..n) [INFO] [stdout] 21 + .collect::>() [INFO] [stdout] 22 + .choose_multiple(&mut prng, k).copied() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/crossover/shuffle.rs:29:3 [INFO] [stdout] | [INFO] [stdout] 29 | return (child1, child2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 29 - return (child1, child2); [INFO] [stdout] 29 + (child1, child2) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/crossover/uniform.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | return (child1, child2); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 29 - return (child1, child2); [INFO] [stdout] 29 + (child1, child2) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/crossover/partially_mapped.rs:18:28 [INFO] [stdout] | [INFO] [stdout] 18 | let mut selected = (0..n).map(|x| x).choose_multiple(&mut prng, 2); [INFO] [stdout] | ^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/crossover/order.rs:20:30 [INFO] [stdout] | [INFO] [stdout] 20 | let mut selected = (0..n).map(|x| x).choose_multiple(&mut prng, 2); [INFO] [stdout] | ^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/crossover/cycle.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | while !set.get(¤t_val.0).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `set.get(¤t_val.0).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/crossover/cycle.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | while !set.get(¤t_val.0).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `set.get(¤t_val.0).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(¤t_val.0).is_some()` [INFO] [stdout] --> src/crossover/cycle.rs:25:14 [INFO] [stdout] | [INFO] [stdout] 25 | while !set.get(¤t_val.0).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains(¤t_val.0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `get(¤t_val.0).is_some()` [INFO] [stdout] --> src/crossover/cycle.rs:33:14 [INFO] [stdout] | [INFO] [stdout] 33 | while !set.get(¤t_val.0).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `contains(¤t_val.0)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/crossover/linear.rs:1:65 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn linear_crossover(parent1: f32, parent2: f32, parameters: &Vec<(f32, f32)>) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 1 - pub fn linear_crossover(parent1: f32, parent2: f32, parameters: &Vec<(f32, f32)>) -> Vec { [INFO] [stdout] 1 + pub fn linear_crossover(parent1: f32, parent2: f32, parameters: &[(f32, f32)]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/crossover/simulated_binary.rs:11:7 [INFO] [stdout] | [INFO] [stdout] 11 | return (2.0*ui).powf(1.0/(operator + 1.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] 11 - return (2.0*ui).powf(1.0/(operator + 1.0)); [INFO] [stdout] 11 + (2.0*ui).powf(1.0/(operator + 1.0)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/crossover/simulated_binary.rs:14:7 [INFO] [stdout] | [INFO] [stdout] 14 | return (1.0/(2.0*(1.0 - ui))).powf(1.0/(operator + 1.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] 14 - return (1.0/(2.0*(1.0 - ui))).powf(1.0/(operator + 1.0)); [INFO] [stdout] 14 + (1.0/(2.0*(1.0 - ui))).powf(1.0/(operator + 1.0)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary map of the identity function [INFO] [stdout] --> src/crossover/uniform_partially_mapped.rs:28:30 [INFO] [stdout] | [INFO] [stdout] 28 | let mut selected = (0..n).map(|x| x).choose_multiple(&mut prng, 2); [INFO] [stdout] | ^^^^^^^^^^^ help: remove the call to `map` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_identity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/crossover/mod.rs:47:26 [INFO] [stdout] | [INFO] [stdout] 47 | fn check_continuous(vec: &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] help: change this to [INFO] [stdout] | [INFO] [stdout] 47 - fn check_continuous(vec: &Vec) -> bool { [INFO] [stdout] 47 + fn check_continuous(vec: &[usize]) -> bool { [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/crossover/mod.rs:60:30 [INFO] [stdout] | [INFO] [stdout] 60 | fn check_length(parent1 : &Vec, parent2 : &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] 60 - fn check_length(parent1 : &Vec, parent2 : &Vec) { [INFO] [stdout] 60 + fn check_length(parent1 : &[T], parent2 : &Vec) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/crossover/mod.rs:60:49 [INFO] [stdout] | [INFO] [stdout] 60 | fn check_length(parent1 : &Vec, parent2 : &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] 60 - fn check_length(parent1 : &Vec, parent2 : &Vec) { [INFO] [stdout] 60 + fn check_length(parent1 : &Vec, parent2 : &[T]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this multiplication by -1 can be written more succinctly [INFO] [stdout] --> src/scaling/linear.rs:23:28 [INFO] [stdout] | [INFO] [stdout] 23 | if *minimum_fitness <= -1.0 * b / a { [INFO] [stdout] | ^^^^^^^^ help: consider using: `-b` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [INFO] [stdout] = note: `#[warn(clippy::neg_multiply)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/scaling/sigma.rs:14:7 [INFO] [stdout] | [INFO] [stdout] 14 | *x = *x - worst_fitness; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*x -= worst_fitness` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/scaling/sigma.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | *x = *x + 1.0; [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace it with: `*x += 1.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f32` which implements the `Copy` trait [INFO] [stdout] --> examples/eqn.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | / population [INFO] [stdout] 30 | | .iter() [INFO] [stdout] 31 | | .max_by(|&a, &b| { [INFO] [stdout] 32 | | fitness_function(*a) [INFO] [stdout] ... | [INFO] [stdout] 36 | | .unwrap() [INFO] [stdout] 37 | | .clone() [INFO] [stdout] | |____________________^ [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] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 29 ~ *population [INFO] [stdout] 30 + .iter() [INFO] [stdout] 31 + .max_by(|&a, &b| { [INFO] [stdout] 32 + fitness_function(*a) [INFO] [stdout] 33 + .partial_cmp(&fitness_function(*b)) [INFO] [stdout] 34 + .unwrap_or(std::cmp::Ordering::Equal) [INFO] [stdout] 35 + }) [INFO] [stdout] 36 + .unwrap() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> examples/gen_eqn.rs:14:13 [INFO] [stdout] | [INFO] [stdout] 14 | val = val + pow * i; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace it with: `val += pow * i` [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: manual implementation of an assign operation [INFO] [stdout] --> examples/gen_eqn.rs:15:13 [INFO] [stdout] | [INFO] [stdout] 15 | pow = pow * x; [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace it with: `pow *= x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `f32` which implements the `Copy` trait [INFO] [stdout] --> examples/gen_eqn.rs:38:9 [INFO] [stdout] | [INFO] [stdout] 38 | / population [INFO] [stdout] 39 | | .iter() [INFO] [stdout] 40 | | .max_by(|&a, &b| { [INFO] [stdout] 41 | | fitness_function(*a) [INFO] [stdout] ... | [INFO] [stdout] 45 | | .unwrap() [INFO] [stdout] 46 | | .clone() [INFO] [stdout] | |____________________^ [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] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 38 ~ *population [INFO] [stdout] 39 + .iter() [INFO] [stdout] 40 + .max_by(|&a, &b| { [INFO] [stdout] 41 + fitness_function(*a) [INFO] [stdout] 42 + .partial_cmp(&fitness_function(*b)) [INFO] [stdout] 43 + .unwrap_or(std::cmp::Ordering::Equal) [INFO] [stdout] 44 + }) [INFO] [stdout] 45 + .unwrap() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> examples/gen_eqn.rs:9:16 [INFO] [stdout] | [INFO] [stdout] 9 | let poly = vec![1.0, -2.0, 1.0]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[1.0, -2.0, 1.0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> examples/tsp.rs:68:18 [INFO] [stdout] | [INFO] [stdout] 68 | .map(|a| fitness_function(a)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&fitness_function` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::ops::Range` [INFO] [stdout] --> examples/knp.rs:97:26 [INFO] [stdout] | [INFO] [stdout] 97 | let mut population = (0..population_size) [INFO] [stdout] | __________________________^ [INFO] [stdout] 98 | | .into_iter() [INFO] [stdout] | |____________________^ help: consider removing `.into_iter()`: `(0..population_size)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> examples/knp.rs:120:18 [INFO] [stdout] | [INFO] [stdout] 120 | .map(|x| fitness_function(x)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `&fitness_function` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.05s [INFO] running `Command { std: "docker" "inspect" "ca9c94b7deb7847318bfeb89ae36ce9333a530316114eca094f0820f17ebebb2", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "ca9c94b7deb7847318bfeb89ae36ce9333a530316114eca094f0820f17ebebb2", kill_on_drop: false }` [INFO] [stdout] ca9c94b7deb7847318bfeb89ae36ce9333a530316114eca094f0820f17ebebb2