[INFO] cloning repository https://github.com/zarq/qr-code-generator [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/zarq/qr-code-generator" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fzarq%2Fqr-code-generator", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fzarq%2Fqr-code-generator'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] de35053208f0ccce0444c762a56f843a3ccb979a [INFO] linting zarq/qr-code-generator against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fzarq%2Fqr-code-generator" "/workspace/builds/worker-3-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-3-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/zarq/qr-code-generator [INFO] finished tweaking git repo https://github.com/zarq/qr-code-generator [INFO] tweaked toml for git repo https://github.com/zarq/qr-code-generator written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/zarq/qr-code-generator 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/zarq/qr-code-generator 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] Updating crates.io index [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded reed-solomon v0.2.1 [INFO] [stderr] Downloaded gif v0.13.3 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] 1a99b50b33db748c16fea79cc1b028f7eef3fdf4d769aa1824f1d86c76c7d52f [INFO] running `Command { std: "docker" "start" "-a" "1a99b50b33db748c16fea79cc1b028f7eef3fdf4d769aa1824f1d86c76c7d52f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "1a99b50b33db748c16fea79cc1b028f7eef3fdf4d769aa1824f1d86c76c7d52f", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "1a99b50b33db748c16fea79cc1b028f7eef3fdf4d769aa1824f1d86c76c7d52f", kill_on_drop: false }` [INFO] [stdout] 1a99b50b33db748c16fea79cc1b028f7eef3fdf4d769aa1824f1d86c76c7d52f [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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] 33c26f0c27228292c511fddbd0341a11f98ca20a0ad2abd65ea444ae200093d1 [INFO] running `Command { std: "docker" "start" "-a" "33c26f0c27228292c511fddbd0341a11f98ca20a0ad2abd65ea444ae200093d1", kill_on_drop: false }` [INFO] [stderr] Checking cfg-if v1.0.3 [INFO] [stderr] Compiling proc-macro2 v1.0.101 [INFO] [stderr] Compiling libc v0.2.175 [INFO] [stderr] Compiling crc32fast v1.5.0 [INFO] [stderr] Compiling unicode-ident v1.0.19 [INFO] [stderr] Checking miniz_oxide v0.8.9 [INFO] [stderr] Checking either v1.15.0 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Checking weezl v0.1.10 [INFO] [stderr] Compiling serde v1.0.219 [INFO] [stderr] Checking rayon v1.11.0 [INFO] [stderr] Checking half v2.6.0 [INFO] [stderr] Checking zune-inflate v0.2.54 [INFO] [stderr] Checking bit_field v0.10.3 [INFO] [stderr] Checking lebe v0.5.3 [INFO] [stderr] Compiling serde_json v1.0.143 [INFO] [stderr] Checking bytemuck v1.23.2 [INFO] [stderr] Checking gif v0.13.3 [INFO] [stderr] Checking memchr v2.7.5 [INFO] [stderr] Checking flate2 v1.1.2 [INFO] [stderr] Compiling quote v1.0.40 [INFO] [stderr] Checking qoi v0.4.1 [INFO] [stderr] Compiling syn v2.0.106 [INFO] [stderr] Checking png v0.17.16 [INFO] [stderr] Checking exr v1.73.0 [INFO] [stderr] Checking getrandom v0.2.16 [INFO] [stderr] Compiling qr-tools v0.2.0 (/opt/rustwide/workdir) [INFO] [stderr] Checking reed-solomon v0.2.1 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking jpeg-decoder v0.3.2 [INFO] [stderr] Checking tiff v0.9.1 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Checking image v0.24.9 [INFO] [stdout] warning: function `is_function_module` is never used [INFO] [stdout] --> src/generator.rs:244:4 [INFO] [stdout] | [INFO] [stdout] 244 | fn is_function_module(x: usize, y: usize, size: usize, version: Version) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual arithmetic check found [INFO] [stdout] --> src/pixel_mapping.rs:39:15 [INFO] [stdout] | [INFO] [stdout] 39 | col = if col >= 2 { col - 2 } else { 0 }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `col.saturating_sub(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] = note: `#[warn(clippy::implicit_saturating_sub)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/pixel_mapping.rs:48:8 [INFO] [stdout] | [INFO] [stdout] 48 | if (row < 9 && col < 9) || [INFO] [stdout] | ________^ [INFO] [stdout] 49 | | (row < 9 && col >= size - 8) || [INFO] [stdout] | |___________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 48 - if (row < 9 && col < 9) || [INFO] [stdout] 49 - (row < 9 && col >= size - 8) || [INFO] [stdout] 48 + if !(row >= 9 || col >= 9 && col < size - 8) || [INFO] [stdout] | [INFO] [stdout] 48 - if (row < 9 && col < 9) || [INFO] [stdout] 49 - (row < 9 && col >= size - 8) || [INFO] [stdout] 48 + if (col >= size - 8 || col < 9) && row < 9 || [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/pixel_mapping.rs:78:16 [INFO] [stdout] | [INFO] [stdout] 78 | if (center_x <= 8 && center_y <= 8) || [INFO] [stdout] | ________________^ [INFO] [stdout] 79 | | (center_x <= 8 && center_y >= size - 9) || [INFO] [stdout] | |______________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 78 - if (center_x <= 8 && center_y <= 8) || [INFO] [stdout] 79 - (center_x <= 8 && center_y >= size - 9) || [INFO] [stdout] 78 + if !(center_x > 8 || center_y > 8 && center_y < size - 9) || [INFO] [stdout] | [INFO] [stdout] 78 - if (center_x <= 8 && center_y <= 8) || [INFO] [stdout] 79 - (center_x <= 8 && center_y >= size - 9) || [INFO] [stdout] 78 + if (center_y >= size - 9 || center_y <= 8) && center_x <= 8 || [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/alignment.rs:57:16 [INFO] [stdout] | [INFO] [stdout] 57 | if (center_x <= 8 && center_y <= 8) || [INFO] [stdout] | ________________^ [INFO] [stdout] 58 | | (center_x <= 8 && center_y >= version.size() - 9) || [INFO] [stdout] | |________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 57 - if (center_x <= 8 && center_y <= 8) || [INFO] [stdout] 58 - (center_x <= 8 && center_y >= version.size() - 9) || [INFO] [stdout] 57 + if !(center_x > 8 || center_y > 8 && center_y < version.size() - 9) || [INFO] [stdout] | [INFO] [stdout] 57 - if (center_x <= 8 && center_y <= 8) || [INFO] [stdout] 58 - (center_x <= 8 && center_y >= version.size() - 9) || [INFO] [stdout] 57 + if (center_y >= version.size() - 9 || center_y <= 8) && center_x <= 8 || [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mask.rs:16:27 [INFO] [stdout] | [INFO] [stdout] 16 | fn apply_pattern0(matrix: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 16 - fn apply_pattern0(matrix: &mut Vec>) { [INFO] [stdout] 16 + fn apply_pattern0(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:18:14 [INFO] [stdout] | [INFO] [stdout] 18 | for y in 0..size { [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] 18 - for y in 0..size { [INFO] [stdout] 18 + for (y, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:19:18 [INFO] [stdout] | [INFO] [stdout] 19 | for x in 0..size { [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] 19 - for x in 0..size { [INFO] [stdout] 19 + for (x, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mask.rs:27:27 [INFO] [stdout] | [INFO] [stdout] 27 | fn apply_pattern1(matrix: &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] 27 - fn apply_pattern1(matrix: &mut Vec>) { [INFO] [stdout] 27 + fn apply_pattern1(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:29:14 [INFO] [stdout] | [INFO] [stdout] 29 | for y in 0..size { [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] 29 - for y in 0..size { [INFO] [stdout] 29 + for (y, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `matrix` [INFO] [stdout] --> src/mask.rs:30:18 [INFO] [stdout] | [INFO] [stdout] 30 | for x in 0..size { [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] 30 - for x in 0..size { [INFO] [stdout] 30 + for in matrix.iter_mut().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mask.rs:38:27 [INFO] [stdout] | [INFO] [stdout] 38 | fn apply_pattern2(matrix: &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] 38 - fn apply_pattern2(matrix: &mut Vec>) { [INFO] [stdout] 38 + fn apply_pattern2(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `matrix` [INFO] [stdout] --> src/mask.rs:40:14 [INFO] [stdout] | [INFO] [stdout] 40 | for y in 0..size { [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] 40 - for y in 0..size { [INFO] [stdout] 40 + for in matrix.iter_mut().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:41:18 [INFO] [stdout] | [INFO] [stdout] 41 | for x in 0..size { [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] 41 - for x in 0..size { [INFO] [stdout] 41 + for (x, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mask.rs:49:27 [INFO] [stdout] | [INFO] [stdout] 49 | fn apply_pattern3(matrix: &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] 49 - fn apply_pattern3(matrix: &mut Vec>) { [INFO] [stdout] 49 + fn apply_pattern3(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:51:14 [INFO] [stdout] | [INFO] [stdout] 51 | for y in 0..size { [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 y in 0..size { [INFO] [stdout] 51 + for (y, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:52:18 [INFO] [stdout] | [INFO] [stdout] 52 | for x in 0..size { [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] 52 - for x in 0..size { [INFO] [stdout] 52 + for (x, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mask.rs:60:27 [INFO] [stdout] | [INFO] [stdout] 60 | fn apply_pattern4(matrix: &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] 60 - fn apply_pattern4(matrix: &mut Vec>) { [INFO] [stdout] 60 + fn apply_pattern4(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:62:14 [INFO] [stdout] | [INFO] [stdout] 62 | for y in 0..size { [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] 62 - for y in 0..size { [INFO] [stdout] 62 + for (y, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:63:18 [INFO] [stdout] | [INFO] [stdout] 63 | for x in 0..size { [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] 63 - for x in 0..size { [INFO] [stdout] 63 + for (x, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mask.rs:71:27 [INFO] [stdout] | [INFO] [stdout] 71 | fn apply_pattern5(matrix: &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] 71 - fn apply_pattern5(matrix: &mut Vec>) { [INFO] [stdout] 71 + fn apply_pattern5(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:73:14 [INFO] [stdout] | [INFO] [stdout] 73 | for y in 0..size { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 73 - for y in 0..size { [INFO] [stdout] 73 + for (y, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:74:18 [INFO] [stdout] | [INFO] [stdout] 74 | for x in 0..size { [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] 74 - for x in 0..size { [INFO] [stdout] 74 + for (x, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mask.rs:82:27 [INFO] [stdout] | [INFO] [stdout] 82 | fn apply_pattern6(matrix: &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] 82 - fn apply_pattern6(matrix: &mut Vec>) { [INFO] [stdout] 82 + fn apply_pattern6(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:84:14 [INFO] [stdout] | [INFO] [stdout] 84 | for y in 0..size { [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] 84 - for y in 0..size { [INFO] [stdout] 84 + for (y, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:85:18 [INFO] [stdout] | [INFO] [stdout] 85 | for x in 0..size { [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] 85 - for x in 0..size { [INFO] [stdout] 85 + for (x, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mask.rs:93:27 [INFO] [stdout] | [INFO] [stdout] 93 | fn apply_pattern7(matrix: &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] 93 - fn apply_pattern7(matrix: &mut Vec>) { [INFO] [stdout] 93 + fn apply_pattern7(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:95:14 [INFO] [stdout] | [INFO] [stdout] 95 | for y in 0..size { [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] 95 - for y in 0..size { [INFO] [stdout] 95 + for (y, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:96:18 [INFO] [stdout] | [INFO] [stdout] 96 | for x in 0..size { [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] 96 - for x in 0..size { [INFO] [stdout] 96 + for (x, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/mask.rs:104:1 [INFO] [stdout] | [INFO] [stdout] 104 | / impl Default for MaskPattern { [INFO] [stdout] 105 | | fn default() -> Self { [INFO] [stdout] 106 | | MaskPattern::Pattern0 [INFO] [stdout] 107 | | } [INFO] [stdout] 108 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/encoding.rs:36:11 [INFO] [stdout] | [INFO] [stdout] 36 | while data_bits.len() % 8 != 0 && data_bits.len() < data_capacity_bits { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!data_bits.len().is_multiple_of(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> src/encoding.rs:111:23 [INFO] [stdout] | [INFO] [stdout] 111 | bits.push(((byte >> i) & 1) as u8); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(((byte >> i) & 1))` [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: the method `correct` doesn't need a mutable reference [INFO] [stdout] --> src/ecc.rs:33:27 [INFO] [stdout] | [INFO] [stdout] 33 | match decoder.correct(&mut buffer, None) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 33 - match decoder.correct(&mut buffer, None) { [INFO] [stdout] 33 + match decoder.correct(&buffer, None) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator.rs:17:59 [INFO] [stdout] | [INFO] [stdout] 17 | ... {}", hex::encode(&bits_to_bytes(&encoded.data_bits)).chars().collect::>().chunks(2).map(|chunk| chunk.iter().collect:: src/generator.rs:18:52 [INFO] [stdout] | [INFO] [stdout] 18 | ...: {}", hex::encode(&bits_to_bytes(&encoded.ecc_bits)).chars().collect::>().chunks(2).map(|chunk| chunk.iter().collect:: src/generator.rs:73:33 [INFO] [stdout] | [INFO] [stdout] 73 | fn add_position_pattern(matrix: &mut Vec>, x: usize, y: usize) { [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] 73 - fn add_position_pattern(matrix: &mut Vec>, x: usize, y: usize) { [INFO] [stdout] 73 + fn add_position_pattern(matrix: &mut [Vec], x: usize, y: usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/generator.rs:121:34 [INFO] [stdout] | [INFO] [stdout] 121 | fn add_alignment_pattern(matrix: &mut Vec>, x: usize, y: usize) { [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] 121 - fn add_alignment_pattern(matrix: &mut Vec>, x: usize, y: usize) { [INFO] [stdout] 121 + fn add_alignment_pattern(matrix: &mut [Vec], x: usize, y: usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/generator.rs:129:32 [INFO] [stdout] | [INFO] [stdout] 129 | fn add_timing_patterns(matrix: &mut Vec>, size: usize) { [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] 129 - fn add_timing_patterns(matrix: &mut Vec>, size: usize) { [INFO] [stdout] 129 + fn add_timing_patterns(matrix: &mut [Vec], size: usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `matrix` [INFO] [stdout] --> src/generator.rs:130:14 [INFO] [stdout] | [INFO] [stdout] 130 | for i in 8..size-8 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 130 - for i in 8..size-8 { [INFO] [stdout] 130 + for (i, ) in matrix.iter_mut().enumerate().take(size-8).skip(8) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/generator.rs:173:28 [INFO] [stdout] | [INFO] [stdout] 173 | fn add_format_info(matrix: &mut Vec>, error_correction: ErrorCorrection, mask_pattern: MaskPattern) { [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] 173 - fn add_format_info(matrix: &mut Vec>, error_correction: ErrorCorrection, mask_pattern: MaskPattern) { [INFO] [stdout] 173 + fn add_format_info(matrix: &mut [Vec], error_correction: ErrorCorrection, mask_pattern: MaskPattern) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `matrix` [INFO] [stdout] --> src/generator.rs:179:14 [INFO] [stdout] | [INFO] [stdout] 179 | for i in 0..6 { [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 i in 0..6 { [INFO] [stdout] 179 + for (i, ) in matrix.iter_mut().enumerate().take(6) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `is_function_module` is never used [INFO] [stdout] --> src/generator.rs:244:4 [INFO] [stdout] | [INFO] [stdout] 244 | fn is_function_module(x: usize, y: usize, size: usize, version: Version) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/generator.rs:205:28 [INFO] [stdout] | [INFO] [stdout] 205 | fn place_data_bits(matrix: &mut Vec>, encoded: &EncodedData, version: Version) { [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] 205 - fn place_data_bits(matrix: &mut Vec>, encoded: &EncodedData, version: Version) { [INFO] [stdout] 205 + fn place_data_bits(matrix: &mut [Vec], encoded: &EncodedData, version: Version) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/generator.rs:246:8 [INFO] [stdout] | [INFO] [stdout] 246 | if (x < 9 && y < 9) || (x >= size - 8 && y < 9) || (x < 9 && y >= size - 8) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 246 - if (x < 9 && y < 9) || (x >= size - 8 && y < 9) || (x < 9 && y >= size - 8) { [INFO] [stdout] 246 + if !(y >= 9 || x >= 9 && x < size - 8) || (x < 9 && y >= size - 8) { [INFO] [stdout] | [INFO] [stdout] 246 - if (x < 9 && y < 9) || (x >= size - 8 && y < 9) || (x < 9 && y >= size - 8) { [INFO] [stdout] 246 + if (x >= size - 8 || x < 9) && y < 9 || (x < 9 && y >= size - 8) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/generator.rs:261:5 [INFO] [stdout] | [INFO] [stdout] 261 | / if version >= Version::V7 { [INFO] [stdout] 262 | | if (x < 6 && y >= size - 11) || (y < 6 && x >= size - 11) { [INFO] [stdout] 263 | | return true; [INFO] [stdout] 264 | | } [INFO] [stdout] 265 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 261 ~ if version >= Version::V7 [INFO] [stdout] 262 ~ && ((x < 6 && y >= size - 11) || (y < 6 && x >= size - 11)) { [INFO] [stdout] 263 | return true; [INFO] [stdout] 264 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/generator.rs:296:29 [INFO] [stdout] | [INFO] [stdout] 296 | fn add_version_info(matrix: &mut Vec>, version: Version) { [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] 296 - fn add_version_info(matrix: &mut Vec>, version: Version) { [INFO] [stdout] 296 + fn add_version_info(matrix: &mut [Vec], version: Version) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/generator.rs:313:18 [INFO] [stdout] | [INFO] [stdout] 313 | if !((x < 9 && y < 9) || (x >= matrix.len() - 8 && y < 9) || (x < 9 && y >= matrix.len() - 8)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 313 - if !((x < 9 && y < 9) || (x >= matrix.len() - 8 && y < 9) || (x < 9 && y >= matrix.len() - 8)) { [INFO] [stdout] 313 + if !(!(y >= 9 || x >= 9 && x < matrix.len() - 8) || (x < 9 && y >= matrix.len() - 8)) { [INFO] [stdout] | [INFO] [stdout] 313 - if !((x < 9 && y < 9) || (x >= matrix.len() - 8 && y < 9) || (x < 9 && y >= matrix.len() - 8)) { [INFO] [stdout] 313 + if !((x >= matrix.len() - 8 || x < 9) && y < 9 || (x < 9 && y >= matrix.len() - 8)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/generator.rs:320:28 [INFO] [stdout] | [INFO] [stdout] 320 | fn add_dark_module(matrix: &mut Vec>, version: Version) { [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] 320 - fn add_dark_module(matrix: &mut Vec>, version: Version) { [INFO] [stdout] 320 + fn add_dark_module(matrix: &mut [Vec], version: Version) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual arithmetic check found [INFO] [stdout] --> src/pixel_mapping.rs:39:15 [INFO] [stdout] | [INFO] [stdout] 39 | col = if col >= 2 { col - 2 } else { 0 }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `col.saturating_sub(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] = note: `#[warn(clippy::implicit_saturating_sub)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/pixel_mapping.rs:48:8 [INFO] [stdout] | [INFO] [stdout] 48 | if (row < 9 && col < 9) || [INFO] [stdout] | ________^ [INFO] [stdout] 49 | | (row < 9 && col >= size - 8) || [INFO] [stdout] | |___________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 48 - if (row < 9 && col < 9) || [INFO] [stdout] 49 - (row < 9 && col >= size - 8) || [INFO] [stdout] 48 + if !(row >= 9 || col >= 9 && col < size - 8) || [INFO] [stdout] | [INFO] [stdout] 48 - if (row < 9 && col < 9) || [INFO] [stdout] 49 - (row < 9 && col >= size - 8) || [INFO] [stdout] 48 + if (col >= size - 8 || col < 9) && row < 9 || [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/pixel_mapping.rs:78:16 [INFO] [stdout] | [INFO] [stdout] 78 | if (center_x <= 8 && center_y <= 8) || [INFO] [stdout] | ________________^ [INFO] [stdout] 79 | | (center_x <= 8 && center_y >= size - 9) || [INFO] [stdout] | |______________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 78 - if (center_x <= 8 && center_y <= 8) || [INFO] [stdout] 79 - (center_x <= 8 && center_y >= size - 9) || [INFO] [stdout] 78 + if !(center_x > 8 || center_y > 8 && center_y < size - 9) || [INFO] [stdout] | [INFO] [stdout] 78 - if (center_x <= 8 && center_y <= 8) || [INFO] [stdout] 79 - (center_x <= 8 && center_y >= size - 9) || [INFO] [stdout] 78 + if (center_y >= size - 9 || center_y <= 8) && center_x <= 8 || [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/alignment.rs:57:16 [INFO] [stdout] | [INFO] [stdout] 57 | if (center_x <= 8 && center_y <= 8) || [INFO] [stdout] | ________________^ [INFO] [stdout] 58 | | (center_x <= 8 && center_y >= version.size() - 9) || [INFO] [stdout] | |________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 57 - if (center_x <= 8 && center_y <= 8) || [INFO] [stdout] 58 - (center_x <= 8 && center_y >= version.size() - 9) || [INFO] [stdout] 57 + if !(center_x > 8 || center_y > 8 && center_y < version.size() - 9) || [INFO] [stdout] | [INFO] [stdout] 57 - if (center_x <= 8 && center_y <= 8) || [INFO] [stdout] 58 - (center_x <= 8 && center_y >= version.size() - 9) || [INFO] [stdout] 57 + if (center_y >= version.size() - 9 || center_y <= 8) && center_x <= 8 || [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mask.rs:16:27 [INFO] [stdout] | [INFO] [stdout] 16 | fn apply_pattern0(matrix: &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] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 16 - fn apply_pattern0(matrix: &mut Vec>) { [INFO] [stdout] 16 + fn apply_pattern0(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:18:14 [INFO] [stdout] | [INFO] [stdout] 18 | for y in 0..size { [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] 18 - for y in 0..size { [INFO] [stdout] 18 + for (y, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:19:18 [INFO] [stdout] | [INFO] [stdout] 19 | for x in 0..size { [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] 19 - for x in 0..size { [INFO] [stdout] 19 + for (x, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mask.rs:27:27 [INFO] [stdout] | [INFO] [stdout] 27 | fn apply_pattern1(matrix: &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] 27 - fn apply_pattern1(matrix: &mut Vec>) { [INFO] [stdout] 27 + fn apply_pattern1(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:29:14 [INFO] [stdout] | [INFO] [stdout] 29 | for y in 0..size { [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] 29 - for y in 0..size { [INFO] [stdout] 29 + for (y, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is only used to index `matrix` [INFO] [stdout] --> src/mask.rs:30:18 [INFO] [stdout] | [INFO] [stdout] 30 | for x in 0..size { [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] 30 - for x in 0..size { [INFO] [stdout] 30 + for in matrix.iter_mut().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mask.rs:38:27 [INFO] [stdout] | [INFO] [stdout] 38 | fn apply_pattern2(matrix: &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] 38 - fn apply_pattern2(matrix: &mut Vec>) { [INFO] [stdout] 38 + fn apply_pattern2(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is only used to index `matrix` [INFO] [stdout] --> src/mask.rs:40:14 [INFO] [stdout] | [INFO] [stdout] 40 | for y in 0..size { [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] 40 - for y in 0..size { [INFO] [stdout] 40 + for in matrix.iter_mut().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:41:18 [INFO] [stdout] | [INFO] [stdout] 41 | for x in 0..size { [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] 41 - for x in 0..size { [INFO] [stdout] 41 + for (x, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mask.rs:49:27 [INFO] [stdout] | [INFO] [stdout] 49 | fn apply_pattern3(matrix: &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] 49 - fn apply_pattern3(matrix: &mut Vec>) { [INFO] [stdout] 49 + fn apply_pattern3(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:51:14 [INFO] [stdout] | [INFO] [stdout] 51 | for y in 0..size { [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 y in 0..size { [INFO] [stdout] 51 + for (y, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:52:18 [INFO] [stdout] | [INFO] [stdout] 52 | for x in 0..size { [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] 52 - for x in 0..size { [INFO] [stdout] 52 + for (x, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mask.rs:60:27 [INFO] [stdout] | [INFO] [stdout] 60 | fn apply_pattern4(matrix: &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] 60 - fn apply_pattern4(matrix: &mut Vec>) { [INFO] [stdout] 60 + fn apply_pattern4(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:62:14 [INFO] [stdout] | [INFO] [stdout] 62 | for y in 0..size { [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] 62 - for y in 0..size { [INFO] [stdout] 62 + for (y, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:63:18 [INFO] [stdout] | [INFO] [stdout] 63 | for x in 0..size { [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] 63 - for x in 0..size { [INFO] [stdout] 63 + for (x, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mask.rs:71:27 [INFO] [stdout] | [INFO] [stdout] 71 | fn apply_pattern5(matrix: &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] 71 - fn apply_pattern5(matrix: &mut Vec>) { [INFO] [stdout] 71 + fn apply_pattern5(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:73:14 [INFO] [stdout] | [INFO] [stdout] 73 | for y in 0..size { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 73 - for y in 0..size { [INFO] [stdout] 73 + for (y, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:74:18 [INFO] [stdout] | [INFO] [stdout] 74 | for x in 0..size { [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] 74 - for x in 0..size { [INFO] [stdout] 74 + for (x, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mask.rs:82:27 [INFO] [stdout] | [INFO] [stdout] 82 | fn apply_pattern6(matrix: &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] 82 - fn apply_pattern6(matrix: &mut Vec>) { [INFO] [stdout] 82 + fn apply_pattern6(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:84:14 [INFO] [stdout] | [INFO] [stdout] 84 | for y in 0..size { [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] 84 - for y in 0..size { [INFO] [stdout] 84 + for (y, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:85:18 [INFO] [stdout] | [INFO] [stdout] 85 | for x in 0..size { [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] 85 - for x in 0..size { [INFO] [stdout] 85 + for (x, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/mask.rs:93:27 [INFO] [stdout] | [INFO] [stdout] 93 | fn apply_pattern7(matrix: &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] 93 - fn apply_pattern7(matrix: &mut Vec>) { [INFO] [stdout] 93 + fn apply_pattern7(matrix: &mut [Vec]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:95:14 [INFO] [stdout] | [INFO] [stdout] 95 | for y in 0..size { [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] 95 - for y in 0..size { [INFO] [stdout] 95 + for (y, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `matrix` [INFO] [stdout] --> src/mask.rs:96:18 [INFO] [stdout] | [INFO] [stdout] 96 | for x in 0..size { [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] 96 - for x in 0..size { [INFO] [stdout] 96 + for (x, ) in matrix.iter_mut().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/mask.rs:104:1 [INFO] [stdout] | [INFO] [stdout] 104 | / impl Default for MaskPattern { [INFO] [stdout] 105 | | fn default() -> Self { [INFO] [stdout] 106 | | MaskPattern::Pattern0 [INFO] [stdout] 107 | | } [INFO] [stdout] 108 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/encoding.rs:36:11 [INFO] [stdout] | [INFO] [stdout] 36 | while data_bits.len() % 8 != 0 && data_bits.len() < data_capacity_bits { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!data_bits.len().is_multiple_of(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> src/encoding.rs:111:23 [INFO] [stdout] | [INFO] [stdout] 111 | bits.push(((byte >> i) & 1) as u8); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(((byte >> i) & 1))` [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: the method `correct` doesn't need a mutable reference [INFO] [stdout] --> src/ecc.rs:33:27 [INFO] [stdout] | [INFO] [stdout] 33 | match decoder.correct(&mut buffer, None) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 33 - match decoder.correct(&mut buffer, None) { [INFO] [stdout] 33 + match decoder.correct(&buffer, None) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/bin/qr-analyzer.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | use image; [INFO] [stdout] | ^^^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] = note: `#[warn(clippy::single_component_path_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/qr-generator.rs:6:26 [INFO] [stdout] | [INFO] [stdout] 6 | fn matrix_to_svg(matrix: &Vec>, filename: &str) -> Result<(), Box> { [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] 6 - fn matrix_to_svg(matrix: &Vec>, filename: &str) -> Result<(), Box> { [INFO] [stdout] 6 + fn matrix_to_svg(matrix: &[Vec], filename: &str) -> Result<(), Box> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/qr-generator.rs:44:26 [INFO] [stdout] | [INFO] [stdout] 44 | fn matrix_to_png(matrix: &Vec>, filename: &str, scale: usize) -> Result<(), Box> { [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] 44 - fn matrix_to_png(matrix: &Vec>, filename: &str, scale: usize) -> Result<(), Box> { [INFO] [stdout] 44 + fn matrix_to_png(matrix: &[Vec], filename: &str, scale: usize) -> Result<(), Box> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/generator.rs:17:59 [INFO] [stdout] | [INFO] [stdout] 17 | ... {}", hex::encode(&bits_to_bytes(&encoded.data_bits)).chars().collect::>().chunks(2).map(|chunk| chunk.iter().collect:: src/generator.rs:18:52 [INFO] [stdout] | [INFO] [stdout] 18 | ...: {}", hex::encode(&bits_to_bytes(&encoded.ecc_bits)).chars().collect::>().chunks(2).map(|chunk| chunk.iter().collect:: src/generator.rs:73:33 [INFO] [stdout] | [INFO] [stdout] 73 | fn add_position_pattern(matrix: &mut Vec>, x: usize, y: usize) { [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] 73 - fn add_position_pattern(matrix: &mut Vec>, x: usize, y: usize) { [INFO] [stdout] 73 + fn add_position_pattern(matrix: &mut [Vec], x: usize, y: usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/generator.rs:121:34 [INFO] [stdout] | [INFO] [stdout] 121 | fn add_alignment_pattern(matrix: &mut Vec>, x: usize, y: usize) { [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] 121 - fn add_alignment_pattern(matrix: &mut Vec>, x: usize, y: usize) { [INFO] [stdout] 121 + fn add_alignment_pattern(matrix: &mut [Vec], x: usize, y: usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/generator.rs:129:32 [INFO] [stdout] | [INFO] [stdout] 129 | fn add_timing_patterns(matrix: &mut Vec>, size: usize) { [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] 129 - fn add_timing_patterns(matrix: &mut Vec>, size: usize) { [INFO] [stdout] 129 + fn add_timing_patterns(matrix: &mut [Vec], size: usize) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `matrix` [INFO] [stdout] --> src/generator.rs:130:14 [INFO] [stdout] | [INFO] [stdout] 130 | for i in 8..size-8 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 130 - for i in 8..size-8 { [INFO] [stdout] 130 + for (i, ) in matrix.iter_mut().enumerate().take(size-8).skip(8) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/generator.rs:173:28 [INFO] [stdout] | [INFO] [stdout] 173 | fn add_format_info(matrix: &mut Vec>, error_correction: ErrorCorrection, mask_pattern: MaskPattern) { [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] 173 - fn add_format_info(matrix: &mut Vec>, error_correction: ErrorCorrection, mask_pattern: MaskPattern) { [INFO] [stdout] 173 + fn add_format_info(matrix: &mut [Vec], error_correction: ErrorCorrection, mask_pattern: MaskPattern) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `matrix` [INFO] [stdout] --> src/generator.rs:179:14 [INFO] [stdout] | [INFO] [stdout] 179 | for i in 0..6 { [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 i in 0..6 { [INFO] [stdout] 179 + for (i, ) in matrix.iter_mut().enumerate().take(6) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/bin/qr-noise.rs:44:34 [INFO] [stdout] | [INFO] [stdout] 44 | Ok(p) if p >= 0.0 && p <= 100.0 => percentage = p, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0.0..=100.0).contains(&p)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/generator.rs:205:28 [INFO] [stdout] | [INFO] [stdout] 205 | fn place_data_bits(matrix: &mut Vec>, encoded: &EncodedData, version: Version) { [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] 205 - fn place_data_bits(matrix: &mut Vec>, encoded: &EncodedData, version: Version) { [INFO] [stdout] 205 + fn place_data_bits(matrix: &mut [Vec], encoded: &EncodedData, version: Version) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/generator.rs:246:8 [INFO] [stdout] | [INFO] [stdout] 246 | if (x < 9 && y < 9) || (x >= size - 8 && y < 9) || (x < 9 && y >= size - 8) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 246 - if (x < 9 && y < 9) || (x >= size - 8 && y < 9) || (x < 9 && y >= size - 8) { [INFO] [stdout] 246 + if !(y >= 9 || x >= 9 && x < size - 8) || (x < 9 && y >= size - 8) { [INFO] [stdout] | [INFO] [stdout] 246 - if (x < 9 && y < 9) || (x >= size - 8 && y < 9) || (x < 9 && y >= size - 8) { [INFO] [stdout] 246 + if (x >= size - 8 || x < 9) && y < 9 || (x < 9 && y >= size - 8) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/generator.rs:261:5 [INFO] [stdout] | [INFO] [stdout] 261 | / if version >= Version::V7 { [INFO] [stdout] 262 | | if (x < 6 && y >= size - 11) || (y < 6 && x >= size - 11) { [INFO] [stdout] 263 | | return true; [INFO] [stdout] 264 | | } [INFO] [stdout] 265 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 261 ~ if version >= Version::V7 [INFO] [stdout] 262 ~ && ((x < 6 && y >= size - 11) || (y < 6 && x >= size - 11)) { [INFO] [stdout] 263 | return true; [INFO] [stdout] 264 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/generator.rs:296:29 [INFO] [stdout] | [INFO] [stdout] 296 | fn add_version_info(matrix: &mut Vec>, version: Version) { [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] 296 - fn add_version_info(matrix: &mut Vec>, version: Version) { [INFO] [stdout] 296 + fn add_version_info(matrix: &mut [Vec], version: Version) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/generator.rs:313:18 [INFO] [stdout] | [INFO] [stdout] 313 | if !((x < 9 && y < 9) || (x >= matrix.len() - 8 && y < 9) || (x < 9 && y >= matrix.len() - 8)) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 313 - if !((x < 9 && y < 9) || (x >= matrix.len() - 8 && y < 9) || (x < 9 && y >= matrix.len() - 8)) { [INFO] [stdout] 313 + if !(!(y >= 9 || x >= 9 && x < matrix.len() - 8) || (x < 9 && y >= matrix.len() - 8)) { [INFO] [stdout] | [INFO] [stdout] 313 - if !((x < 9 && y < 9) || (x >= matrix.len() - 8 && y < 9) || (x < 9 && y >= matrix.len() - 8)) { [INFO] [stdout] 313 + if !((x >= matrix.len() - 8 || x < 9) && y < 9 || (x < 9 && y >= matrix.len() - 8)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do [INFO] [stdout] --> src/generator.rs:320:28 [INFO] [stdout] | [INFO] [stdout] 320 | fn add_dark_module(matrix: &mut Vec>, version: Version) { [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] 320 - fn add_dark_module(matrix: &mut Vec>, version: Version) { [INFO] [stdout] 320 + fn add_dark_module(matrix: &mut [Vec], version: Version) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this import is redundant [INFO] [stdout] --> src/bin/qr-analyzer.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | use image; [INFO] [stdout] | ^^^^^^^^^^ help: remove it entirely [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_component_path_imports [INFO] [stdout] = note: `#[warn(clippy::single_component_path_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/bin/qr-noise.rs:44:34 [INFO] [stdout] | [INFO] [stdout] 44 | Ok(p) if p >= 0.0 && p <= 100.0 => percentage = p, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0.0..=100.0).contains(&p)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/qr-generator.rs:6:26 [INFO] [stdout] | [INFO] [stdout] 6 | fn matrix_to_svg(matrix: &Vec>, filename: &str) -> Result<(), Box> { [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] 6 - fn matrix_to_svg(matrix: &Vec>, filename: &str) -> Result<(), Box> { [INFO] [stdout] 6 + fn matrix_to_svg(matrix: &[Vec], filename: &str) -> Result<(), Box> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/bin/qr-generator.rs:44:26 [INFO] [stdout] | [INFO] [stdout] 44 | fn matrix_to_png(matrix: &Vec>, filename: &str, scale: usize) -> Result<(), Box> { [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] 44 - fn matrix_to_png(matrix: &Vec>, filename: &str, scale: usize) -> Result<(), Box> { [INFO] [stdout] 44 + fn matrix_to_png(matrix: &[Vec], filename: &str, scale: usize) -> Result<(), Box> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:156:14 [INFO] [stdout] | [INFO] [stdout] 156 | for y in 0..inner_size { [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] 156 - for y in 0..inner_size { [INFO] [stdout] 156 + for (y, ) in matrix.iter_mut().enumerate().take(inner_size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:157:18 [INFO] [stdout] | [INFO] [stdout] 157 | for x in 0..inner_size { [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] 157 - for x in 0..inner_size { [INFO] [stdout] 157 + for (x, ) in matrix.iter_mut().enumerate().take(inner_size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/qr-analyzer.rs:284:5 [INFO] [stdout] | [INFO] [stdout] 284 | / if let Some(version) = analysis.version_from_size { [INFO] [stdout] 285 | | if !matches!(version, Version::V1) { [INFO] [stdout] 286 | | analysis.alignment_patterns = analyze_alignment_patterns(&matrix, version); [INFO] [stdout] 287 | | } [INFO] [stdout] 288 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 284 ~ if let Some(version) = analysis.version_from_size [INFO] [stdout] 285 ~ && !matches!(version, Version::V1) { [INFO] [stdout] 286 | analysis.alignment_patterns = analyze_alignment_patterns(&matrix, version); [INFO] [stdout] 287 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:388:14 [INFO] [stdout] | [INFO] [stdout] 388 | for i in 8..(size - 8) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 388 - for i in 8..(size - 8) { [INFO] [stdout] 388 + for (i, ) in matrix.iter().enumerate().take((size - 8)).skip(8) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:398:18 [INFO] [stdout] | [INFO] [stdout] 398 | for i in 8..(size - 8) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 398 - for i in 8..(size - 8) { [INFO] [stdout] 398 + for (i, ) in matrix.iter().enumerate().take((size - 8)).skip(8) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:428:14 [INFO] [stdout] | [INFO] [stdout] 428 | for i in 0..6 { [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] 428 - for i in 0..6 { [INFO] [stdout] 428 + for in matrix.iter().take(6) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:453:14 [INFO] [stdout] | [INFO] [stdout] 453 | for i in size-7..size { [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] 453 - for i in size-7..size { [INFO] [stdout] 453 + for in matrix.iter().take(size).skip(size-7) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/qr-analyzer.rs:548:16 [INFO] [stdout] | [INFO] [stdout] 548 | if (i == 0 && j == 0) || // Top-left [INFO] [stdout] | ________________^ [INFO] [stdout] 549 | | (i == 0 && j == centers.len() - 1) || // Top-right [INFO] [stdout] | |_________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 548 - if (i == 0 && j == 0) || // Top-left [INFO] [stdout] 549 - (i == 0 && j == centers.len() - 1) || // Top-right [INFO] [stdout] 548 + if !(i != 0 || j != 0 && j != centers.len() - 1) || // Top-right [INFO] [stdout] | [INFO] [stdout] 548 - if (i == 0 && j == 0) || // Top-left [INFO] [stdout] 549 - (i == 0 && j == centers.len() - 1) || // Top-right [INFO] [stdout] 548 + if (j == centers.len() - 1 || j == 0) && i == 0 || // Top-right [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `expected` [INFO] [stdout] --> src/bin/qr-analyzer.rs:572:14 [INFO] [stdout] | [INFO] [stdout] 572 | for y in 0..5 { [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] 572 - for y in 0..5 { [INFO] [stdout] 572 + for (y, ) in expected.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `expected` [INFO] [stdout] --> src/bin/qr-analyzer.rs:573:18 [INFO] [stdout] | [INFO] [stdout] 573 | for x in 0..5 { [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] 573 - for x in 0..5 { [INFO] [stdout] 573 + for (x, ) in expected.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/qr-analyzer.rs:652:8 [INFO] [stdout] | [INFO] [stdout] 652 | if data_capacity_bits % 8 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!data_capacity_bits.is_multiple_of(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/bin/qr-analyzer.rs:716:9 [INFO] [stdout] | [INFO] [stdout] 715 | let length_value = usize::from_str_radix(&length_bit_string, 2).unwrap_or(0); [INFO] [stdout] | ----------------------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 716 | length_value [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 715 ~ [INFO] [stdout] 716 ~ usize::from_str_radix(&length_bit_string, 2).unwrap_or(0) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/qr-analyzer.rs:776:20 [INFO] [stdout] | [INFO] [stdout] 776 | } else if data_length % 3 == 1 { [INFO] [stdout] | ____________________^ [INFO] [stdout] 777 | | if bit_index + 4 <= corrected_bit_string.len() { [INFO] [stdout] 778 | | let num_str = &corrected_bit_string[bit_index..bit_index + 4]; [INFO] [stdout] 779 | | let num = u8::from_str_radix(num_str, 2).unwrap_or(0); [INFO] [stdout] ... | [INFO] [stdout] 782 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 776 ~ } else if data_length % 3 == 1 [INFO] [stdout] 777 ~ && bit_index + 4 <= corrected_bit_string.len() { [INFO] [stdout] 778 | let num_str = &corrected_bit_string[bit_index..bit_index + 4]; [INFO] [stdout] 779 | let num = u8::from_str_radix(num_str, 2).unwrap_or(0); [INFO] [stdout] 780 | digits.push_str(&format!("{}", num)); [INFO] [stdout] 781 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/qr-analyzer.rs:801:13 [INFO] [stdout] | [INFO] [stdout] 801 | / if data_length % 2 == 1 { [INFO] [stdout] 802 | | if bit_index + 6 <= corrected_bit_string.len() { [INFO] [stdout] 803 | | let char_str = &corrected_bit_string[bit_index..bit_index + 6]; [INFO] [stdout] 804 | | let char_value = u8::from_str_radix(char_str, 2).unwrap_or(0); [INFO] [stdout] ... | [INFO] [stdout] 808 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 801 ~ if data_length % 2 == 1 [INFO] [stdout] 802 ~ && bit_index + 6 <= corrected_bit_string.len() { [INFO] [stdout] 803 | let char_str = &corrected_bit_string[bit_index..bit_index + 6]; [INFO] [stdout] ... [INFO] [stdout] 806 | chars.push(ch); [INFO] [stdout] 807 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:874:24 [INFO] [stdout] | [INFO] [stdout] 874 | for row in 0..size { [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] 874 - for row in 0..size { [INFO] [stdout] 874 + for (row, ) in matrix.iter().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual arithmetic check found [INFO] [stdout] --> src/bin/qr-analyzer.rs:890:15 [INFO] [stdout] | [INFO] [stdout] 890 | col = if col >= 2 { col - 2 } else { 0 }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `col.saturating_sub(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] = note: `#[warn(clippy::implicit_saturating_sub)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/qr-analyzer.rs:910:17 [INFO] [stdout] | [INFO] [stdout] 910 | / if !is_function_module(row, c, size) { [INFO] [stdout] 911 | | if bit_index < bits.len() { [INFO] [stdout] 912 | | let unmasked_bit = apply_mask_to_bit(bits[bit_index], row, c, mask); [INFO] [stdout] 913 | | unmasked_bits.push(unmasked_bit); [INFO] [stdout] ... | [INFO] [stdout] 916 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 910 ~ if !is_function_module(row, c, size) [INFO] [stdout] 911 ~ && bit_index < bits.len() { [INFO] [stdout] 912 | let unmasked_bit = apply_mask_to_bit(bits[bit_index], row, c, mask); [INFO] [stdout] 913 | unmasked_bits.push(unmasked_bit); [INFO] [stdout] 914 | bit_index += 1; [INFO] [stdout] 915 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual arithmetic check found [INFO] [stdout] --> src/bin/qr-analyzer.rs:929:15 [INFO] [stdout] | [INFO] [stdout] 929 | col = if col >= 2 { col - 2 } else { 0 }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `col.saturating_sub(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/qr-analyzer.rs:937:8 [INFO] [stdout] | [INFO] [stdout] 937 | if (row < 9 && col < 9) || (row < 9 && col >= size - 8) || (row >= size - 8 && col < 9) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 937 - if (row < 9 && col < 9) || (row < 9 && col >= size - 8) || (row >= size - 8 && col < 9) { [INFO] [stdout] 937 + if !(row >= 9 || col >= 9 && col < size - 8) || (row >= size - 8 && col < 9) { [INFO] [stdout] | [INFO] [stdout] 937 - if (row < 9 && col < 9) || (row < 9 && col >= size - 8) || (row >= size - 8 && col < 9) { [INFO] [stdout] 937 + if (col >= size - 8 || col < 9) && row < 9 || (row >= size - 8 && col < 9) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/qr-analyzer.rs:970:34 [INFO] [stdout] | [INFO] [stdout] 970 | MaskPattern::Pattern0 => (row + col) % 2 == 0, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `(row + col).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/qr-analyzer.rs:971:34 [INFO] [stdout] | [INFO] [stdout] 971 | MaskPattern::Pattern1 => row % 2 == 0, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace with: `row.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/qr-analyzer.rs:972:34 [INFO] [stdout] | [INFO] [stdout] 972 | MaskPattern::Pattern2 => col % 3 == 0, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace with: `col.is_multiple_of(3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/qr-analyzer.rs:973:34 [INFO] [stdout] | [INFO] [stdout] 973 | MaskPattern::Pattern3 => (row + col) % 3 == 0, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `(row + col).is_multiple_of(3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/qr-analyzer.rs:974:34 [INFO] [stdout] | [INFO] [stdout] 974 | MaskPattern::Pattern4 => (row / 2 + col / 3) % 2 == 0, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(row / 2 + col / 3).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/qr-analyzer.rs:976:34 [INFO] [stdout] | [INFO] [stdout] 976 | MaskPattern::Pattern6 => ((row * col) % 2 + (row * col) % 3) % 2 == 0, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `((row * col) % 2 + (row * col) % 3).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/qr-analyzer.rs:977:34 [INFO] [stdout] | [INFO] [stdout] 977 | MaskPattern::Pattern7 => ((row + col) % 2 + (row * col) % 3) % 2 == 0, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `((row + col) % 2 + (row * col) % 3).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:1003:14 [INFO] [stdout] | [INFO] [stdout] 1003 | for i in 0..6 { [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] 1003 - for i in 0..6 { [INFO] [stdout] 1003 + for in matrix.iter().take(6) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:1011:14 [INFO] [stdout] | [INFO] [stdout] 1011 | for i in 0..6 { [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] 1011 - for i in 0..6 { [INFO] [stdout] 1011 + for in matrix.iter().take(6) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:156:14 [INFO] [stdout] | [INFO] [stdout] 156 | for y in 0..inner_size { [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] 156 - for y in 0..inner_size { [INFO] [stdout] 156 + for (y, ) in matrix.iter_mut().enumerate().take(inner_size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:157:18 [INFO] [stdout] | [INFO] [stdout] 157 | for x in 0..inner_size { [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] 157 - for x in 0..inner_size { [INFO] [stdout] 157 + for (x, ) in matrix.iter_mut().enumerate().take(inner_size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/qr-analyzer.rs:284:5 [INFO] [stdout] | [INFO] [stdout] 284 | / if let Some(version) = analysis.version_from_size { [INFO] [stdout] 285 | | if !matches!(version, Version::V1) { [INFO] [stdout] 286 | | analysis.alignment_patterns = analyze_alignment_patterns(&matrix, version); [INFO] [stdout] 287 | | } [INFO] [stdout] 288 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 284 ~ if let Some(version) = analysis.version_from_size [INFO] [stdout] 285 ~ && !matches!(version, Version::V1) { [INFO] [stdout] 286 | analysis.alignment_patterns = analyze_alignment_patterns(&matrix, version); [INFO] [stdout] 287 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:388:14 [INFO] [stdout] | [INFO] [stdout] 388 | for i in 8..(size - 8) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 388 - for i in 8..(size - 8) { [INFO] [stdout] 388 + for (i, ) in matrix.iter().enumerate().take((size - 8)).skip(8) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:398:18 [INFO] [stdout] | [INFO] [stdout] 398 | for i in 8..(size - 8) { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 398 - for i in 8..(size - 8) { [INFO] [stdout] 398 + for (i, ) in matrix.iter().enumerate().take((size - 8)).skip(8) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:428:14 [INFO] [stdout] | [INFO] [stdout] 428 | for i in 0..6 { [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] 428 - for i in 0..6 { [INFO] [stdout] 428 + for in matrix.iter().take(6) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:453:14 [INFO] [stdout] | [INFO] [stdout] 453 | for i in size-7..size { [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] 453 - for i in size-7..size { [INFO] [stdout] 453 + for in matrix.iter().take(size).skip(size-7) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/qr-analyzer.rs:548:16 [INFO] [stdout] | [INFO] [stdout] 548 | if (i == 0 && j == 0) || // Top-left [INFO] [stdout] | ________________^ [INFO] [stdout] 549 | | (i == 0 && j == centers.len() - 1) || // Top-right [INFO] [stdout] | |_________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 548 - if (i == 0 && j == 0) || // Top-left [INFO] [stdout] 549 - (i == 0 && j == centers.len() - 1) || // Top-right [INFO] [stdout] 548 + if !(i != 0 || j != 0 && j != centers.len() - 1) || // Top-right [INFO] [stdout] | [INFO] [stdout] 548 - if (i == 0 && j == 0) || // Top-left [INFO] [stdout] 549 - (i == 0 && j == centers.len() - 1) || // Top-right [INFO] [stdout] 548 + if (j == centers.len() - 1 || j == 0) && i == 0 || // Top-right [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `y` is used to index `expected` [INFO] [stdout] --> src/bin/qr-analyzer.rs:572:14 [INFO] [stdout] | [INFO] [stdout] 572 | for y in 0..5 { [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] 572 - for y in 0..5 { [INFO] [stdout] 572 + for (y, ) in expected.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `x` is used to index `expected` [INFO] [stdout] --> src/bin/qr-analyzer.rs:573:18 [INFO] [stdout] | [INFO] [stdout] 573 | for x in 0..5 { [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] 573 - for x in 0..5 { [INFO] [stdout] 573 + for (x, ) in expected.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/qr-analyzer.rs:652:8 [INFO] [stdout] | [INFO] [stdout] 652 | if data_capacity_bits % 8 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `!data_capacity_bits.is_multiple_of(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/bin/qr-analyzer.rs:716:9 [INFO] [stdout] | [INFO] [stdout] 715 | let length_value = usize::from_str_radix(&length_bit_string, 2).unwrap_or(0); [INFO] [stdout] | ----------------------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 716 | length_value [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 715 ~ [INFO] [stdout] 716 ~ usize::from_str_radix(&length_bit_string, 2).unwrap_or(0) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/qr-analyzer.rs:776:20 [INFO] [stdout] | [INFO] [stdout] 776 | } else if data_length % 3 == 1 { [INFO] [stdout] | ____________________^ [INFO] [stdout] 777 | | if bit_index + 4 <= corrected_bit_string.len() { [INFO] [stdout] 778 | | let num_str = &corrected_bit_string[bit_index..bit_index + 4]; [INFO] [stdout] 779 | | let num = u8::from_str_radix(num_str, 2).unwrap_or(0); [INFO] [stdout] ... | [INFO] [stdout] 782 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 776 ~ } else if data_length % 3 == 1 [INFO] [stdout] 777 ~ && bit_index + 4 <= corrected_bit_string.len() { [INFO] [stdout] 778 | let num_str = &corrected_bit_string[bit_index..bit_index + 4]; [INFO] [stdout] 779 | let num = u8::from_str_radix(num_str, 2).unwrap_or(0); [INFO] [stdout] 780 | digits.push_str(&format!("{}", num)); [INFO] [stdout] 781 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/qr-analyzer.rs:801:13 [INFO] [stdout] | [INFO] [stdout] 801 | / if data_length % 2 == 1 { [INFO] [stdout] 802 | | if bit_index + 6 <= corrected_bit_string.len() { [INFO] [stdout] 803 | | let char_str = &corrected_bit_string[bit_index..bit_index + 6]; [INFO] [stdout] 804 | | let char_value = u8::from_str_radix(char_str, 2).unwrap_or(0); [INFO] [stdout] ... | [INFO] [stdout] 808 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 801 ~ if data_length % 2 == 1 [INFO] [stdout] 802 ~ && bit_index + 6 <= corrected_bit_string.len() { [INFO] [stdout] 803 | let char_str = &corrected_bit_string[bit_index..bit_index + 6]; [INFO] [stdout] ... [INFO] [stdout] 806 | chars.push(ch); [INFO] [stdout] 807 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `row` is used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:874:24 [INFO] [stdout] | [INFO] [stdout] 874 | for row in 0..size { [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] 874 - for row in 0..size { [INFO] [stdout] 874 + for (row, ) in matrix.iter().enumerate().take(size) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual arithmetic check found [INFO] [stdout] --> src/bin/qr-analyzer.rs:890:15 [INFO] [stdout] | [INFO] [stdout] 890 | col = if col >= 2 { col - 2 } else { 0 }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `col.saturating_sub(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] = note: `#[warn(clippy::implicit_saturating_sub)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/bin/qr-analyzer.rs:910:17 [INFO] [stdout] | [INFO] [stdout] 910 | / if !is_function_module(row, c, size) { [INFO] [stdout] 911 | | if bit_index < bits.len() { [INFO] [stdout] 912 | | let unmasked_bit = apply_mask_to_bit(bits[bit_index], row, c, mask); [INFO] [stdout] 913 | | unmasked_bits.push(unmasked_bit); [INFO] [stdout] ... | [INFO] [stdout] 916 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 910 ~ if !is_function_module(row, c, size) [INFO] [stdout] 911 ~ && bit_index < bits.len() { [INFO] [stdout] 912 | let unmasked_bit = apply_mask_to_bit(bits[bit_index], row, c, mask); [INFO] [stdout] 913 | unmasked_bits.push(unmasked_bit); [INFO] [stdout] 914 | bit_index += 1; [INFO] [stdout] 915 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual arithmetic check found [INFO] [stdout] --> src/bin/qr-analyzer.rs:929:15 [INFO] [stdout] | [INFO] [stdout] 929 | col = if col >= 2 { col - 2 } else { 0 }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `col.saturating_sub(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/bin/qr-analyzer.rs:937:8 [INFO] [stdout] | [INFO] [stdout] 937 | if (row < 9 && col < 9) || (row < 9 && col >= size - 8) || (row >= size - 8 && col < 9) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 937 - if (row < 9 && col < 9) || (row < 9 && col >= size - 8) || (row >= size - 8 && col < 9) { [INFO] [stdout] 937 + if !(row >= 9 || col >= 9 && col < size - 8) || (row >= size - 8 && col < 9) { [INFO] [stdout] | [INFO] [stdout] 937 - if (row < 9 && col < 9) || (row < 9 && col >= size - 8) || (row >= size - 8 && col < 9) { [INFO] [stdout] 937 + if (col >= size - 8 || col < 9) && row < 9 || (row >= size - 8 && col < 9) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/qr-analyzer.rs:970:34 [INFO] [stdout] | [INFO] [stdout] 970 | MaskPattern::Pattern0 => (row + col) % 2 == 0, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `(row + col).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/qr-analyzer.rs:971:34 [INFO] [stdout] | [INFO] [stdout] 971 | MaskPattern::Pattern1 => row % 2 == 0, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace with: `row.is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/qr-analyzer.rs:972:34 [INFO] [stdout] | [INFO] [stdout] 972 | MaskPattern::Pattern2 => col % 3 == 0, [INFO] [stdout] | ^^^^^^^^^^^^ help: replace with: `col.is_multiple_of(3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/qr-analyzer.rs:973:34 [INFO] [stdout] | [INFO] [stdout] 973 | MaskPattern::Pattern3 => (row + col) % 3 == 0, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `(row + col).is_multiple_of(3)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/qr-analyzer.rs:974:34 [INFO] [stdout] | [INFO] [stdout] 974 | MaskPattern::Pattern4 => (row / 2 + col / 3) % 2 == 0, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `(row / 2 + col / 3).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/qr-analyzer.rs:976:34 [INFO] [stdout] | [INFO] [stdout] 976 | MaskPattern::Pattern6 => ((row * col) % 2 + (row * col) % 3) % 2 == 0, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `((row * col) % 2 + (row * col) % 3).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> src/bin/qr-analyzer.rs:977:34 [INFO] [stdout] | [INFO] [stdout] 977 | MaskPattern::Pattern7 => ((row + col) % 2 + (row * col) % 3) % 2 == 0, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `((row + col) % 2 + (row * col) % 3).is_multiple_of(2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_multiple_of [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:1003:14 [INFO] [stdout] | [INFO] [stdout] 1003 | for i in 0..6 { [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] 1003 - for i in 0..6 { [INFO] [stdout] 1003 + for in matrix.iter().take(6) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `matrix` [INFO] [stdout] --> src/bin/qr-analyzer.rs:1011:14 [INFO] [stdout] | [INFO] [stdout] 1011 | for i in 0..6 { [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] 1011 - for i in 0..6 { [INFO] [stdout] 1011 + for in matrix.iter().take(6) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 28.37s [INFO] running `Command { std: "docker" "inspect" "33c26f0c27228292c511fddbd0341a11f98ca20a0ad2abd65ea444ae200093d1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "33c26f0c27228292c511fddbd0341a11f98ca20a0ad2abd65ea444ae200093d1", kill_on_drop: false }` [INFO] [stdout] 33c26f0c27228292c511fddbd0341a11f98ca20a0ad2abd65ea444ae200093d1