[INFO] cloning repository https://github.com/IndTechSpprt/Split_inference_microcontrollers_fork [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/IndTechSpprt/Split_inference_microcontrollers_fork" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FIndTechSpprt%2FSplit_inference_microcontrollers_fork", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FIndTechSpprt%2FSplit_inference_microcontrollers_fork'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] a87238bd1904183142a967fd89763e8d8b6ea276 [INFO] linting IndTechSpprt/Split_inference_microcontrollers_fork against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FIndTechSpprt%2FSplit_inference_microcontrollers_fork" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] [stderr] Updating files: 84% (82/97) Updating files: 85% (83/97) Updating files: 86% (84/97) Updating files: 87% (85/97) Updating files: 88% (86/97) Updating files: 89% (87/97) Updating files: 90% (88/97) Updating files: 91% (89/97) Updating files: 92% (90/97) Updating files: 93% (91/97) Updating files: 94% (92/97) Updating files: 95% (93/97) Updating files: 96% (94/97) Updating files: 97% (95/97) Updating files: 98% (96/97) Updating files: 100% (97/97) Updating files: 100% (97/97), done. [INFO] started tweaking git repo https://github.com/IndTechSpprt/Split_inference_microcontrollers_fork [INFO] finished tweaking git repo https://github.com/IndTechSpprt/Split_inference_microcontrollers_fork [INFO] tweaked toml for git repo https://github.com/IndTechSpprt/Split_inference_microcontrollers_fork written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/IndTechSpprt/Split_inference_microcontrollers_fork 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/IndTechSpprt/Split_inference_microcontrollers_fork already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"` [INFO] [stderr] | [INFO] [stderr] = note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest [INFO] [stderr] = note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest [INFO] [stderr] = note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 76750d73ca393fc00dd4ca4f8ee98664482c7293632ddc1f20ffd73a17ffa514 [INFO] running `Command { std: "docker" "start" "-a" "76750d73ca393fc00dd4ca4f8ee98664482c7293632ddc1f20ffd73a17ffa514", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "76750d73ca393fc00dd4ca4f8ee98664482c7293632ddc1f20ffd73a17ffa514", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "76750d73ca393fc00dd4ca4f8ee98664482c7293632ddc1f20ffd73a17ffa514", kill_on_drop: false }` [INFO] [stdout] 76750d73ca393fc00dd4ca4f8ee98664482c7293632ddc1f20ffd73a17ffa514 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] c05d24300f88acb71df366fabdf552b77b3895524a1ccd0d9cbe4fc07e08cc9c [INFO] running `Command { std: "docker" "start" "-a" "c05d24300f88acb71df366fabdf552b77b3895524a1ccd0d9cbe4fc07e08cc9c", kill_on_drop: false }` [INFO] [stderr] warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"` [INFO] [stderr] | [INFO] [stderr] = note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest [INFO] [stderr] = note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest [INFO] [stderr] = note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions [INFO] [stderr] Compiling crossbeam-utils v0.8.20 [INFO] [stderr] Checking either v1.13.0 [INFO] [stderr] Checking weezl v0.1.8 [INFO] [stderr] Compiling serde v1.0.209 [INFO] [stderr] Checking smallvec v1.13.2 [INFO] [stderr] Compiling rayon-core v1.12.1 [INFO] [stderr] Compiling lock_api v0.4.12 [INFO] [stderr] Checking miniz_oxide v0.8.0 [INFO] [stderr] Checking miniz_oxide v0.7.4 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Checking half v2.4.1 [INFO] [stderr] Checking zune-inflate v0.2.54 [INFO] [stderr] Checking bytemuck v1.17.1 [INFO] [stderr] Checking bit_field v0.10.2 [INFO] [stderr] Checking lebe v0.5.2 [INFO] [stderr] Compiling syn v2.0.77 [INFO] [stderr] Compiling serde_json v1.0.127 [INFO] [stderr] Checking memchr v2.7.4 [INFO] [stderr] Checking iana-time-zone v0.1.60 [INFO] [stderr] Checking qoi v0.4.1 [INFO] [stderr] Checking spin v0.9.8 [INFO] [stderr] Checking flate2 v1.0.33 [INFO] [stderr] Checking crossbeam-epoch v0.9.18 [INFO] [stderr] Checking gif v0.13.1 [INFO] [stderr] Checking flume v0.11.0 [INFO] [stderr] Checking crossbeam-deque v0.8.5 [INFO] [stderr] Checking chrono v0.4.38 [INFO] [stderr] Checking png v0.17.13 [INFO] [stderr] Checking rayon v1.10.0 [INFO] [stderr] Checking exr v1.72.0 [INFO] [stderr] Compiling serde_derive v1.0.209 [INFO] [stderr] Checking jpeg-decoder v0.3.1 [INFO] [stderr] Checking tiff v0.9.1 [INFO] [stderr] Checking image v0.24.9 [INFO] [stderr] Checking algo v0.1.0 (/opt/rustwide/workdir/pc_code/Algorithms) [INFO] [stdout] warning: unused imports: `Deserialize` and `Serialize` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:2:13 [INFO] [stdout] | [INFO] [stdout] 2 | use serde::{Deserialize, Serialize}; [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 imports: `Deserialize` and `Serialize` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:2:13 [INFO] [stdout] | [INFO] [stdout] 2 | use serde::{Deserialize, Serialize}; [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 imports: `DynamicImage`, `GenericImageView`, and `Rgba` [INFO] [stdout] --> pc_code/Algorithms/src/lib/util.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | use image::{DynamicImage, GenericImageView, Rgba}; [INFO] [stdout] | ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `DynamicImage`, `GenericImageView`, and `Rgba` [INFO] [stdout] --> pc_code/Algorithms/src/lib/util.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | use image::{DynamicImage, GenericImageView, Rgba}; [INFO] [stdout] | ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `num_per_cpu` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:36:17 [INFO] [stdout] | [INFO] [stdout] 36 | let num_per_cpu: i32 = (output_count as f32 / total_cpu_count as f32).ceil() as i32; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_num_per_cpu` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `num_per_cpu` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:36:17 [INFO] [stdout] | [INFO] [stdout] 36 | let num_per_cpu: i32 = (output_count as f32 / total_cpu_count as f32).ceil() as i32; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_num_per_cpu` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `col_per_cpu` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:72:17 [INFO] [stdout] | [INFO] [stdout] 72 | let col_per_cpu = (weight_shape[1] as f32 / total_cpu_count as f32).ceil() as i32; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_col_per_cpu` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `new_kernel_flag` is never read [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:24:31 [INFO] [stdout] | [INFO] [stdout] 24 | let mut new_kernel_flag = false; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `col_per_cpu` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:72:17 [INFO] [stdout] | [INFO] [stdout] 72 | let col_per_cpu = (weight_shape[1] as f32 / total_cpu_count as f32).ceil() as i32; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_col_per_cpu` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `new_kernel_flag` is never read [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:24:31 [INFO] [stdout] | [INFO] [stdout] 24 | let mut new_kernel_flag = false; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `num_per_cpu` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:110:9 [INFO] [stdout] | [INFO] [stdout] 110 | let num_per_cpu: i32 = (output_count as f32 / total_cpu_count as f32).ceil() as i32; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_num_per_cpu` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `kernel_size` is never read [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:114:47 [INFO] [stdout] | [INFO] [stdout] 114 | let mut kernel_size: (u16, u16) = (0, 0); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `num_per_cpu` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:110:9 [INFO] [stdout] | [INFO] [stdout] 110 | let num_per_cpu: i32 = (output_count as f32 / total_cpu_count as f32).ceil() as i32; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_num_per_cpu` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `kernel_size` is never read [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:114:47 [INFO] [stdout] | [INFO] [stdout] 114 | let mut kernel_size: (u16, u16) = (0, 0); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `in_side_rows` is never read [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:222:36 [INFO] [stdout] | [INFO] [stdout] 222 | let mut in_side_rows = 0; [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `in_side_rows` is never read [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:297:21 [INFO] [stdout] | [INFO] [stdout] 297 | in_side_rows = convMapping.k.1 - out_side_rows; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `in_side_rows` is never read [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:222:36 [INFO] [stdout] | [INFO] [stdout] 222 | let mut in_side_rows = 0; [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `in_side_rows` is never read [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:297:21 [INFO] [stdout] | [INFO] [stdout] 297 | in_side_rows = convMapping.k.1 - out_side_rows; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `in_side_rows` is never read [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:490:36 [INFO] [stdout] | [INFO] [stdout] 490 | let mut in_side_rows = 0; [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `in_side_rows` is never read [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:490:36 [INFO] [stdout] | [INFO] [stdout] 490 | let mut in_side_rows = 0; [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `in_side_rows` is never read [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:566:21 [INFO] [stdout] | [INFO] [stdout] 566 | in_side_rows = convMapping.k.1 - out_side_rows; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `in_side_rows` is never read [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:566:21 [INFO] [stdout] | [INFO] [stdout] 566 | in_side_rows = convMapping.k.1 - out_side_rows; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `num_per_mcu` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:760:9 [INFO] [stdout] | [INFO] [stdout] 760 | let num_per_mcu = (core_number as f32 / num_cpus_previous as f32).ceil() as u32; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_num_per_mcu` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `num_per_mcu` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:760:9 [INFO] [stdout] | [INFO] [stdout] 760 | let num_per_mcu = (core_number as f32 / num_cpus_previous as f32).ceil() as u32; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_num_per_mcu` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> pc_code/Algorithms/src/lib/calculations.rs:7:19 [INFO] [stdout] | [INFO] [stdout] 7 | result += &inputs[i] * &weights[i]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 7 - result += &inputs[i] * &weights[i]; [INFO] [stdout] 7 + result += inputs[i] * weights[i]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> pc_code/Algorithms/src/lib/calculations.rs:11:36 [INFO] [stdout] | [INFO] [stdout] 11 | pub fn batchnorm(input: f32, data: &Vec, channel: u8) -> f32 { [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] 11 - pub fn batchnorm(input: f32, data: &Vec, channel: u8) -> f32 { [INFO] [stdout] 11 + pub fn batchnorm(input: f32, data: &[f32], channel: u8) -> f32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> pc_code/Algorithms/src/lib/calculations.rs:7:19 [INFO] [stdout] | [INFO] [stdout] 7 | result += &inputs[i] * &weights[i]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 7 - result += &inputs[i] * &weights[i]; [INFO] [stdout] 7 + result += inputs[i] * weights[i]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> pc_code/Algorithms/src/lib/calculations.rs:11:36 [INFO] [stdout] | [INFO] [stdout] 11 | pub fn batchnorm(input: f32, data: &Vec, channel: u8) -> f32 { [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] 11 - pub fn batchnorm(input: f32, data: &Vec, channel: u8) -> f32 { [INFO] [stdout] 11 + pub fn batchnorm(input: f32, data: &[f32], channel: u8) -> f32 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:18:33 [INFO] [stdout] | [INFO] [stdout] 18 | pub fn distribute_weight(layer: &Box, total_cpu_count: u8,portions:Vec) -> Vec> { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `&dyn Layer` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] = note: `#[warn(clippy::borrowed_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:18:33 [INFO] [stdout] | [INFO] [stdout] 18 | pub fn distribute_weight(layer: &Box, total_cpu_count: u8,portions:Vec) -> Vec> { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `&dyn Layer` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] = note: `#[warn(clippy::borrowed_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:103:12 [INFO] [stdout] | [INFO] [stdout] 103 | layer: &Box, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `&dyn Layer` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:103:12 [INFO] [stdout] | [INFO] [stdout] 103 | layer: &Box, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `&dyn Layer` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `p` is only used to index `pos` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:133:34 [INFO] [stdout] | [INFO] [stdout] 133 | for p in 0..pos.len() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 133 - for p in 0..pos.len() { [INFO] [stdout] 133 + for in &pos { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `p` is only used to index `pos` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:133:34 [INFO] [stdout] | [INFO] [stdout] 133 | for p in 0..pos.len() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 133 - for p in 0..pos.len() { [INFO] [stdout] 133 + for in &pos { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `m` is only used to index `mapping` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:172:22 [INFO] [stdout] | [INFO] [stdout] 172 | for m in 0..mapping[0][0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 172 - for m in 0..mapping[0][0].len() { [INFO] [stdout] 172 + for in mapping.iter().take(mapping[0][0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `m` is only used to index `mapping` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:172:22 [INFO] [stdout] | [INFO] [stdout] 172 | for m in 0..mapping[0][0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 172 - for m in 0..mapping[0][0].len() { [INFO] [stdout] 172 + for in mapping.iter().take(mapping[0][0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `weight_distribution` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:230:22 [INFO] [stdout] | [INFO] [stdout] 230 | for i in 0..weight_distribution.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 230 - for i in 0..weight_distribution.len() { [INFO] [stdout] 230 + for in &weight_distribution { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `weight_distribution` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:230:22 [INFO] [stdout] | [INFO] [stdout] 230 | for i in 0..weight_distribution.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 230 - for i in 0..weight_distribution.len() { [INFO] [stdout] 230 + for in &weight_distribution { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:414:40 [INFO] [stdout] | [INFO] [stdout] 414 | ... acc += &input_distribution[index] [INFO] [stdout] | ______________________________^ [INFO] [stdout] 415 | | ... * &weight_distribution[i].data[(c [INFO] [stdout] 416 | | ... * convMapping.k.0 [INFO] [stdout] 417 | | ... * convMapping.k.1 [INFO] [stdout] 418 | | ... + j * convMapping.k.1 [INFO] [stdout] 419 | | ... + k) [INFO] [stdout] 420 | | ... as usize]; [INFO] [stdout] | |_______________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 414 ~ acc += input_distribution[index] [INFO] [stdout] 415 ~ * weight_distribution[i].data[(c [INFO] [stdout] 416 + * convMapping.k.0 [INFO] [stdout] 417 + * convMapping.k.1 [INFO] [stdout] 418 + + j * convMapping.k.1 [INFO] [stdout] 419 + + k) [INFO] [stdout] 420 ~ as usize]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:414:40 [INFO] [stdout] | [INFO] [stdout] 414 | ... acc += &input_distribution[index] [INFO] [stdout] | ______________________________^ [INFO] [stdout] 415 | | ... * &weight_distribution[i].data[(c [INFO] [stdout] 416 | | ... * convMapping.k.0 [INFO] [stdout] 417 | | ... * convMapping.k.1 [INFO] [stdout] 418 | | ... + j * convMapping.k.1 [INFO] [stdout] 419 | | ... + k) [INFO] [stdout] 420 | | ... as usize]; [INFO] [stdout] | |_______________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 414 ~ acc += input_distribution[index] [INFO] [stdout] 415 ~ * weight_distribution[i].data[(c [INFO] [stdout] 416 + * convMapping.k.0 [INFO] [stdout] 417 + * convMapping.k.1 [INFO] [stdout] 418 + + j * convMapping.k.1 [INFO] [stdout] 419 + + k) [INFO] [stdout] 420 ~ as usize]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u16` which implements the `Copy` trait [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:484:31 [INFO] [stdout] | [INFO] [stdout] 484 | ..._group = weight_distribution.iter().min_by(|x,y| x.which_kernel.cmp(&y.which_kernel)).unwrap().which_kernel.clone() / convMappin... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `weight_distribution.iter().min_by(|x,y| x.which_kernel.cmp(&y.which_kernel)).unwrap().which_kernel` [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: the loop variable `i` is only used to index `weight_distribution` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:498:22 [INFO] [stdout] | [INFO] [stdout] 498 | for i in 0..weight_distribution.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 498 - for i in 0..weight_distribution.len() { [INFO] [stdout] 498 + for in &weight_distribution { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u16` which implements the `Copy` trait [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:484:31 [INFO] [stdout] | [INFO] [stdout] 484 | ..._group = weight_distribution.iter().min_by(|x,y| x.which_kernel.cmp(&y.which_kernel)).unwrap().which_kernel.clone() / convMappin... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `weight_distribution.iter().min_by(|x,y| x.which_kernel.cmp(&y.which_kernel)).unwrap().which_kernel` [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: the loop variable `i` is only used to index `weight_distribution` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:498:22 [INFO] [stdout] | [INFO] [stdout] 498 | for i in 0..weight_distribution.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 498 - for i in 0..weight_distribution.len() { [INFO] [stdout] 498 + for in &weight_distribution { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `raw_mapping` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:776:14 [INFO] [stdout] | [INFO] [stdout] 776 | for i in 0..channels { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 776 - for i in 0..channels { [INFO] [stdout] 776 + for (i, ) in raw_mapping.iter().enumerate().take(channels) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `raw_mapping` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:776:14 [INFO] [stdout] | [INFO] [stdout] 776 | for i in 0..channels { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 776 - for i in 0..channels { [INFO] [stdout] 776 + for (i, ) in raw_mapping.iter().enumerate().take(channels) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `raw_mapping` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:777:18 [INFO] [stdout] | [INFO] [stdout] 777 | for j in 0..cols { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 777 - for j in 0..cols { [INFO] [stdout] 777 + for (j, ) in raw_mapping.iter().enumerate().take(cols) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `raw_mapping` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:777:18 [INFO] [stdout] | [INFO] [stdout] 777 | for j in 0..cols { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 777 - for j in 0..cols { [INFO] [stdout] 777 + for (j, ) in raw_mapping.iter().enumerate().take(cols) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is used to index `raw_mapping` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:778:22 [INFO] [stdout] | [INFO] [stdout] 778 | for k in 0..rows { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 778 - for k in 0..rows { [INFO] [stdout] 778 + for (k, ) in raw_mapping.iter().enumerate().take(rows) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is used to index `raw_mapping` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:778:22 [INFO] [stdout] | [INFO] [stdout] 778 | for k in 0..rows { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 778 - for k in 0..rows { [INFO] [stdout] 778 + for (k, ) in raw_mapping.iter().enumerate().take(rows) { [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] --> pc_code/Algorithms/src/lib/operations.rs:832:33 [INFO] [stdout] | [INFO] [stdout] 832 | pub fn rearrange_weight(weight: &mut Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 832 - pub fn rearrange_weight(weight: &mut Vec) { [INFO] [stdout] 832 + pub fn rearrange_weight(weight: &mut [WeightUnit]) { [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] --> pc_code/Algorithms/src/lib/operations.rs:832:33 [INFO] [stdout] | [INFO] [stdout] 832 | pub fn rearrange_weight(weight: &mut Vec) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 832 - pub fn rearrange_weight(weight: &mut Vec) { [INFO] [stdout] 832 + pub fn rearrange_weight(weight: &mut [WeightUnit]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:889:30 [INFO] [stdout] | [INFO] [stdout] 889 | pub fn mark_end(raw_mapping: &Vec>>, num_mcu_next: u8) -> Vec<(u8, 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] 889 - pub fn mark_end(raw_mapping: &Vec>>, num_mcu_next: u8) -> Vec<(u8, Vec)> { [INFO] [stdout] 889 + pub fn mark_end(raw_mapping: &[Vec>], num_mcu_next: u8) -> Vec<(u8, Vec)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:889:30 [INFO] [stdout] | [INFO] [stdout] 889 | pub fn mark_end(raw_mapping: &Vec>>, num_mcu_next: u8) -> Vec<(u8, 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] 889 - pub fn mark_end(raw_mapping: &Vec>>, num_mcu_next: u8) -> Vec<(u8, Vec)> { [INFO] [stdout] 889 + pub fn mark_end(raw_mapping: &[Vec>], num_mcu_next: u8) -> Vec<(u8, Vec)> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `m` is used to index `raw_mapping` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:895:26 [INFO] [stdout] | [INFO] [stdout] 895 | for m in 0..raw_mapping[0][0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 895 - for m in 0..raw_mapping[0][0].len() { [INFO] [stdout] 895 + for (m, ) in raw_mapping.iter().enumerate().take(raw_mapping[0][0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of left operand [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:896:24 [INFO] [stdout] | [INFO] [stdout] 896 | if &raw_mapping[j][k][m] >> i & 0b1 == 0b1 { [INFO] [stdout] | ---------------------^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: use the left value directly: `raw_mapping[j][k][m]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> pc_code/Algorithms/src/lib/util.rs:1:66 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn sample_input_from_p_zero_padding(p: Vec>, input: &Vec>>) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 1 - pub fn sample_input_from_p_zero_padding(p: Vec>, input: &Vec>>) -> Vec { [INFO] [stdout] 1 + pub fn sample_input_from_p_zero_padding(p: Vec>, input: &[Vec>]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `p` [INFO] [stdout] --> pc_code/Algorithms/src/lib/util.rs:3:14 [INFO] [stdout] | [INFO] [stdout] 3 | for i in 0..p.len() { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 3 - for i in 0..p.len() { [INFO] [stdout] 3 + for in &p { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `m` is used to index `raw_mapping` [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:895:26 [INFO] [stdout] | [INFO] [stdout] 895 | for m in 0..raw_mapping[0][0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 895 - for m in 0..raw_mapping[0][0].len() { [INFO] [stdout] 895 + for (m, ) in raw_mapping.iter().enumerate().take(raw_mapping[0][0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of left operand [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:896:24 [INFO] [stdout] | [INFO] [stdout] 896 | if &raw_mapping[j][k][m] >> i & 0b1 == 0b1 { [INFO] [stdout] | ---------------------^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: use the left value directly: `raw_mapping[j][k][m]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> pc_code/Algorithms/src/lib/util.rs:1:66 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn sample_input_from_p_zero_padding(p: Vec>, input: &Vec>>) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 1 - pub fn sample_input_from_p_zero_padding(p: Vec>, input: &Vec>>) -> Vec { [INFO] [stdout] 1 + pub fn sample_input_from_p_zero_padding(p: Vec>, input: &[Vec>]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `p` [INFO] [stdout] --> pc_code/Algorithms/src/lib/util.rs:3:14 [INFO] [stdout] | [INFO] [stdout] 3 | for i in 0..p.len() { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 3 - for i in 0..p.len() { [INFO] [stdout] 3 + for in &p { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> pc_code/Algorithms/src/lib/util.rs:19:53 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn sample_input_linear(p: Vec>, input: &Vec>) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 19 - pub fn sample_input_linear(p: Vec>, input: &Vec>) -> Vec { [INFO] [stdout] 19 + pub fn sample_input_linear(p: Vec>, input: &[Vec]) -> 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] --> pc_code/Algorithms/src/lib/util.rs:19:53 [INFO] [stdout] | [INFO] [stdout] 19 | pub fn sample_input_linear(p: Vec>, input: &Vec>) -> Vec { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 19 - pub fn sample_input_linear(p: Vec>, input: &Vec>) -> Vec { [INFO] [stdout] 19 + pub fn sample_input_linear(p: Vec>, input: &[Vec]) -> Vec { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `p` [INFO] [stdout] --> pc_code/Algorithms/src/lib/util.rs:21:14 [INFO] [stdout] | [INFO] [stdout] 21 | for i in 0..p.len() { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 21 - for i in 0..p.len() { [INFO] [stdout] 21 + for in &p { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `p` [INFO] [stdout] --> pc_code/Algorithms/src/lib/util.rs:21:14 [INFO] [stdout] | [INFO] [stdout] 21 | for i in 0..p.len() { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 21 - for i in 0..p.len() { [INFO] [stdout] 21 + for in &p { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `result` [INFO] [stdout] --> pc_code/Algorithms/src/lib/util.rs:31:14 [INFO] [stdout] | [INFO] [stdout] 31 | for i in 0..16 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 31 - for i in 0..16 { [INFO] [stdout] 31 + for (i, ) in result.iter_mut().enumerate().take(16) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `result` [INFO] [stdout] --> pc_code/Algorithms/src/lib/util.rs:31:14 [INFO] [stdout] | [INFO] [stdout] 31 | for i in 0..16 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 31 - for i in 0..16 { [INFO] [stdout] 31 + for (i, ) in result.iter_mut().enumerate().take(16) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:143:24 [INFO] [stdout] | [INFO] [stdout] 143 | let h_offset = &o_position[1] * &self.s.0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 143 - let h_offset = &o_position[1] * &self.s.0; [INFO] [stdout] 143 + let h_offset = o_position[1] * self.s.0; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:143:24 [INFO] [stdout] | [INFO] [stdout] 143 | let h_offset = &o_position[1] * &self.s.0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 143 - let h_offset = &o_position[1] * &self.s.0; [INFO] [stdout] 143 + let h_offset = o_position[1] * self.s.0; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:144:24 [INFO] [stdout] | [INFO] [stdout] 144 | let w_offset = &o_position[2] * &self.s.1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 144 - let w_offset = &o_position[2] * &self.s.1; [INFO] [stdout] 144 + let w_offset = o_position[2] * self.s.1; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:144:24 [INFO] [stdout] | [INFO] [stdout] 144 | let w_offset = &o_position[2] * &self.s.1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 144 - let w_offset = &o_position[2] * &self.s.1; [INFO] [stdout] 144 + let w_offset = o_position[2] * self.s.1; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:145:27 [INFO] [stdout] | [INFO] [stdout] 145 | let which_group = (&o_position[0] / &self.o_pg) * &self.i_pg; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `self.i_pg` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:145:27 [INFO] [stdout] | [INFO] [stdout] 145 | let which_group = (&o_position[0] / &self.o_pg) * &self.i_pg; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `self.i_pg` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:145:27 [INFO] [stdout] | [INFO] [stdout] 145 | let which_group = (&o_position[0] / &self.o_pg) * &self.i_pg; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 145 - let which_group = (&o_position[0] / &self.o_pg) * &self.i_pg; [INFO] [stdout] 145 + let which_group = (o_position[0] / self.o_pg) * &self.i_pg; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:145:27 [INFO] [stdout] | [INFO] [stdout] 145 | let which_group = (&o_position[0] / &self.o_pg) * &self.i_pg; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 145 - let which_group = (&o_position[0] / &self.o_pg) * &self.i_pg; [INFO] [stdout] 145 + let which_group = (o_position[0] / self.o_pg) * &self.i_pg; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:150:38 [INFO] [stdout] | [INFO] [stdout] 150 | result.push(vec![&which_group + &q, &h_offset + &h, &w_offset + w]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 150 - result.push(vec![&which_group + &q, &h_offset + &h, &w_offset + w]); [INFO] [stdout] 150 + result.push(vec![which_group + q, &h_offset + &h, &w_offset + w]); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:150:38 [INFO] [stdout] | [INFO] [stdout] 150 | result.push(vec![&which_group + &q, &h_offset + &h, &w_offset + w]); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 150 - result.push(vec![&which_group + &q, &h_offset + &h, &w_offset + w]); [INFO] [stdout] 150 + result.push(vec![which_group + q, &h_offset + &h, &w_offset + w]); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:150:57 [INFO] [stdout] | [INFO] [stdout] 150 | result.push(vec![&which_group + &q, &h_offset + &h, &w_offset + w]); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 150 - result.push(vec![&which_group + &q, &h_offset + &h, &w_offset + w]); [INFO] [stdout] 150 + result.push(vec![&which_group + &q, h_offset + h, &w_offset + w]); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:150:57 [INFO] [stdout] | [INFO] [stdout] 150 | result.push(vec![&which_group + &q, &h_offset + &h, &w_offset + w]); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 150 - result.push(vec![&which_group + &q, &h_offset + &h, &w_offset + w]); [INFO] [stdout] 150 + result.push(vec![&which_group + &q, h_offset + h, &w_offset + w]); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of left operand [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:150:73 [INFO] [stdout] | [INFO] [stdout] 150 | result.push(vec![&which_group + &q, &h_offset + &h, &w_offset + w]); [INFO] [stdout] | ---------^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: use the left value directly: `w_offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of left operand [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:150:73 [INFO] [stdout] | [INFO] [stdout] 150 | result.push(vec![&which_group + &q, &h_offset + &h, &w_offset + w]); [INFO] [stdout] | ---------^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: use the left value directly: `w_offset` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:190:9 [INFO] [stdout] | [INFO] [stdout] 190 | / let mut reuslt = Vec::new(); [INFO] [stdout] 191 | | reuslt.push(self.info.o.0); [INFO] [stdout] 192 | | reuslt.push(self.info.o.1); [INFO] [stdout] 193 | | reuslt.push(self.info.o.2); [INFO] [stdout] | |___________________________________^ help: consider using the `vec![]` macro: `let reuslt = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:190:9 [INFO] [stdout] | [INFO] [stdout] 190 | / let mut reuslt = Vec::new(); [INFO] [stdout] 191 | | reuslt.push(self.info.o.0); [INFO] [stdout] 192 | | reuslt.push(self.info.o.1); [INFO] [stdout] 193 | | reuslt.push(self.info.o.2); [INFO] [stdout] | |___________________________________^ help: consider using the `vec![]` macro: `let reuslt = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:243:18 [INFO] [stdout] | [INFO] [stdout] 243 | for i in 0..input.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 243 - for i in 0..input.len() { [INFO] [stdout] 243 + for (i, ) in input.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:301:9 [INFO] [stdout] | [INFO] [stdout] 301 | / let mut reuslt = Vec::new(); [INFO] [stdout] 302 | | reuslt.push(self.info.b_out); [INFO] [stdout] 303 | | reuslt.push(self.info.c_out); [INFO] [stdout] | |_____________________________________^ help: consider using the `vec![]` macro: `let reuslt = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:243:18 [INFO] [stdout] | [INFO] [stdout] 243 | for i in 0..input.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 243 - for i in 0..input.len() { [INFO] [stdout] 243 + for (i, ) in input.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:301:9 [INFO] [stdout] | [INFO] [stdout] 301 | / let mut reuslt = Vec::new(); [INFO] [stdout] 302 | | reuslt.push(self.info.b_out); [INFO] [stdout] 303 | | reuslt.push(self.info.c_out); [INFO] [stdout] | |_____________________________________^ help: consider using the `vec![]` macro: `let reuslt = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:333:18 [INFO] [stdout] | [INFO] [stdout] 333 | for i in 0..input.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 333 - for i in 0..input.len() { [INFO] [stdout] 333 + for in &input { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:333:18 [INFO] [stdout] | [INFO] [stdout] 333 | for i in 0..input.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 333 - for i in 0..input.len() { [INFO] [stdout] 333 + for in &input { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:410:18 [INFO] [stdout] | [INFO] [stdout] 410 | for i in 0..c { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 410 - for i in 0..c { [INFO] [stdout] 410 + for (i, ) in input.iter_mut().enumerate().take(c) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:410:18 [INFO] [stdout] | [INFO] [stdout] 410 | for i in 0..c { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 410 - for i in 0..c { [INFO] [stdout] 410 + for (i, ) in input.iter_mut().enumerate().take(c) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:412:22 [INFO] [stdout] | [INFO] [stdout] 412 | for j in 0..h { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 412 - for j in 0..h { [INFO] [stdout] 412 + for in input.iter_mut().take(h) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:412:22 [INFO] [stdout] | [INFO] [stdout] 412 | for j in 0..h { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 412 - for j in 0..h { [INFO] [stdout] 412 + for in input.iter_mut().take(h) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is only used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:413:26 [INFO] [stdout] | [INFO] [stdout] 413 | for k in 0..w { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 413 - for k in 0..w { [INFO] [stdout] 413 + for in input.iter_mut().take(w) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is only used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:413:26 [INFO] [stdout] | [INFO] [stdout] 413 | for k in 0..w { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 413 - for k in 0..w { [INFO] [stdout] 413 + for in input.iter_mut().take(w) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:482:21 [INFO] [stdout] | [INFO] [stdout] 482 | / if input[i][j][k] < 0.0 { [INFO] [stdout] 483 | | input[i][j][k] = 0.; [INFO] [stdout] 484 | | } else if input[i][j][k] >= 6.0 { [INFO] [stdout] 485 | | input[i][j][k] = 6.0; [INFO] [stdout] 486 | | } [INFO] [stdout] | |_____________________^ help: replace with clamp: `input[i][j][k] = input[i][j][k].clamp(0., 6.0);` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> pc_code/Algorithms/src/lib/lib.rs:482:21 [INFO] [stdout] | [INFO] [stdout] 482 | / if input[i][j][k] < 0.0 { [INFO] [stdout] 483 | | input[i][j][k] = 0.; [INFO] [stdout] 484 | | } else if input[i][j][k] >= 6.0 { [INFO] [stdout] 485 | | input[i][j][k] = 6.0; [INFO] [stdout] 486 | | } [INFO] [stdout] | |_____________________^ help: replace with clamp: `input[i][j][k] = input[i][j][k].clamp(0., 6.0);` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `convMapping` should have a snake case name [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:216:34 [INFO] [stdout] | [INFO] [stdout] 216 | InfoWrapper::Convolution(convMapping) => { [INFO] [stdout] | ^^^^^^^^^^^ help: convert the identifier to snake case: `conv_mapping` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `convMapping` should have a snake case name [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:483:34 [INFO] [stdout] | [INFO] [stdout] 483 | InfoWrapper::Convolution(convMapping) => { [INFO] [stdout] | ^^^^^^^^^^^ help: convert the identifier to snake case: `conv_mapping` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `convMapping` should have a snake case name [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:216:34 [INFO] [stdout] | [INFO] [stdout] 216 | InfoWrapper::Convolution(convMapping) => { [INFO] [stdout] | ^^^^^^^^^^^ help: convert the identifier to snake case: `conv_mapping` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `convMapping` should have a snake case name [INFO] [stdout] --> pc_code/Algorithms/src/lib/operations.rs:483:34 [INFO] [stdout] | [INFO] [stdout] 483 | InfoWrapper::Convolution(convMapping) => { [INFO] [stdout] | ^^^^^^^^^^^ help: convert the identifier to snake case: `conv_mapping` [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking quant v0.1.0 (/opt/rustwide/workdir/pc_code/Quantization) [INFO] [stdout] warning: unused import: `algo::LayerWrapper::Linear` [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | use algo::LayerWrapper::Linear; [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: `InfoWrapper` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:26:48 [INFO] [stdout] | [INFO] [stdout] 26 | use algo::{calculations, operations, util, InfoWrapper}; [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 imports: `ConvMapping` and `LinearMapping` [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:3:18 [INFO] [stdout] | [INFO] [stdout] 3 | use algo::{Conv, ConvMapping, InfoWrapper, Layer, LayerWrapper, LinearMapping, Relu6}; [INFO] [stdout] | ^^^^^^^^^^^ ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::task::ready` [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | use std::task::ready; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around assigned value [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:57:52 [INFO] [stdout] | [INFO] [stdout] 57 | weights_fused[dim][y][x] = (w_bn * conv_weights[i * kernel_size + j]); [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] 57 - weights_fused[dim][y][x] = (w_bn * conv_weights[i * kernel_size + j]); [INFO] [stdout] 57 + weights_fused[dim][y][x] = w_bn * conv_weights[i * kernel_size + j] ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around assigned value [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:115:38 [INFO] [stdout] | [INFO] [stdout] 115 | linear.w[i][j] = (weights[i * shape[0] as usize + j]); [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 115 - linear.w[i][j] = (weights[i * shape[0] as usize + j]); [INFO] [stdout] 115 + linear.w[i][j] = weights[i * shape[0] as usize + j] ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around assigned value [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:117:34 [INFO] [stdout] | [INFO] [stdout] 117 | linear.bias[i] = (layer.get_bias(i as i32)); [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 117 - linear.bias[i] = (layer.get_bias(i as i32)); [INFO] [stdout] 117 + linear.bias[i] = layer.get_bias(i as i32) ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `LayerWrapper` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:3:45 [INFO] [stdout] | [INFO] [stdout] 3 | calculations, util, InfoWrapper, Layer, LayerWrapper, Mapping, QuantizedMapping, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `max` and `min` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:6:16 [INFO] [stdout] | [INFO] [stdout] 6 | use std::cmp::{max, min}; [INFO] [stdout] | ^^^ ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::fs::File` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | use std::fs::File; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `BufRead` and `BufReader` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:10:15 [INFO] [stdout] | [INFO] [stdout] 10 | use std::io::{BufRead, BufReader}; [INFO] [stdout] | ^^^^^^^ ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:528:21 [INFO] [stdout] | [INFO] [stdout] 528 | m: m, [INFO] [stdout] | ^^^^ help: replace it with: `m` [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: unnecessary parentheses around `if` condition [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:608:27 [INFO] [stdout] | [INFO] [stdout] 608 | if(i == 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] 608 - if(i == 0){ [INFO] [stdout] 608 + if i == 0 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::slice::SliceIndex` [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | use std::slice::SliceIndex; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | let mut layers_len = layers.len(); [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: variable does not need to be mutable [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:33:21 [INFO] [stdout] | [INFO] [stdout] 33 | let mut conv_weights = layer.get_weights(); [INFO] [stdout] | ----^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `layers_len` [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | let mut layers_len = layers.len(); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_layers_len` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | let mut weights_quantized = layer [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] --> pc_code/Quantization/src/lib/quant.rs:71:9 [INFO] [stdout] | [INFO] [stdout] 71 | let mut m_scale: Vec = vec![0; 100]; [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] --> pc_code/Quantization/src/lib/quant.rs:152:41 [INFO] [stdout] | [INFO] [stdout] 152 | ... let mut bias = layer.get_bias(j as i32); [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `test_result` is assigned to, but never used [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:76:9 [INFO] [stdout] | [INFO] [stdout] 76 | let mut test_result = Vec::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_test_result` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `test_result` is never read [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:134:29 [INFO] [stdout] | [INFO] [stdout] 134 | ... test_result = input; [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: value assigned to `flag` is never read [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:148:48 [INFO] [stdout] | [INFO] [stdout] 148 | ... let mut flag = true; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:488:9 [INFO] [stdout] | [INFO] [stdout] 488 | let mut s1 = scales[layer_id]; [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] --> pc_code/Quantization/src/lib/quant.rs:500:9 [INFO] [stdout] | [INFO] [stdout] 500 | let mut zero1 = zero_points[layer_id].round() as u8; [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `m` is never read [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:487:17 [INFO] [stdout] | [INFO] [stdout] 487 | let mut m = 0.; [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:17:39 [INFO] [stdout] | [INFO] [stdout] 17 | let Some(layer) = layers.get(&(a as i32)) else { [INFO] [stdout] | ^^^^^^^^^^ help: try: `{ a }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:21:43 [INFO] [stdout] | [INFO] [stdout] 21 | let next_layer = layers.get(&(a as i32 + 1)).unwrap(); [INFO] [stdout] | ^^^^^^^^ help: try: `a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:25:24 [INFO] [stdout] | [INFO] [stdout] 25 | let i_pg = info.i_pg.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `info.i_pg` [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, i32)` which implements the `Copy` trait [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:26:32 [INFO] [stdout] | [INFO] [stdout] 26 | let kernel_shape = info.k.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `info.k` [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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:62:41 [INFO] [stdout] | [INFO] [stdout] 62 | modified_mapping.insert(prev_nr as i32, LayerWrapper::Convolution(fused_conv)); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `prev_nr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:92:41 [INFO] [stdout] | [INFO] [stdout] 92 | modified_mapping.insert(prev_nr as i32, LayerWrapper::Convolution(conv)); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `prev_nr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:99:37 [INFO] [stdout] | [INFO] [stdout] 99 | modified_mapping.insert(prev_nr as i32, LayerWrapper::ReLU6(relu6)); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `prev_nr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:119:37 [INFO] [stdout] | [INFO] [stdout] 119 | modified_mapping.insert(prev_nr as i32, LayerWrapper::Linear(linear)); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `prev_nr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:126:30 [INFO] [stdout] | [INFO] [stdout] 126 | match fs::create_dir_all(&output_dir) { [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `output_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:134:15 [INFO] [stdout] | [INFO] [stdout] 134 | .open("./".to_string() + &output_dir + "/" + &file_name) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `file_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:134:15 [INFO] [stdout] | [INFO] [stdout] 134 | .open("./".to_string() + &output_dir + "/" + &file_name) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^----------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `output_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:134:34 [INFO] [stdout] | [INFO] [stdout] 134 | .open("./".to_string() + &output_dir + "/" + &file_name) [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `output_dir` [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] --> pc_code/Quantization/src/lib/merge.rs:134:54 [INFO] [stdout] | [INFO] [stdout] 134 | .open("./".to_string() + &output_dir + "/" + &file_name) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `file_name` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | / match l { [INFO] [stdout] 23 | | None => { [INFO] [stdout] 24 | | continue; [INFO] [stdout] ... | [INFO] [stdout] 27 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 22 ~ if let None = l { [INFO] [stdout] 23 + continue; [INFO] [stdout] 24 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `flag` is never read [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:174:36 [INFO] [stdout] | [INFO] [stdout] 174 | let mut flag = 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: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:91:9 [INFO] [stdout] | [INFO] [stdout] 91 | / for entry in entries { [INFO] [stdout] 92 | | if let Ok(entry) = entry { [INFO] [stdout] 93 | | let file_path = entry.path(); [INFO] [stdout] ... | [INFO] [stdout] 245 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:92:13 [INFO] [stdout] | [INFO] [stdout] 92 | / if let Ok(entry) = entry { [INFO] [stdout] 93 | | let file_path = entry.path(); [INFO] [stdout] 94 | | // Check if it's a file (not a directory, symlink, etc.) [INFO] [stdout] 95 | | if file_path.is_file() { [INFO] [stdout] ... | [INFO] [stdout] 244 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 91 ~ for entry in entries.flatten() { [INFO] [stdout] 92 + let file_path = entry.path(); [INFO] [stdout] 93 + // Check if it's a file (not a directory, symlink, etc.) [INFO] [stdout] 94 + if file_path.is_file() { [INFO] [stdout] 95 + // Do something with the file, e.g., print its path [INFO] [stdout] 96 + println!("File: {:?}", file_path); [INFO] [stdout] 97 + println!("scales:{:?}", scales); [INFO] [stdout] 98 + println!("zero_points:{:?}", zero_points); [INFO] [stdout] 99 + println!("resi scales:{:?}", residual_scale); [INFO] [stdout] 100 + println!("resi zero:{:?}", residual_zero_points); [INFO] [stdout] 101 + let image = read_and_store_image(file_path.to_str().unwrap()).unwrap(); [INFO] [stdout] 102 + let mut input = pre_processing(image); [INFO] [stdout] 103 + let mut intermediate_output: Vec>> = Vec::new(); [INFO] [stdout] 104 + for i in 1..=layers.len() + 1 { [INFO] [stdout] 105 + //find the maximum and minimum element in the input [INFO] [stdout] 106 + let (mi, ma) = input [INFO] [stdout] 107 + .iter() [INFO] [stdout] 108 + .flat_map(|row| row.iter().flat_map(|col| col.iter())) [INFO] [stdout] 109 + .fold((f32::INFINITY, f32::NEG_INFINITY), |(mi, ma), &value| { [INFO] [stdout] 110 + (mi.min(value), ma.max(value)) [INFO] [stdout] 111 + }); [INFO] [stdout] 112 + //calculate the scale the zero point [INFO] [stdout] 113 + let range = ma - mi; [INFO] [stdout] 114 + let scale = range / 255.; [INFO] [stdout] 115 + let zero_point = -(mi / scale).round(); // z = -r / s + q [INFO] [stdout] 116 + //use EWMA to get the scale and zero point [INFO] [stdout] 117 + scales[i] = scales[i] * 0.99 + 0.01 * (scale); [INFO] [stdout] 118 + zero_points[i] = zero_points[i] * 0.99 + 0.01 * (zero_point); [INFO] [stdout] 119 + //perform forward operation [INFO] [stdout] 120 + if i == 88 { [INFO] [stdout] 121 + for i in 0..input.len() { [INFO] [stdout] 122 + let temp = &input[i]; [INFO] [stdout] 123 + let mut acc = 0.; [INFO] [stdout] 124 + temp.into_iter() [INFO] [stdout] 125 + .for_each(|x| acc += x.into_iter().sum::()); [INFO] [stdout] 126 + let mean = acc / input[i].len() as f32 / input[i][0].len() as f32; [INFO] [stdout] 127 + input[i] = vec![vec![mean]]; [INFO] [stdout] 128 + } //adaptive pooling [INFO] [stdout] 129 + // continue [INFO] [stdout] 130 + } [INFO] [stdout] 131 + if i > layers.len() { [INFO] [stdout] 132 + // print!("!!!!!!!"); [INFO] [stdout] 133 + test_result = input; [INFO] [stdout] 134 + break; [INFO] [stdout] 135 + } [INFO] [stdout] 136 + let layer = layers.get(&(i as i32)).unwrap(); [INFO] [stdout] 137 + let output_shape = layer.get_output_shape(); [INFO] [stdout] 138 + match layer.identify() { [INFO] [stdout] 139 + "Convolution" => { [INFO] [stdout] 140 + let mut output = vec![ [INFO] [stdout] 141 + vec![ [INFO] [stdout] 142 + vec![0.; output_shape[2] as usize]; [INFO] [stdout] 143 + output_shape[1] as usize [INFO] [stdout] 144 + ]; [INFO] [stdout] 145 + output_shape[0] as usize [INFO] [stdout] 146 + ]; [INFO] [stdout] 147 + let mut flag = true; [INFO] [stdout] 148 + for j in 0..output_shape[0] as usize { [INFO] [stdout] 149 + flag = true; [INFO] [stdout] 150 + let mut weights: Vec = Vec::new(); [INFO] [stdout] 151 + let mut bias = layer.get_bias(j as i32); [INFO] [stdout] 152 + for k in 0..output_shape[1] as usize { [INFO] [stdout] 153 + for m in 0..output_shape[2] as usize { [INFO] [stdout] 154 + let pos = vec![j as i32, k as i32, m as i32]; [INFO] [stdout] 155 + let inputs_p = layer.get_input(pos); [INFO] [stdout] 156 + //each output channel only need to sample weight once [INFO] [stdout] 157 + if flag { [INFO] [stdout] 158 + weights = layer.get_weights_from_input( [INFO] [stdout] 159 + inputs_p.clone(), [INFO] [stdout] 160 + j as i32, [INFO] [stdout] 161 + ); [INFO] [stdout] 162 + flag = false; [INFO] [stdout] 163 + } [INFO] [stdout] 164 + let inputs = util::sample_input_from_p_zero_padding( [INFO] [stdout] 165 + inputs_p, &input, [INFO] [stdout] 166 + ); [INFO] [stdout] 167 + let result = calculations::vector_mul_b( [INFO] [stdout] 168 + inputs, [INFO] [stdout] 169 + weights.clone(), [INFO] [stdout] 170 + bias, [INFO] [stdout] 171 + ); [INFO] [stdout] 172 + output[j][k][m] = result; [INFO] [stdout] 173 + } [INFO] [stdout] 174 + } [INFO] [stdout] 175 + } [INFO] [stdout] 176 + //next layer's input = this layer's output [INFO] [stdout] 177 + input = output; [INFO] [stdout] 178 + } [INFO] [stdout] 179 + "Batchnorm2d" => { [INFO] [stdout] 180 + let Ok(_a) = layer.functional_forward(&mut input) else { [INFO] [stdout] 181 + panic!("wrong layer") [INFO] [stdout] 182 + }; [INFO] [stdout] 183 + } [INFO] [stdout] 184 + "Relu6" => { [INFO] [stdout] 185 + let Ok(_a) = layer.functional_forward(&mut input) else { [INFO] [stdout] 186 + panic!("wrong layer") [INFO] [stdout] 187 + }; [INFO] [stdout] 188 + } [INFO] [stdout] 189 + "Linear" => { [INFO] [stdout] 190 + assert_eq!(input.len(), 1280); [INFO] [stdout] 191 + assert!(input[0].len() == 1 && input[0][0].len() == 1); [INFO] [stdout] 192 + let mut output = vec![vec![vec![0.0]]; 1000]; [INFO] [stdout] 193 + let weights = layer.get_weights(); [INFO] [stdout] 194 + if let InfoWrapper::Linear(info) = layer.get_info() { [INFO] [stdout] 195 + let weights_shape = [info.c_out, info.c_in]; //1000,1280 [INFO] [stdout] 196 + for i in 0..weights_shape[0] as usize { [INFO] [stdout] 197 + let mut acc = 0.; [INFO] [stdout] 198 + for j in 0..weights_shape[1] as usize { [INFO] [stdout] 199 + acc += weights[i * weights_shape[1] as usize + j] [INFO] [stdout] 200 + * input[j][0][0]; [INFO] [stdout] 201 + } [INFO] [stdout] 202 + output[i][0][0] = acc + layer.get_bias(i as i32); [INFO] [stdout] 203 + } [INFO] [stdout] 204 + } else { [INFO] [stdout] 205 + panic!("not a linear layer") [INFO] [stdout] 206 + } [INFO] [stdout] 207 + input = output; [INFO] [stdout] 208 + } [INFO] [stdout] 209 + _ => {} [INFO] [stdout] 210 + } [INFO] [stdout] 211 + //handle residual connection [INFO] [stdout] 212 + for r in 0..residual_connections.len() { [INFO] [stdout] 213 + if residual_connections[r][1] == i { [INFO] [stdout] 214 + let (mi, ma) = input [INFO] [stdout] 215 + .iter() [INFO] [stdout] 216 + .flat_map(|row| row.iter().flat_map(|col| col.iter())) [INFO] [stdout] 217 + .fold( [INFO] [stdout] 218 + (f32::INFINITY, f32::NEG_INFINITY), [INFO] [stdout] 219 + |(mi, ma), &value| (mi.min(value), ma.max(value)), [INFO] [stdout] 220 + ); [INFO] [stdout] 221 + //calculate the scale the zero point [INFO] [stdout] 222 + let range = ma - mi; [INFO] [stdout] 223 + let scale = range / 255.; [INFO] [stdout] 224 + let zero_point = -(mi / scale).round(); // z = -r / s + q [INFO] [stdout] 225 + //use EWMA to get the scale and zero point [INFO] [stdout] 226 + residual_scale[i] = residual_scale[i] * 0.99 + 0.01 * (scale); [INFO] [stdout] 227 + residual_zero_points[i] = [INFO] [stdout] 228 + residual_zero_points[i] * 0.99 + 0.01 * (zero_point); [INFO] [stdout] 229 + for j in 0..output_shape[0] as usize { [INFO] [stdout] 230 + for k in 0..output_shape[1] as usize { [INFO] [stdout] 231 + for m in 0..output_shape[2] as usize { [INFO] [stdout] 232 + input[j][k][m] += intermediate_output[j][k][m]; [INFO] [stdout] 233 + } [INFO] [stdout] 234 + } [INFO] [stdout] 235 + } [INFO] [stdout] 236 + } [INFO] [stdout] 237 + if residual_connections[r][0] == i { [INFO] [stdout] 238 + intermediate_output = input.clone(); [INFO] [stdout] 239 + } [INFO] [stdout] 240 + } [INFO] [stdout] 241 + } [INFO] [stdout] 242 + } [INFO] [stdout] 243 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `input` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:122:38 [INFO] [stdout] | [INFO] [stdout] 122 | ... for i in 0..input.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 122 - for i in 0..input.len() { [INFO] [stdout] 122 + for in &mut input { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:125:38 [INFO] [stdout] | [INFO] [stdout] 125 | ... temp.into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:126:60 [INFO] [stdout] | [INFO] [stdout] 126 | ... .for_each(|x| acc += x.into_iter().sum::()); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `flag` is never read [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:290:36 [INFO] [stdout] | [INFO] [stdout] 290 | let mut flag = true; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `output` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:149:42 [INFO] [stdout] | [INFO] [stdout] 149 | ... for j in 0..output_shape[0] as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 149 - for j in 0..output_shape[0] as usize { [INFO] [stdout] 149 + for (j, ) in output.iter_mut().enumerate().take(output_shape[0] as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is used to index `output` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:153:46 [INFO] [stdout] | [INFO] [stdout] 153 | ... for k in 0..output_shape[1] as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 153 - for k in 0..output_shape[1] as usize { [INFO] [stdout] 153 + for (k, ) in output.iter_mut().enumerate().take(output_shape[1] as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `m` is used to index `output` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:154:50 [INFO] [stdout] | [INFO] [stdout] 154 | ... for m in 0..output_shape[2] as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 154 - for m in 0..output_shape[2] as usize { [INFO] [stdout] 154 + for (m, ) in output.iter_mut().enumerate().take(output_shape[2] as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `algo::LayerWrapper::Linear` [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | use algo::LayerWrapper::Linear; [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 imports: `ConvMapping` and `LinearMapping` [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:3:18 [INFO] [stdout] | [INFO] [stdout] 3 | use algo::{Conv, ConvMapping, InfoWrapper, Layer, LayerWrapper, LinearMapping, Relu6}; [INFO] [stdout] | ^^^^^^^^^^^ ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::task::ready` [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | use std::task::ready; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around assigned value [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:57:52 [INFO] [stdout] | [INFO] [stdout] 57 | weights_fused[dim][y][x] = (w_bn * conv_weights[i * kernel_size + j]); [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] 57 - weights_fused[dim][y][x] = (w_bn * conv_weights[i * kernel_size + j]); [INFO] [stdout] 57 + weights_fused[dim][y][x] = w_bn * conv_weights[i * kernel_size + j] ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around assigned value [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:115:38 [INFO] [stdout] | [INFO] [stdout] 115 | linear.w[i][j] = (weights[i * shape[0] as usize + j]); [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 115 - linear.w[i][j] = (weights[i * shape[0] as usize + j]); [INFO] [stdout] 115 + linear.w[i][j] = weights[i * shape[0] as usize + j] ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around assigned value [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:117:34 [INFO] [stdout] | [INFO] [stdout] 117 | linear.bias[i] = (layer.get_bias(i as i32)); [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 117 - linear.bias[i] = (layer.get_bias(i as i32)); [INFO] [stdout] 117 + linear.bias[i] = layer.get_bias(i as i32) ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `LayerWrapper` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:3:45 [INFO] [stdout] | [INFO] [stdout] 3 | calculations, util, InfoWrapper, Layer, LayerWrapper, Mapping, QuantizedMapping, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `max` and `min` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:6:16 [INFO] [stdout] | [INFO] [stdout] 6 | use std::cmp::{max, min}; [INFO] [stdout] | ^^^ ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `r` is only used to index `residual_connections` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:213:34 [INFO] [stdout] | [INFO] [stdout] 213 | for r in 0..residual_connections.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 213 - for r in 0..residual_connections.len() { [INFO] [stdout] 213 + for in &residual_connections { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::fs::File` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | use std::fs::File; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `BufRead` and `BufReader` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:10:15 [INFO] [stdout] | [INFO] [stdout] 10 | use std::io::{BufRead, BufReader}; [INFO] [stdout] | ^^^^^^^ ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:528:21 [INFO] [stdout] | [INFO] [stdout] 528 | m: m, [INFO] [stdout] | ^^^^ help: replace it with: `m` [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: useless use of `vec!` [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:105:25 [INFO] [stdout] | [INFO] [stdout] 105 | let shape = vec![info.c_in, info.c_out]; //1280 * 1000 for mobilenet v2 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[info.c_in, info.c_out]` [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: variable `map_size` is assigned to, but never used [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:549:25 [INFO] [stdout] | [INFO] [stdout] 549 | let mut map_size = 0; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_map_size` instead [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `padding_size` is assigned to, but never used [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:550:25 [INFO] [stdout] | [INFO] [stdout] 550 | let mut padding_size = 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_padding_size` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `map_size` is never read [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:558:29 [INFO] [stdout] | [INFO] [stdout] 558 | ... map_size += m.len(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `padding_size` is never read [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:554:29 [INFO] [stdout] | [INFO] [stdout] 554 | ... padding_size += padding_po.len() * 4; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:729:13 [INFO] [stdout] | [INFO] [stdout] 729 | let mut input_shape = vec![3, height, width]; [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: `input_shape` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:729:13 [INFO] [stdout] | [INFO] [stdout] 729 | let mut input_shape = vec![3, height, width]; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_input_shape` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `flag` is never read [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:760:36 [INFO] [stdout] | [INFO] [stdout] 760 | let mut flag = true; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `pixel` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:831:21 [INFO] [stdout] | [INFO] [stdout] 831 | for (x, pixel) in row.iter().enumerate() { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_pixel` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `processed_image` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:846:13 [INFO] [stdout] | [INFO] [stdout] 846 | let processed_image = pre_processing(image_data); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_processed_image` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `c` is used to index `data` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:49:18 [INFO] [stdout] | [INFO] [stdout] 49 | for c in 0..channels { [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] 49 - for c in 0..channels { [INFO] [stdout] 49 + for (c, ) in data.iter_mut().enumerate().take(channels) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `data` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:50:22 [INFO] [stdout] | [INFO] [stdout] 50 | for i in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 50 - for i in 0..height { [INFO] [stdout] 50 + for (i, ) in data.iter_mut().enumerate().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `data` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:51:26 [INFO] [stdout] | [INFO] [stdout] 51 | for j in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 51 - for j in 0..width { [INFO] [stdout] 51 + for (j, ) in data.iter_mut().enumerate().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this manual char comparison can be written more succinctly [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:115:24 [INFO] [stdout] | [INFO] [stdout] 115 | .split(|x| x == ' ') [INFO] [stdout] | ^^^^^^^^^^^^ help: consider using a `char`: `' '` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison [INFO] [stdout] = note: `#[warn(clippy::manual_pattern_char_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `output` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:175:30 [INFO] [stdout] | [INFO] [stdout] 175 | for j in 0..output_shape[0] as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 175 - for j in 0..output_shape[0] as usize { [INFO] [stdout] 175 + for (j, ) in output.iter_mut().enumerate().take(output_shape[0] as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is used to index `output` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:178:34 [INFO] [stdout] | [INFO] [stdout] 178 | for k in 0..output_shape[1] as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 178 - for k in 0..output_shape[1] as usize { [INFO] [stdout] 178 + for (k, ) in output.iter_mut().enumerate().take(output_shape[1] as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `m` is used to index `output` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:179:38 [INFO] [stdout] | [INFO] [stdout] 179 | ... for m in 0..output_shape[2] as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 179 - for m in 0..output_shape[2] as usize { [INFO] [stdout] 179 + for (m, ) in output.iter_mut().enumerate().take(output_shape[2] as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `c` is used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:258:18 [INFO] [stdout] | [INFO] [stdout] 258 | for c in 0..channels { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 258 - for c in 0..channels { [INFO] [stdout] 258 + for (c, ) in input.iter_mut().enumerate().take(channels) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:259:22 [INFO] [stdout] | [INFO] [stdout] 259 | for i in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 259 - for i in 0..height { [INFO] [stdout] 259 + for (i, ) in input.iter_mut().enumerate().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:260:26 [INFO] [stdout] | [INFO] [stdout] 260 | for j in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 260 - for j in 0..width { [INFO] [stdout] 260 + for (j, ) in input.iter_mut().enumerate().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `output` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:291:30 [INFO] [stdout] | [INFO] [stdout] 291 | for j in 0..output_shape[0] as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 291 - for j in 0..output_shape[0] as usize { [INFO] [stdout] 291 + for (j, ) in output.iter_mut().enumerate().take(output_shape[0] as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is used to index `output` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:294:34 [INFO] [stdout] | [INFO] [stdout] 294 | for k in 0..output_shape[1] as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 294 - for k in 0..output_shape[1] as usize { [INFO] [stdout] 294 + for (k, ) in output.iter_mut().enumerate().take(output_shape[1] as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `m` is used to index `output` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:295:38 [INFO] [stdout] | [INFO] [stdout] 295 | ... for m in 0..output_shape[2] as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 295 - for m in 0..output_shape[2] as usize { [INFO] [stdout] 295 + for (m, ) in output.iter_mut().enumerate().take(output_shape[2] as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `c` is used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:387:18 [INFO] [stdout] | [INFO] [stdout] 387 | for c in 0..channels { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 387 - for c in 0..channels { [INFO] [stdout] 387 + for (c, ) in input.iter_mut().enumerate().take(channels) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:388:22 [INFO] [stdout] | [INFO] [stdout] 388 | for i in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 388 - for i in 0..height { [INFO] [stdout] 388 + for (i, ) in input.iter_mut().enumerate().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:389:26 [INFO] [stdout] | [INFO] [stdout] 389 | for j in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 389 - for j in 0..width { [INFO] [stdout] 389 + for (j, ) in input.iter_mut().enumerate().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::slice::SliceIndex` [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | use std::slice::SliceIndex; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `r` is only used to index `residual_connections` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:645:22 [INFO] [stdout] | [INFO] [stdout] 645 | for r in 0..residual_connections.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 645 - for r in 0..residual_connections.len() { [INFO] [stdout] 645 + for in &residual_connections { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | let mut layers_len = layers.len(); [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: variable does not need to be mutable [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:33:21 [INFO] [stdout] | [INFO] [stdout] 33 | let mut conv_weights = layer.get_weights(); [INFO] [stdout] | ----^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `c` is used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:730:18 [INFO] [stdout] | [INFO] [stdout] 730 | for c in 0..channels { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 730 - for c in 0..channels { [INFO] [stdout] 730 + for (c, ) in input.iter_mut().enumerate().take(channels) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `layers_len` [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | let mut layers_len = layers.len(); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_layers_len` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:731:22 [INFO] [stdout] | [INFO] [stdout] 731 | for i in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 731 - for i in 0..height { [INFO] [stdout] 731 + for (i, ) in input.iter_mut().enumerate().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `input` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:732:26 [INFO] [stdout] | [INFO] [stdout] 732 | for j in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 732 - for j in 0..width { [INFO] [stdout] 732 + for (j, ) in input.iter_mut().enumerate().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `output` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:761:30 [INFO] [stdout] | [INFO] [stdout] 761 | for j in 0..output_shape[0] as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 761 - for j in 0..output_shape[0] as usize { [INFO] [stdout] 761 + for (j, ) in output.iter_mut().enumerate().take(output_shape[0] as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is used to index `output` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:764:34 [INFO] [stdout] | [INFO] [stdout] 764 | for k in 0..output_shape[1] as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 764 - for k in 0..output_shape[1] as usize { [INFO] [stdout] 764 + for (k, ) in output.iter_mut().enumerate().take(output_shape[1] as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `m` is used to index `output` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:765:38 [INFO] [stdout] | [INFO] [stdout] 765 | ... for m in 0..output_shape[2] as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 765 - for m in 0..output_shape[2] as usize { [INFO] [stdout] 765 + for (m, ) in output.iter_mut().enumerate().take(output_shape[2] as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:44:13 [INFO] [stdout] | [INFO] [stdout] 44 | let mut weights_quantized = layer [INFO] [stdout] | ----^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> pc_code/Algorithms/src/main.rs:729:31 [INFO] [stdout] | [INFO] [stdout] 729 | let mut input_shape = vec![3, height, width]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[3, height, width]` [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: variable does not need to be mutable [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:71:9 [INFO] [stdout] | [INFO] [stdout] 71 | let mut m_scale: Vec = vec![0; 100]; [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] --> pc_code/Quantization/src/lib/quant.rs:152:41 [INFO] [stdout] | [INFO] [stdout] 152 | ... let mut bias = layer.get_bias(j as i32); [INFO] [stdout] | ----^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `test_result` is assigned to, but never used [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:76:9 [INFO] [stdout] | [INFO] [stdout] 76 | let mut test_result = Vec::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_test_result` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `test_result` is never read [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:134:29 [INFO] [stdout] | [INFO] [stdout] 134 | ... test_result = input; [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: value assigned to `flag` is never read [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:148:48 [INFO] [stdout] | [INFO] [stdout] 148 | ... let mut flag = true; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:488:9 [INFO] [stdout] | [INFO] [stdout] 488 | let mut s1 = scales[layer_id]; [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] --> pc_code/Quantization/src/lib/quant.rs:500:9 [INFO] [stdout] | [INFO] [stdout] 500 | let mut zero1 = zero_points[layer_id].round() as u8; [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `m` is never read [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:487:17 [INFO] [stdout] | [INFO] [stdout] 487 | let mut m = 0.; [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:17:39 [INFO] [stdout] | [INFO] [stdout] 17 | let Some(layer) = layers.get(&(a as i32)) else { [INFO] [stdout] | ^^^^^^^^^^ help: try: `{ a }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:21:43 [INFO] [stdout] | [INFO] [stdout] 21 | let next_layer = layers.get(&(a as i32 + 1)).unwrap(); [INFO] [stdout] | ^^^^^^^^ help: try: `a` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:25:24 [INFO] [stdout] | [INFO] [stdout] 25 | let i_pg = info.i_pg.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `info.i_pg` [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, i32)` which implements the `Copy` trait [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:26:32 [INFO] [stdout] | [INFO] [stdout] 26 | let kernel_shape = info.k.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `info.k` [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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:62:41 [INFO] [stdout] | [INFO] [stdout] 62 | modified_mapping.insert(prev_nr as i32, LayerWrapper::Convolution(fused_conv)); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `prev_nr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:92:41 [INFO] [stdout] | [INFO] [stdout] 92 | modified_mapping.insert(prev_nr as i32, LayerWrapper::Convolution(conv)); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `prev_nr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:99:37 [INFO] [stdout] | [INFO] [stdout] 99 | modified_mapping.insert(prev_nr as i32, LayerWrapper::ReLU6(relu6)); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `prev_nr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:119:37 [INFO] [stdout] | [INFO] [stdout] 119 | modified_mapping.insert(prev_nr as i32, LayerWrapper::Linear(linear)); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `prev_nr` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:126:30 [INFO] [stdout] | [INFO] [stdout] 126 | match fs::create_dir_all(&output_dir) { [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `output_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:134:15 [INFO] [stdout] | [INFO] [stdout] 134 | .open("./".to_string() + &output_dir + "/" + &file_name) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `file_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:134:15 [INFO] [stdout] | [INFO] [stdout] 134 | .open("./".to_string() + &output_dir + "/" + &file_name) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^----------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `output_dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:134:34 [INFO] [stdout] | [INFO] [stdout] 134 | .open("./".to_string() + &output_dir + "/" + &file_name) [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `output_dir` [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] --> pc_code/Quantization/src/lib/merge.rs:134:54 [INFO] [stdout] | [INFO] [stdout] 134 | .open("./".to_string() + &output_dir + "/" + &file_name) [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `file_name` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | / match l { [INFO] [stdout] 23 | | None => { [INFO] [stdout] 24 | | continue; [INFO] [stdout] ... | [INFO] [stdout] 27 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 22 ~ if let None = l { [INFO] [stdout] 23 + continue; [INFO] [stdout] 24 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:91:9 [INFO] [stdout] | [INFO] [stdout] 91 | / for entry in entries { [INFO] [stdout] 92 | | if let Ok(entry) = entry { [INFO] [stdout] 93 | | let file_path = entry.path(); [INFO] [stdout] ... | [INFO] [stdout] 245 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:92:13 [INFO] [stdout] | [INFO] [stdout] 92 | / if let Ok(entry) = entry { [INFO] [stdout] 93 | | let file_path = entry.path(); [INFO] [stdout] 94 | | // Check if it's a file (not a directory, symlink, etc.) [INFO] [stdout] 95 | | if file_path.is_file() { [INFO] [stdout] ... | [INFO] [stdout] 244 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 91 ~ for entry in entries.flatten() { [INFO] [stdout] 92 + let file_path = entry.path(); [INFO] [stdout] 93 + // Check if it's a file (not a directory, symlink, etc.) [INFO] [stdout] 94 + if file_path.is_file() { [INFO] [stdout] 95 + // Do something with the file, e.g., print its path [INFO] [stdout] 96 + println!("File: {:?}", file_path); [INFO] [stdout] 97 + println!("scales:{:?}", scales); [INFO] [stdout] 98 + println!("zero_points:{:?}", zero_points); [INFO] [stdout] 99 + println!("resi scales:{:?}", residual_scale); [INFO] [stdout] 100 + println!("resi zero:{:?}", residual_zero_points); [INFO] [stdout] 101 + let image = read_and_store_image(file_path.to_str().unwrap()).unwrap(); [INFO] [stdout] 102 + let mut input = pre_processing(image); [INFO] [stdout] 103 + let mut intermediate_output: Vec>> = Vec::new(); [INFO] [stdout] 104 + for i in 1..=layers.len() + 1 { [INFO] [stdout] 105 + //find the maximum and minimum element in the input [INFO] [stdout] 106 + let (mi, ma) = input [INFO] [stdout] 107 + .iter() [INFO] [stdout] 108 + .flat_map(|row| row.iter().flat_map(|col| col.iter())) [INFO] [stdout] 109 + .fold((f32::INFINITY, f32::NEG_INFINITY), |(mi, ma), &value| { [INFO] [stdout] 110 + (mi.min(value), ma.max(value)) [INFO] [stdout] 111 + }); [INFO] [stdout] 112 + //calculate the scale the zero point [INFO] [stdout] 113 + let range = ma - mi; [INFO] [stdout] 114 + let scale = range / 255.; [INFO] [stdout] 115 + let zero_point = -(mi / scale).round(); // z = -r / s + q [INFO] [stdout] 116 + //use EWMA to get the scale and zero point [INFO] [stdout] 117 + scales[i] = scales[i] * 0.99 + 0.01 * (scale); [INFO] [stdout] 118 + zero_points[i] = zero_points[i] * 0.99 + 0.01 * (zero_point); [INFO] [stdout] 119 + //perform forward operation [INFO] [stdout] 120 + if i == 88 { [INFO] [stdout] 121 + for i in 0..input.len() { [INFO] [stdout] 122 + let temp = &input[i]; [INFO] [stdout] 123 + let mut acc = 0.; [INFO] [stdout] 124 + temp.into_iter() [INFO] [stdout] 125 + .for_each(|x| acc += x.into_iter().sum::()); [INFO] [stdout] 126 + let mean = acc / input[i].len() as f32 / input[i][0].len() as f32; [INFO] [stdout] 127 + input[i] = vec![vec![mean]]; [INFO] [stdout] 128 + } //adaptive pooling [INFO] [stdout] 129 + // continue [INFO] [stdout] 130 + } [INFO] [stdout] 131 + if i > layers.len() { [INFO] [stdout] 132 + // print!("!!!!!!!"); [INFO] [stdout] 133 + test_result = input; [INFO] [stdout] 134 + break; [INFO] [stdout] 135 + } [INFO] [stdout] 136 + let layer = layers.get(&(i as i32)).unwrap(); [INFO] [stdout] 137 + let output_shape = layer.get_output_shape(); [INFO] [stdout] 138 + match layer.identify() { [INFO] [stdout] 139 + "Convolution" => { [INFO] [stdout] 140 + let mut output = vec![ [INFO] [stdout] 141 + vec![ [INFO] [stdout] 142 + vec![0.; output_shape[2] as usize]; [INFO] [stdout] 143 + output_shape[1] as usize [INFO] [stdout] 144 + ]; [INFO] [stdout] 145 + output_shape[0] as usize [INFO] [stdout] 146 + ]; [INFO] [stdout] 147 + let mut flag = true; [INFO] [stdout] 148 + for j in 0..output_shape[0] as usize { [INFO] [stdout] 149 + flag = true; [INFO] [stdout] 150 + let mut weights: Vec = Vec::new(); [INFO] [stdout] 151 + let mut bias = layer.get_bias(j as i32); [INFO] [stdout] 152 + for k in 0..output_shape[1] as usize { [INFO] [stdout] 153 + for m in 0..output_shape[2] as usize { [INFO] [stdout] 154 + let pos = vec![j as i32, k as i32, m as i32]; [INFO] [stdout] 155 + let inputs_p = layer.get_input(pos); [INFO] [stdout] 156 + //each output channel only need to sample weight once [INFO] [stdout] 157 + if flag { [INFO] [stdout] 158 + weights = layer.get_weights_from_input( [INFO] [stdout] 159 + inputs_p.clone(), [INFO] [stdout] 160 + j as i32, [INFO] [stdout] 161 + ); [INFO] [stdout] 162 + flag = false; [INFO] [stdout] 163 + } [INFO] [stdout] 164 + let inputs = util::sample_input_from_p_zero_padding( [INFO] [stdout] 165 + inputs_p, &input, [INFO] [stdout] 166 + ); [INFO] [stdout] 167 + let result = calculations::vector_mul_b( [INFO] [stdout] 168 + inputs, [INFO] [stdout] 169 + weights.clone(), [INFO] [stdout] 170 + bias, [INFO] [stdout] 171 + ); [INFO] [stdout] 172 + output[j][k][m] = result; [INFO] [stdout] 173 + } [INFO] [stdout] 174 + } [INFO] [stdout] 175 + } [INFO] [stdout] 176 + //next layer's input = this layer's output [INFO] [stdout] 177 + input = output; [INFO] [stdout] 178 + } [INFO] [stdout] 179 + "Batchnorm2d" => { [INFO] [stdout] 180 + let Ok(_a) = layer.functional_forward(&mut input) else { [INFO] [stdout] 181 + panic!("wrong layer") [INFO] [stdout] 182 + }; [INFO] [stdout] 183 + } [INFO] [stdout] 184 + "Relu6" => { [INFO] [stdout] 185 + let Ok(_a) = layer.functional_forward(&mut input) else { [INFO] [stdout] 186 + panic!("wrong layer") [INFO] [stdout] 187 + }; [INFO] [stdout] 188 + } [INFO] [stdout] 189 + "Linear" => { [INFO] [stdout] 190 + assert_eq!(input.len(), 1280); [INFO] [stdout] 191 + assert!(input[0].len() == 1 && input[0][0].len() == 1); [INFO] [stdout] 192 + let mut output = vec![vec![vec![0.0]]; 1000]; [INFO] [stdout] 193 + let weights = layer.get_weights(); [INFO] [stdout] 194 + if let InfoWrapper::Linear(info) = layer.get_info() { [INFO] [stdout] 195 + let weights_shape = [info.c_out, info.c_in]; //1000,1280 [INFO] [stdout] 196 + for i in 0..weights_shape[0] as usize { [INFO] [stdout] 197 + let mut acc = 0.; [INFO] [stdout] 198 + for j in 0..weights_shape[1] as usize { [INFO] [stdout] 199 + acc += weights[i * weights_shape[1] as usize + j] [INFO] [stdout] 200 + * input[j][0][0]; [INFO] [stdout] 201 + } [INFO] [stdout] 202 + output[i][0][0] = acc + layer.get_bias(i as i32); [INFO] [stdout] 203 + } [INFO] [stdout] 204 + } else { [INFO] [stdout] 205 + panic!("not a linear layer") [INFO] [stdout] 206 + } [INFO] [stdout] 207 + input = output; [INFO] [stdout] 208 + } [INFO] [stdout] 209 + _ => {} [INFO] [stdout] 210 + } [INFO] [stdout] 211 + //handle residual connection [INFO] [stdout] 212 + for r in 0..residual_connections.len() { [INFO] [stdout] 213 + if residual_connections[r][1] == i { [INFO] [stdout] 214 + let (mi, ma) = input [INFO] [stdout] 215 + .iter() [INFO] [stdout] 216 + .flat_map(|row| row.iter().flat_map(|col| col.iter())) [INFO] [stdout] 217 + .fold( [INFO] [stdout] 218 + (f32::INFINITY, f32::NEG_INFINITY), [INFO] [stdout] 219 + |(mi, ma), &value| (mi.min(value), ma.max(value)), [INFO] [stdout] 220 + ); [INFO] [stdout] 221 + //calculate the scale the zero point [INFO] [stdout] 222 + let range = ma - mi; [INFO] [stdout] 223 + let scale = range / 255.; [INFO] [stdout] 224 + let zero_point = -(mi / scale).round(); // z = -r / s + q [INFO] [stdout] 225 + //use EWMA to get the scale and zero point [INFO] [stdout] 226 + residual_scale[i] = residual_scale[i] * 0.99 + 0.01 * (scale); [INFO] [stdout] 227 + residual_zero_points[i] = [INFO] [stdout] 228 + residual_zero_points[i] * 0.99 + 0.01 * (zero_point); [INFO] [stdout] 229 + for j in 0..output_shape[0] as usize { [INFO] [stdout] 230 + for k in 0..output_shape[1] as usize { [INFO] [stdout] 231 + for m in 0..output_shape[2] as usize { [INFO] [stdout] 232 + input[j][k][m] += intermediate_output[j][k][m]; [INFO] [stdout] 233 + } [INFO] [stdout] 234 + } [INFO] [stdout] 235 + } [INFO] [stdout] 236 + } [INFO] [stdout] 237 + if residual_connections[r][0] == i { [INFO] [stdout] 238 + intermediate_output = input.clone(); [INFO] [stdout] 239 + } [INFO] [stdout] 240 + } [INFO] [stdout] 241 + } [INFO] [stdout] 242 + } [INFO] [stdout] 243 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `input` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:122:38 [INFO] [stdout] | [INFO] [stdout] 122 | ... for i in 0..input.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 122 - for i in 0..input.len() { [INFO] [stdout] 122 + for in &mut input { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:125:38 [INFO] [stdout] | [INFO] [stdout] 125 | ... temp.into_iter() [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter()` and will not consume the `Vec` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:126:60 [INFO] [stdout] | [INFO] [stdout] 126 | ... .for_each(|x| acc += x.into_iter().sum::()); [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `output` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:149:42 [INFO] [stdout] | [INFO] [stdout] 149 | ... for j in 0..output_shape[0] as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 149 - for j in 0..output_shape[0] as usize { [INFO] [stdout] 149 + for (j, ) in output.iter_mut().enumerate().take(output_shape[0] as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is used to index `output` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:153:46 [INFO] [stdout] | [INFO] [stdout] 153 | ... for k in 0..output_shape[1] as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 153 - for k in 0..output_shape[1] as usize { [INFO] [stdout] 153 + for (k, ) in output.iter_mut().enumerate().take(output_shape[1] as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `m` is used to index `output` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:154:50 [INFO] [stdout] | [INFO] [stdout] 154 | ... for m in 0..output_shape[2] as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 154 - for m in 0..output_shape[2] as usize { [INFO] [stdout] 154 + for (m, ) in output.iter_mut().enumerate().take(output_shape[2] as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `r` is only used to index `residual_connections` [INFO] [stdout] --> pc_code/Quantization/src/lib/quant.rs:213:34 [INFO] [stdout] | [INFO] [stdout] 213 | for r in 0..residual_connections.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 213 - for r in 0..residual_connections.len() { [INFO] [stdout] 213 + for in &residual_connections { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> pc_code/Quantization/src/lib/merge.rs:105:25 [INFO] [stdout] | [INFO] [stdout] 105 | let shape = vec![info.c_in, info.c_out]; //1280 * 1000 for mobilenet v2 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[info.c_in, info.c_out]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking Simulation v0.1.0 (/opt/rustwide/workdir/pc_code/Simulation) [INFO] [stdout] warning: unused import: `quant::merge::merge_batchnorm` [INFO] [stdout] --> pc_code/Quantization/src/main.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | use quant::merge::merge_batchnorm; [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 variable: `res` [INFO] [stdout] --> pc_code/Quantization/src/main.rs:11:10 [INFO] [stdout] | [INFO] [stdout] 11 | let (res, scale, zero) = quantize_layers_weights(&original_layers); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_res` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `scale` [INFO] [stdout] --> pc_code/Quantization/src/main.rs:11:15 [INFO] [stdout] | [INFO] [stdout] 11 | let (res, scale, zero) = quantize_layers_weights(&original_layers); [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_scale` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `zero` [INFO] [stdout] --> pc_code/Quantization/src/main.rs:11:22 [INFO] [stdout] | [INFO] [stdout] 11 | let (res, scale, zero) = quantize_layers_weights(&original_layers); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_zero` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `Deserialize` and `Serialize` [INFO] [stdout] --> pc_code/Simulation/src/distribution.rs:5:13 [INFO] [stdout] | [INFO] [stdout] 5 | use serde::{Deserialize, Serialize}; [INFO] [stdout] | ^^^^^^^^^^^ ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::fmt::format` [INFO] [stdout] --> pc_code/Simulation/src/distribution.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | use std::fmt::format; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `read` [INFO] [stdout] --> pc_code/Simulation/src/distribution.rs:10:15 [INFO] [stdout] | [INFO] [stdout] 10 | use std::fs::{read, File, OpenOptions}; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `algo::calculations::batchnorm` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | use algo::calculations::batchnorm; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `OpenOptions` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:5:21 [INFO] [stdout] | [INFO] [stdout] 5 | use std::fs::{File, OpenOptions}; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Add` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:7:16 [INFO] [stdout] | [INFO] [stdout] 7 | use std::ops::{Add, AddAssign}; [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::result` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | use std::result; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::sync::mpsc::RecvError` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | use std::sync::mpsc::RecvError; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Duration` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:12:14 [INFO] [stdout] | [INFO] [stdout] 12 | use chrono::{Duration, TimeDelta}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `quant::merge::merge_batchnorm` [INFO] [stdout] --> pc_code/Quantization/src/main.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | use quant::merge::merge_batchnorm; [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 imports: `generate_test_input` and `test_equal` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:3:58 [INFO] [stdout] | [INFO] [stdout] 3 | decode_coordinator, decode_worker, flatten_3d_array, generate_test_input, test_equal, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `chrono::prelude::*` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | use chrono::prelude::*; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `core::num` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | use core::num; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `BufRead` and `BufReader` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:10:15 [INFO] [stdout] | [INFO] [stdout] 10 | use std::io::{BufRead, BufReader}; [INFO] [stdout] | ^^^^^^^ ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `Arc` and `Mutex` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:11:23 [INFO] [stdout] | [INFO] [stdout] 11 | use std::sync::{mpsc, Arc, Mutex}; [INFO] [stdout] | ^^^ ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Duration` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:14:14 [INFO] [stdout] | [INFO] [stdout] 14 | use chrono::{Duration, TimeDelta}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `algo::operations::find_which_cpu` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | use algo::operations::find_which_cpu; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `res` [INFO] [stdout] --> pc_code/Quantization/src/main.rs:11:10 [INFO] [stdout] | [INFO] [stdout] 11 | let (res, scale, zero) = quantize_layers_weights(&original_layers); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_res` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `scale` [INFO] [stdout] --> pc_code/Quantization/src/main.rs:11:15 [INFO] [stdout] | [INFO] [stdout] 11 | let (res, scale, zero) = quantize_layers_weights(&original_layers); [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_scale` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `zero` [INFO] [stdout] --> pc_code/Quantization/src/main.rs:11:22 [INFO] [stdout] | [INFO] [stdout] 11 | let (res, scale, zero) = quantize_layers_weights(&original_layers); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_zero` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `algo::WeightUnit` [INFO] [stdout] --> pc_code/Simulation/src/util.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | use algo::WeightUnit; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::time::Instant` [INFO] [stdout] --> pc_code/Simulation/src/util.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | use std::time::Instant; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `distribute_mapping_weight` [INFO] [stdout] --> pc_code/Simulation/src/main.rs:8:27 [INFO] [stdout] | [INFO] [stdout] 8 | use crate::distribution::{distribute_mapping_weight, distribute_mapping_weight_quant}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `Message`, `Result`, and `Work` [INFO] [stdout] --> pc_code/Simulation/src/main.rs:9:20 [INFO] [stdout] | [INFO] [stdout] 9 | use crate::nodes::{Message, Result, Work}; [INFO] [stdout] | ^^^^^^^ ^^^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `c_1_simulation` [INFO] [stdout] --> pc_code/Simulation/src/main.rs:10:34 [INFO] [stdout] | [INFO] [stdout] 10 | use crate::simulation_settings::{c_1_simulation, c_1_simulation_quant}; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `Arc`, `Mutex`, and `mpsc` [INFO] [stdout] --> pc_code/Simulation/src/main.rs:13:17 [INFO] [stdout] | [INFO] [stdout] 13 | use std::sync::{mpsc, Arc, Mutex}; [INFO] [stdout] | ^^^^ ^^^ ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::thread` [INFO] [stdout] --> pc_code/Simulation/src/main.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | use std::thread; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> pc_code/Simulation/src/distribution.rs:50:25 [INFO] [stdout] | [INFO] [stdout] 50 | let mut worker: Worker = Worker { [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: variable does not need to be mutable [INFO] [stdout] --> pc_code/Simulation/src/distribution.rs:66:21 [INFO] [stdout] | [INFO] [stdout] 66 | let mut coordinator = Coordinator { [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] --> pc_code/Simulation/src/distribution.rs:194:25 [INFO] [stdout] | [INFO] [stdout] 194 | let mut worker: Worker = Worker { [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] --> pc_code/Simulation/src/distribution.rs:210:21 [INFO] [stdout] | [INFO] [stdout] 210 | let mut coordinator = Coordinator { [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `res` [INFO] [stdout] --> pc_code/Simulation/src/distribution.rs:169:10 [INFO] [stdout] | [INFO] [stdout] 169 | let (res, w_scales, w_zeros) = quantize_layers_weights(&layers); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_res` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:75:25 [INFO] [stdout] | [INFO] [stdout] 75 | let mut next_mcus = decode_u128(&self.mapping[i].map[cur_phase]); [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] --> pc_code/Simulation/src/nodes.rs:113:33 [INFO] [stdout] | [INFO] [stdout] 113 | ... let mut next_mcus = decode_u128(&self.mapping[i].map[cur_phase]); [INFO] [stdout] | ----^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `len` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:268:13 [INFO] [stdout] | [INFO] [stdout] 268 | let len = self.inputs.len(); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_len` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:330:25 [INFO] [stdout] | [INFO] [stdout] 330 | let mut next_mcus = decode_u128(&self.mapping[i].map[cur_phase]); [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] --> pc_code/Simulation/src/nodes.rs:381:33 [INFO] [stdout] | [INFO] [stdout] 381 | ... let mut next_mcus = decode_u128(&self.mapping[i].map[cur_phase]); [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] --> pc_code/Simulation/src/nodes.rs:496:9 [INFO] [stdout] | [INFO] [stdout] 496 | mut calculation_duration: &mut TimeDelta, [INFO] [stdout] | ----^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `len` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:533:13 [INFO] [stdout] | [INFO] [stdout] 533 | let len = self.inputs.len(); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_len` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `me` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:110:21 [INFO] [stdout] | [INFO] [stdout] 110 | Err(me) => { [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_me` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `me` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:266:21 [INFO] [stdout] | [INFO] [stdout] 266 | Err(me) => { [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_me` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `distribute_mapping_weight` is never used [INFO] [stdout] --> pc_code/Simulation/src/distribution.rs:13:8 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn distribute_mapping_weight( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `receive_and_send` and `receive_and_terminate` are never used [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:38:12 [INFO] [stdout] | [INFO] [stdout] 37 | impl Coordinator { [INFO] [stdout] | ------------------------- methods in this implementation [INFO] [stdout] 38 | pub fn receive_and_send( [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 175 | pub fn receive_and_terminate( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `receive`, `work`, and `adaptive_pooling` are never used [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:216:12 [INFO] [stdout] | [INFO] [stdout] 215 | impl Worker { [INFO] [stdout] | ---------------------------- methods in this implementation [INFO] [stdout] 216 | pub fn receive(&mut self, rec: &mpsc::Receiver>, id: u8) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 236 | pub fn work( [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 265 | pub fn adaptive_pooling(&mut self) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `preparation_phase` is never used [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:17:8 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn preparation_phase() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `c_1_simulation` is never used [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:20:8 [INFO] [stdout] | [INFO] [stdout] 20 | pub fn c_1_simulation(num_workers: u8, end: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `generate_test_input` is never used [INFO] [stdout] --> pc_code/Simulation/src/util.rs:108:8 [INFO] [stdout] | [INFO] [stdout] 108 | pub fn generate_test_input(width: usize, height: usize, channel: usize) -> Vec>> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `test_equal` is never used [INFO] [stdout] --> pc_code/Simulation/src/util.rs:131:8 [INFO] [stdout] | [INFO] [stdout] 131 | pub fn test_equal(result_vec: Vec) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> pc_code/Simulation/src/distribution.rs:20:8 [INFO] [stdout] | [INFO] [stdout] 20 | if !fs::metadata(&output_dir).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fs::metadata(&output_dir).is_err()` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:178:15 [INFO] [stdout] | [INFO] [stdout] 178 | send: &Vec>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 178 - send: &Vec>>, [INFO] [stdout] 178 + send: &[mpsc::Sender>], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `send` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:183:18 [INFO] [stdout] | [INFO] [stdout] 183 | for i in 0..worker_swarm_size as usize { [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] 183 - for i in 0..worker_swarm_size as usize { [INFO] [stdout] 183 + for (i, ) in send.iter().enumerate().take(worker_swarm_size as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `result` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:244:22 [INFO] [stdout] | [INFO] [stdout] 244 | for i in 0..result.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 244 - for i in 0..result.len() { [INFO] [stdout] 244 + for in &mut result { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:284:5 [INFO] [stdout] | [INFO] [stdout] 284 | / pub fn receive_and_send_q( [INFO] [stdout] 285 | | &mut self, [INFO] [stdout] 286 | | rec: &mpsc::Receiver>, [INFO] [stdout] 287 | | send: &Vec>>, [INFO] [stdout] ... | [INFO] [stdout] 292 | | parameters: &mut ((u8, u8, u8), (f32, f32, f32)), [INFO] [stdout] 293 | | ) { [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:433:15 [INFO] [stdout] | [INFO] [stdout] 433 | send: &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] 433 - send: &Vec>>, [INFO] [stdout] 433 + send: &[mpsc::Sender>], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `send` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:438:18 [INFO] [stdout] | [INFO] [stdout] 438 | for i in 0..worker_swarm_size as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 438 - for i in 0..worker_swarm_size as usize { [INFO] [stdout] 438 + for (i, ) in send.iter().enumerate().take(worker_swarm_size as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `result` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:509:22 [INFO] [stdout] | [INFO] [stdout] 509 | for i in 0..result.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 509 - for i in 0..result.len() { [INFO] [stdout] 509 + for in &mut result { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:62:20 [INFO] [stdout] | [INFO] [stdout] 62 | if worker.status == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `worker.status` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `input` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:139:14 [INFO] [stdout] | [INFO] [stdout] 139 | for i in 0..input.len(){ [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 139 - for i in 0..input.len(){ [INFO] [stdout] 139 + for in &input{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:207:20 [INFO] [stdout] | [INFO] [stdout] 207 | if worker.status == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `worker.status` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `result_vec` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:241:26 [INFO] [stdout] | [INFO] [stdout] 241 | for i in 100000..130000{ [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 241 - for i in 100000..130000{ [INFO] [stdout] 241 + for in result_vec.iter().take(130000).skip(100000){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `input` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:300:14 [INFO] [stdout] | [INFO] [stdout] 300 | for i in 0..input.len(){ [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 300 - for i in 0..input.len(){ [INFO] [stdout] 300 + for in &input{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> pc_code/Simulation/src/util.rs:25:11 [INFO] [stdout] | [INFO] [stdout] 25 | send: &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] 25 - send: &Vec>>, [INFO] [stdout] 25 + send: &[mpsc::Sender>], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `c` is used to index `input` [INFO] [stdout] --> pc_code/Simulation/src/util.rs:110:14 [INFO] [stdout] | [INFO] [stdout] 110 | for c in 0..channel { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 110 - for c in 0..channel { [INFO] [stdout] 110 + for (c, ) in input.iter_mut().enumerate().take(channel) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `input` [INFO] [stdout] --> pc_code/Simulation/src/util.rs:111:18 [INFO] [stdout] | [INFO] [stdout] 111 | for i in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 111 - for i in 0..height { [INFO] [stdout] 111 + for (i, ) in input.iter_mut().enumerate().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `input` [INFO] [stdout] --> pc_code/Simulation/src/util.rs:112:22 [INFO] [stdout] | [INFO] [stdout] 112 | for j in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 112 - for j in 0..width { [INFO] [stdout] 112 + for (j, ) in input.iter_mut().enumerate().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is only used to index `arr` [INFO] [stdout] --> pc_code/Simulation/src/util.rs:123:22 [INFO] [stdout] | [INFO] [stdout] 123 | for k in 0..arr[0][0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 123 - for k in 0..arr[0][0].len() { [INFO] [stdout] 123 + for in arr.iter().take(arr[0][0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `Deserialize` and `Serialize` [INFO] [stdout] --> pc_code/Simulation/src/distribution.rs:5:13 [INFO] [stdout] | [INFO] [stdout] 5 | use serde::{Deserialize, Serialize}; [INFO] [stdout] | ^^^^^^^^^^^ ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::fmt::format` [INFO] [stdout] --> pc_code/Simulation/src/distribution.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | use std::fmt::format; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `read` [INFO] [stdout] --> pc_code/Simulation/src/distribution.rs:10:15 [INFO] [stdout] | [INFO] [stdout] 10 | use std::fs::{read, File, OpenOptions}; [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `algo::calculations::batchnorm` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | use algo::calculations::batchnorm; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `OpenOptions` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:5:21 [INFO] [stdout] | [INFO] [stdout] 5 | use std::fs::{File, OpenOptions}; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Add` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:7:16 [INFO] [stdout] | [INFO] [stdout] 7 | use std::ops::{Add, AddAssign}; [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::result` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | use std::result; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::sync::mpsc::RecvError` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | use std::sync::mpsc::RecvError; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Duration` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:12:14 [INFO] [stdout] | [INFO] [stdout] 12 | use chrono::{Duration, TimeDelta}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `generate_test_input` and `test_equal` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:3:58 [INFO] [stdout] | [INFO] [stdout] 3 | decode_coordinator, decode_worker, flatten_3d_array, generate_test_input, test_equal, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `chrono::prelude::*` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | use chrono::prelude::*; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `core::num` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | use core::num; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `BufRead` and `BufReader` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:10:15 [INFO] [stdout] | [INFO] [stdout] 10 | use std::io::{BufRead, BufReader}; [INFO] [stdout] | ^^^^^^^ ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `Arc` and `Mutex` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:11:23 [INFO] [stdout] | [INFO] [stdout] 11 | use std::sync::{mpsc, Arc, Mutex}; [INFO] [stdout] | ^^^ ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Duration` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:14:14 [INFO] [stdout] | [INFO] [stdout] 14 | use chrono::{Duration, TimeDelta}; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `algo::operations::find_which_cpu` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | use algo::operations::find_which_cpu; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `algo::WeightUnit` [INFO] [stdout] --> pc_code/Simulation/src/util.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | use algo::WeightUnit; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::time::Instant` [INFO] [stdout] --> pc_code/Simulation/src/util.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | use std::time::Instant; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `distribute_mapping_weight` [INFO] [stdout] --> pc_code/Simulation/src/main.rs:8:27 [INFO] [stdout] | [INFO] [stdout] 8 | use crate::distribution::{distribute_mapping_weight, distribute_mapping_weight_quant}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `Message`, `Result`, and `Work` [INFO] [stdout] --> pc_code/Simulation/src/main.rs:9:20 [INFO] [stdout] | [INFO] [stdout] 9 | use crate::nodes::{Message, Result, Work}; [INFO] [stdout] | ^^^^^^^ ^^^^^^ ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `c_1_simulation` [INFO] [stdout] --> pc_code/Simulation/src/main.rs:10:34 [INFO] [stdout] | [INFO] [stdout] 10 | use crate::simulation_settings::{c_1_simulation, c_1_simulation_quant}; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `Arc`, `Mutex`, and `mpsc` [INFO] [stdout] --> pc_code/Simulation/src/main.rs:13:17 [INFO] [stdout] | [INFO] [stdout] 13 | use std::sync::{mpsc, Arc, Mutex}; [INFO] [stdout] | ^^^^ ^^^ ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::thread` [INFO] [stdout] --> pc_code/Simulation/src/main.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 14 | use std::thread; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> pc_code/Simulation/src/distribution.rs:50:25 [INFO] [stdout] | [INFO] [stdout] 50 | let mut worker: Worker = Worker { [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: variable does not need to be mutable [INFO] [stdout] --> pc_code/Simulation/src/distribution.rs:66:21 [INFO] [stdout] | [INFO] [stdout] 66 | let mut coordinator = Coordinator { [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] --> pc_code/Simulation/src/distribution.rs:194:25 [INFO] [stdout] | [INFO] [stdout] 194 | let mut worker: Worker = Worker { [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] --> pc_code/Simulation/src/distribution.rs:210:21 [INFO] [stdout] | [INFO] [stdout] 210 | let mut coordinator = Coordinator { [INFO] [stdout] | ----^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `res` [INFO] [stdout] --> pc_code/Simulation/src/distribution.rs:169:10 [INFO] [stdout] | [INFO] [stdout] 169 | let (res, w_scales, w_zeros) = quantize_layers_weights(&layers); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_res` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:75:25 [INFO] [stdout] | [INFO] [stdout] 75 | let mut next_mcus = decode_u128(&self.mapping[i].map[cur_phase]); [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] --> pc_code/Simulation/src/nodes.rs:113:33 [INFO] [stdout] | [INFO] [stdout] 113 | ... let mut next_mcus = decode_u128(&self.mapping[i].map[cur_phase]); [INFO] [stdout] | ----^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `len` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:268:13 [INFO] [stdout] | [INFO] [stdout] 268 | let len = self.inputs.len(); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_len` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:330:25 [INFO] [stdout] | [INFO] [stdout] 330 | let mut next_mcus = decode_u128(&self.mapping[i].map[cur_phase]); [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] --> pc_code/Simulation/src/nodes.rs:381:33 [INFO] [stdout] | [INFO] [stdout] 381 | ... let mut next_mcus = decode_u128(&self.mapping[i].map[cur_phase]); [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] --> pc_code/Simulation/src/nodes.rs:496:9 [INFO] [stdout] | [INFO] [stdout] 496 | mut calculation_duration: &mut TimeDelta, [INFO] [stdout] | ----^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `len` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:533:13 [INFO] [stdout] | [INFO] [stdout] 533 | let len = self.inputs.len(); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_len` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `me` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:110:21 [INFO] [stdout] | [INFO] [stdout] 110 | Err(me) => { [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_me` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `me` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:266:21 [INFO] [stdout] | [INFO] [stdout] 266 | Err(me) => { [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_me` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `distribute_mapping_weight` is never used [INFO] [stdout] --> pc_code/Simulation/src/distribution.rs:13:8 [INFO] [stdout] | [INFO] [stdout] 13 | pub fn distribute_mapping_weight( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `receive_and_send` and `receive_and_terminate` are never used [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:38:12 [INFO] [stdout] | [INFO] [stdout] 37 | impl Coordinator { [INFO] [stdout] | ------------------------- methods in this implementation [INFO] [stdout] 38 | pub fn receive_and_send( [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 175 | pub fn receive_and_terminate( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `receive`, `work`, and `adaptive_pooling` are never used [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:216:12 [INFO] [stdout] | [INFO] [stdout] 215 | impl Worker { [INFO] [stdout] | ---------------------------- methods in this implementation [INFO] [stdout] 216 | pub fn receive(&mut self, rec: &mpsc::Receiver>, id: u8) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 236 | pub fn work( [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 265 | pub fn adaptive_pooling(&mut self) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `preparation_phase` is never used [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:17:8 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn preparation_phase() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `c_1_simulation` is never used [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:20:8 [INFO] [stdout] | [INFO] [stdout] 20 | pub fn c_1_simulation(num_workers: u8, end: usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `generate_test_input` is never used [INFO] [stdout] --> pc_code/Simulation/src/util.rs:108:8 [INFO] [stdout] | [INFO] [stdout] 108 | pub fn generate_test_input(width: usize, height: usize, channel: usize) -> Vec>> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `test_equal` is never used [INFO] [stdout] --> pc_code/Simulation/src/util.rs:131:8 [INFO] [stdout] | [INFO] [stdout] 131 | pub fn test_equal(result_vec: Vec) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> pc_code/Simulation/src/distribution.rs:20:8 [INFO] [stdout] | [INFO] [stdout] 20 | if !fs::metadata(&output_dir).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `fs::metadata(&output_dir).is_err()` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:178:15 [INFO] [stdout] | [INFO] [stdout] 178 | send: &Vec>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 178 - send: &Vec>>, [INFO] [stdout] 178 + send: &[mpsc::Sender>], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `send` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:183:18 [INFO] [stdout] | [INFO] [stdout] 183 | for i in 0..worker_swarm_size as usize { [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] 183 - for i in 0..worker_swarm_size as usize { [INFO] [stdout] 183 + for (i, ) in send.iter().enumerate().take(worker_swarm_size as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `result` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:244:22 [INFO] [stdout] | [INFO] [stdout] 244 | for i in 0..result.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 244 - for i in 0..result.len() { [INFO] [stdout] 244 + for in &mut result { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:284:5 [INFO] [stdout] | [INFO] [stdout] 284 | / pub fn receive_and_send_q( [INFO] [stdout] 285 | | &mut self, [INFO] [stdout] 286 | | rec: &mpsc::Receiver>, [INFO] [stdout] 287 | | send: &Vec>>, [INFO] [stdout] ... | [INFO] [stdout] 292 | | parameters: &mut ((u8, u8, u8), (f32, f32, f32)), [INFO] [stdout] 293 | | ) { [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:433:15 [INFO] [stdout] | [INFO] [stdout] 433 | send: &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] 433 - send: &Vec>>, [INFO] [stdout] 433 + send: &[mpsc::Sender>], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `send` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:438:18 [INFO] [stdout] | [INFO] [stdout] 438 | for i in 0..worker_swarm_size as usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 438 - for i in 0..worker_swarm_size as usize { [INFO] [stdout] 438 + for (i, ) in send.iter().enumerate().take(worker_swarm_size as usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `result` [INFO] [stdout] --> pc_code/Simulation/src/nodes.rs:509:22 [INFO] [stdout] | [INFO] [stdout] 509 | for i in 0..result.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 509 - for i in 0..result.len() { [INFO] [stdout] 509 + for in &mut result { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:62:20 [INFO] [stdout] | [INFO] [stdout] 62 | if worker.status == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `worker.status` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `input` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:139:14 [INFO] [stdout] | [INFO] [stdout] 139 | for i in 0..input.len(){ [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 139 - for i in 0..input.len(){ [INFO] [stdout] 139 + for in &input{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:207:20 [INFO] [stdout] | [INFO] [stdout] 207 | if worker.status == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `worker.status` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `result_vec` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:241:26 [INFO] [stdout] | [INFO] [stdout] 241 | for i in 100000..130000{ [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 241 - for i in 100000..130000{ [INFO] [stdout] 241 + for in result_vec.iter().take(130000).skip(100000){ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `input` [INFO] [stdout] --> pc_code/Simulation/src/simulation_settings.rs:300:14 [INFO] [stdout] | [INFO] [stdout] 300 | for i in 0..input.len(){ [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 300 - for i in 0..input.len(){ [INFO] [stdout] 300 + for in &input{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> pc_code/Simulation/src/util.rs:25:11 [INFO] [stdout] | [INFO] [stdout] 25 | send: &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] 25 - send: &Vec>>, [INFO] [stdout] 25 + send: &[mpsc::Sender>], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `c` is used to index `input` [INFO] [stdout] --> pc_code/Simulation/src/util.rs:110:14 [INFO] [stdout] | [INFO] [stdout] 110 | for c in 0..channel { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 110 - for c in 0..channel { [INFO] [stdout] 110 + for (c, ) in input.iter_mut().enumerate().take(channel) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `input` [INFO] [stdout] --> pc_code/Simulation/src/util.rs:111:18 [INFO] [stdout] | [INFO] [stdout] 111 | for i in 0..height { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 111 - for i in 0..height { [INFO] [stdout] 111 + for (i, ) in input.iter_mut().enumerate().take(height) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `input` [INFO] [stdout] --> pc_code/Simulation/src/util.rs:112:22 [INFO] [stdout] | [INFO] [stdout] 112 | for j in 0..width { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 112 - for j in 0..width { [INFO] [stdout] 112 + for (j, ) in input.iter_mut().enumerate().take(width) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `k` is only used to index `arr` [INFO] [stdout] --> pc_code/Simulation/src/util.rs:123:22 [INFO] [stdout] | [INFO] [stdout] 123 | for k in 0..arr[0][0].len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 123 - for k in 0..arr[0][0].len() { [INFO] [stdout] 123 + for in arr.iter().take(arr[0][0].len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [optimized + debuginfo] target(s) in 17.85s [INFO] running `Command { std: "docker" "inspect" "c05d24300f88acb71df366fabdf552b77b3895524a1ccd0d9cbe4fc07e08cc9c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c05d24300f88acb71df366fabdf552b77b3895524a1ccd0d9cbe4fc07e08cc9c", kill_on_drop: false }` [INFO] [stdout] c05d24300f88acb71df366fabdf552b77b3895524a1ccd0d9cbe4fc07e08cc9c