[INFO] fetching crate qrcodegen-no-heap 1.8.1... [INFO] linting qrcodegen-no-heap-1.8.1 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate qrcodegen-no-heap 1.8.1 into /workspace/builds/worker-7-tc1/source [INFO] started tweaking crates.io crate qrcodegen-no-heap 1.8.1 [INFO] finished tweaking crates.io crate qrcodegen-no-heap 1.8.1 [INFO] tweaked toml for crates.io crate qrcodegen-no-heap 1.8.1 written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate qrcodegen-no-heap 1.8.1 on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate crates.io crate qrcodegen-no-heap 1.8.1 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] warning: `package.edition` is unspecified, defaulting to `2015` while the latest is `2024` [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 2fd87fe9df4cfddccb4d80928af58dc5d38eff094f17dd2d52a0447c21b9199e [INFO] running `Command { std: "docker" "start" "-a" "2fd87fe9df4cfddccb4d80928af58dc5d38eff094f17dd2d52a0447c21b9199e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "2fd87fe9df4cfddccb4d80928af58dc5d38eff094f17dd2d52a0447c21b9199e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "2fd87fe9df4cfddccb4d80928af58dc5d38eff094f17dd2d52a0447c21b9199e", kill_on_drop: false }` [INFO] [stdout] 2fd87fe9df4cfddccb4d80928af58dc5d38eff094f17dd2d52a0447c21b9199e [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 16dbf88f121158312c3d76505591bd1eac008a4f0d0257834bd4939b07a576d4 [INFO] running `Command { std: "docker" "start" "-a" "16dbf88f121158312c3d76505591bd1eac008a4f0d0257834bd4939b07a576d4", kill_on_drop: false }` [INFO] [stderr] warning: `package.edition` is unspecified, defaulting to `2015` while the latest is `2024` [INFO] [stderr] Checking qrcodegen-no-heap v1.8.1 (/opt/rustwide/workdir) [INFO] [stdout] warning: this is an `else {..}` but the formatting might hide it [INFO] [stdout] --> src/lib.rs:799:38 [INFO] [stdout] | [INFO] [stdout] 799 | let step: u8 = if ver == 32 { 26 } else [INFO] [stdout] | _______________________________________________^ [INFO] [stdout] 800 | | {(ver * 4 + numalign * 2 + 1) / (numalign * 2 - 2) * 2}; [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = note: to remove this lint, remove the `else` or remove the new line between `else` and `{..}` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stdout] = note: `#[warn(clippy::suspicious_else_formatting)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/lib.rs:879:4 [INFO] [stdout] | [INFO] [stdout] 879 | degree: degree, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `degree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is an `else {..}` but the formatting might hide it [INFO] [stdout] --> src/lib.rs:799:38 [INFO] [stdout] | [INFO] [stdout] 799 | let step: u8 = if ver == 32 { 26 } else [INFO] [stdout] | _______________________________________________^ [INFO] [stdout] 800 | | {(ver * 4 + numalign * 2 + 1) / (numalign * 2 - 2) * 2}; [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = note: to remove this lint, remove the `else` or remove the new line between `else` and `{..}` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stdout] = note: `#[warn(clippy::suspicious_else_formatting)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/lib.rs:879:4 [INFO] [stdout] | [INFO] [stdout] 879 | degree: degree, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: replace it with: `degree` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/lib.rs:164:2 [INFO] [stdout] | [INFO] [stdout] 164 | / pub fn encode_text<'b>(text: &str, tempbuffer: &'b mut [u8], mut outbuffer: &'a mut [u8], ecl: QrCodeEcc, [INFO] [stdout] 165 | | minversion: Version, maxversion: Version, mask: Option, boostecl: bool) -> Result,DataTooLong> { [INFO] [stdout] | |___________________________________________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/lib.rs:178:58 [INFO] [stdout] | [INFO] [stdout] 178 | ...ment::is_numeric(text) && QrSegment::calc_buffer_size(Numeric, textlen).map_or(false, |x| x <= buflen) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 178 - let seg: QrSegment = if QrSegment::is_numeric(text) && QrSegment::calc_buffer_size(Numeric, textlen).map_or(false, |x| x <= buflen) { [INFO] [stdout] 178 + let seg: QrSegment = if QrSegment::is_numeric(text) && QrSegment::calc_buffer_size(Numeric, textlen).is_some_and(|x| x <= buflen) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/lib.rs:180:49 [INFO] [stdout] | [INFO] [stdout] 180 | ..._alphanumeric(text) && QrSegment::calc_buffer_size(Alphanumeric, textlen).map_or(false, |x| x <= buflen) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 180 - } else if QrSegment::is_alphanumeric(text) && QrSegment::calc_buffer_size(Alphanumeric, textlen).map_or(false, |x| x <= buflen) { [INFO] [stdout] 180 + } else if QrSegment::is_alphanumeric(text) && QrSegment::calc_buffer_size(Alphanumeric, textlen).is_some_and(|x| x <= buflen) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/lib.rs:182:13 [INFO] [stdout] | [INFO] [stdout] 182 | } else if QrSegment::calc_buffer_size(Byte, textlen).map_or(false, |x| x <= buflen) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 182 - } else if QrSegment::calc_buffer_size(Byte, textlen).map_or(false, |x| x <= buflen) { [INFO] [stdout] 182 + } else if QrSegment::calc_buffer_size(Byte, textlen).is_some_and(|x| x <= buflen) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/lib.rs:220:2 [INFO] [stdout] | [INFO] [stdout] 220 | / pub fn encode_binary<'b>(dataandtempbuffer: &'b mut [u8], datalen: usize, mut outbuffer: &'a mut [u8], ecl: QrCodeEcc, [INFO] [stdout] 221 | | minversion: Version, maxversion: Version, mask: Option, boostecl: bool) -> Result,DataTooLong> { [INFO] [stdout] | |___________________________________________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/lib.rs:227:6 [INFO] [stdout] | [INFO] [stdout] 227 | if QrSegment::calc_buffer_size(QrSegmentMode::Byte, datalen).map_or(true, |x| x > outbuffer.len()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 227 - if QrSegment::calc_buffer_size(QrSegmentMode::Byte, datalen).map_or(true, |x| x > outbuffer.len()) { [INFO] [stdout] 227 + if QrSegment::calc_buffer_size(QrSegmentMode::Byte, datalen).is_none_or(|x| x > outbuffer.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/lib.rs:262:7 [INFO] [stdout] | [INFO] [stdout] 262 | if dataused.map_or(false, |n| n <= datacapacitybits) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 262 - if dataused.map_or(false, |n| n <= datacapacitybits) { [INFO] [stdout] 262 + if dataused.is_some_and(|n| n <= datacapacitybits) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/lib.rs:339:25 [INFO] [stdout] | [INFO] [stdout] 339 | let mut minpenalty = core::i32::MAX; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 339 - let mut minpenalty = core::i32::MAX; [INFO] [stdout] 339 + let mut minpenalty = i32::MAX; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/lib.rs:377:4 [INFO] [stdout] | [INFO] [stdout] 377 | usize::from(self.get_module_bounded(1, 8)) << 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `usize::from(self.get_module_bounded(1, 8))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/lib.rs:388:4 [INFO] [stdout] | [INFO] [stdout] 388 | u8::from(self.get_module_bounded(4, 8)) << 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `u8::from(self.get_module_bounded(4, 8))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `dat` [INFO] [stdout] --> src/lib.rs:463:13 [INFO] [stdout] | [INFO] [stdout] 463 | for j in 0 .. datlen { // Copy data [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] 463 - for j in 0 .. datlen { // Copy data [INFO] [stdout] 463 + for (j, ) in dat.iter().enumerate().take(datlen) { // Copy data [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `ecc` [INFO] [stdout] --> src/lib.rs:471:13 [INFO] [stdout] | [INFO] [stdout] 471 | for j in 0 .. blockecclen { // Copy ECC [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] 471 - for j in 0 .. blockecclen { // Copy ECC [INFO] [stdout] 471 + for in ecc.iter().take(blockecclen) { // Copy ECC [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/lib.rs:512:10 [INFO] [stdout] | [INFO] [stdout] 512 | if !((i == 0 && j == 0) || (i == 0 && j == alignpatpos.len() - 1) || (i == alignpatpos.len() - 1 && j == 0)) { [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] 512 - if !((i == 0 && j == 0) || (i == 0 && j == alignpatpos.len() - 1) || (i == alignpatpos.len() - 1 && j == 0)) { [INFO] [stdout] 512 + if !(!(i != 0 || j != 0 && j != alignpatpos.len() - 1) || (i == alignpatpos.len() - 1 && j == 0)) { [INFO] [stdout] | [INFO] [stdout] 512 - if !((i == 0 && j == 0) || (i == 0 && j == alignpatpos.len() - 1) || (i == alignpatpos.len() - 1 && j == 0)) { [INFO] [stdout] 512 + if !((j == alignpatpos.len() - 1 || j == 0) && i == 0 || (i == alignpatpos.len() - 1 && j == 0)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/lib.rs:556:8 [INFO] [stdout] | [INFO] [stdout] 556 | if (i == 0 && j == 0) || (i == 0 && j == alignpatpos.len() - 1) || (i == alignpatpos.len() - 1 && j == 0) { [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] 556 - if (i == 0 && j == 0) || (i == 0 && j == alignpatpos.len() - 1) || (i == alignpatpos.len() - 1 && j == 0) { [INFO] [stdout] 556 + if !(i != 0 || j != 0 && j != alignpatpos.len() - 1) || (i == alignpatpos.len() - 1 && j == 0) { [INFO] [stdout] | [INFO] [stdout] 556 - if (i == 0 && j == 0) || (i == 0 && j == alignpatpos.len() - 1) || (i == alignpatpos.len() - 1 && j == 0) { [INFO] [stdout] 556 + if (j == alignpatpos.len() - 1 || j == 0) && i == 0 || (i == alignpatpos.len() - 1 && j == 0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:780:17 [INFO] [stdout] | [INFO] [stdout] 780 | debug_assert!(0 <= k && k <= 9); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `(0..=9).contains(&k)` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:782:17 [INFO] [stdout] | [INFO] [stdout] 782 | debug_assert!(0 <= result && result <= 2568888); // Non-tight upper bound based on default values of PENALTY_N1, ..., N4 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0..=2568888).contains(&result)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual check for common ascii range [INFO] [stdout] --> src/lib.rs:1118:12 [INFO] [stdout] | [INFO] [stdout] 1118 | assert!((b'0' ..= b'9').contains(&b), "String contains non-numeric characters"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_ascii_check [INFO] [stdout] = note: `#[warn(clippy::manual_is_ascii_check)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1118 - assert!((b'0' ..= b'9').contains(&b), "String contains non-numeric characters"); [INFO] [stdout] 1118 + assert!(b.is_ascii_digit(), "String contains non-numeric characters"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual check for common ascii range [INFO] [stdout] --> src/lib.rs:1274:24 [INFO] [stdout] | [INFO] [stdout] 1274 | text.chars().all(|c| ('0' ..= '9').contains(&c)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_ascii_check [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1274 - text.chars().all(|c| ('0' ..= '9').contains(&c)) [INFO] [stdout] 1274 + text.chars().all(|c: char| c.is_ascii_digit()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `BitBuffer` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/lib.rs:1365:2 [INFO] [stdout] | [INFO] [stdout] 1365 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/lib.rs:1449:3 [INFO] [stdout] | [INFO] [stdout] 1449 | (sidelen * sidelen + 7) / 8 + 1 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(sidelen * sidelen).div_ceil(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/lib.rs:164:2 [INFO] [stdout] | [INFO] [stdout] 164 | / pub fn encode_text<'b>(text: &str, tempbuffer: &'b mut [u8], mut outbuffer: &'a mut [u8], ecl: QrCodeEcc, [INFO] [stdout] 165 | | minversion: Version, maxversion: Version, mask: Option, boostecl: bool) -> Result,DataTooLong> { [INFO] [stdout] | |___________________________________________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/lib.rs:178:58 [INFO] [stdout] | [INFO] [stdout] 178 | ...ment::is_numeric(text) && QrSegment::calc_buffer_size(Numeric, textlen).map_or(false, |x| x <= buflen) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 178 - let seg: QrSegment = if QrSegment::is_numeric(text) && QrSegment::calc_buffer_size(Numeric, textlen).map_or(false, |x| x <= buflen) { [INFO] [stdout] 178 + let seg: QrSegment = if QrSegment::is_numeric(text) && QrSegment::calc_buffer_size(Numeric, textlen).is_some_and(|x| x <= buflen) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/lib.rs:180:49 [INFO] [stdout] | [INFO] [stdout] 180 | ..._alphanumeric(text) && QrSegment::calc_buffer_size(Alphanumeric, textlen).map_or(false, |x| x <= buflen) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 180 - } else if QrSegment::is_alphanumeric(text) && QrSegment::calc_buffer_size(Alphanumeric, textlen).map_or(false, |x| x <= buflen) { [INFO] [stdout] 180 + } else if QrSegment::is_alphanumeric(text) && QrSegment::calc_buffer_size(Alphanumeric, textlen).is_some_and(|x| x <= buflen) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/lib.rs:182:13 [INFO] [stdout] | [INFO] [stdout] 182 | } else if QrSegment::calc_buffer_size(Byte, textlen).map_or(false, |x| x <= buflen) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 182 - } else if QrSegment::calc_buffer_size(Byte, textlen).map_or(false, |x| x <= buflen) { [INFO] [stdout] 182 + } else if QrSegment::calc_buffer_size(Byte, textlen).is_some_and(|x| x <= buflen) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/lib.rs:220:2 [INFO] [stdout] | [INFO] [stdout] 220 | / pub fn encode_binary<'b>(dataandtempbuffer: &'b mut [u8], datalen: usize, mut outbuffer: &'a mut [u8], ecl: QrCodeEcc, [INFO] [stdout] 221 | | minversion: Version, maxversion: Version, mask: Option, boostecl: bool) -> Result,DataTooLong> { [INFO] [stdout] | |___________________________________________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/lib.rs:227:6 [INFO] [stdout] | [INFO] [stdout] 227 | if QrSegment::calc_buffer_size(QrSegmentMode::Byte, datalen).map_or(true, |x| x > outbuffer.len()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 227 - if QrSegment::calc_buffer_size(QrSegmentMode::Byte, datalen).map_or(true, |x| x > outbuffer.len()) { [INFO] [stdout] 227 + if QrSegment::calc_buffer_size(QrSegmentMode::Byte, datalen).is_none_or(|x| x > outbuffer.len()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/lib.rs:262:7 [INFO] [stdout] | [INFO] [stdout] 262 | if dataused.map_or(false, |n| n <= datacapacitybits) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 262 - if dataused.map_or(false, |n| n <= datacapacitybits) { [INFO] [stdout] 262 + if dataused.is_some_and(|n| n <= datacapacitybits) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> src/lib.rs:339:25 [INFO] [stdout] | [INFO] [stdout] 339 | let mut minpenalty = core::i32::MAX; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 339 - let mut minpenalty = core::i32::MAX; [INFO] [stdout] 339 + let mut minpenalty = i32::MAX; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/lib.rs:377:4 [INFO] [stdout] | [INFO] [stdout] 377 | usize::from(self.get_module_bounded(1, 8)) << 0; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `usize::from(self.get_module_bounded(1, 8))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/lib.rs:388:4 [INFO] [stdout] | [INFO] [stdout] 388 | u8::from(self.get_module_bounded(4, 8)) << 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider reducing it to: `u8::from(self.get_module_bounded(4, 8))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is used to index `dat` [INFO] [stdout] --> src/lib.rs:463:13 [INFO] [stdout] | [INFO] [stdout] 463 | for j in 0 .. datlen { // Copy data [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] 463 - for j in 0 .. datlen { // Copy data [INFO] [stdout] 463 + for (j, ) in dat.iter().enumerate().take(datlen) { // Copy data [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `j` is only used to index `ecc` [INFO] [stdout] --> src/lib.rs:471:13 [INFO] [stdout] | [INFO] [stdout] 471 | for j in 0 .. blockecclen { // Copy ECC [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] 471 - for j in 0 .. blockecclen { // Copy ECC [INFO] [stdout] 471 + for in ecc.iter().take(blockecclen) { // Copy ECC [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/lib.rs:512:10 [INFO] [stdout] | [INFO] [stdout] 512 | if !((i == 0 && j == 0) || (i == 0 && j == alignpatpos.len() - 1) || (i == alignpatpos.len() - 1 && j == 0)) { [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] 512 - if !((i == 0 && j == 0) || (i == 0 && j == alignpatpos.len() - 1) || (i == alignpatpos.len() - 1 && j == 0)) { [INFO] [stdout] 512 + if !(!(i != 0 || j != 0 && j != alignpatpos.len() - 1) || (i == alignpatpos.len() - 1 && j == 0)) { [INFO] [stdout] | [INFO] [stdout] 512 - if !((i == 0 && j == 0) || (i == 0 && j == alignpatpos.len() - 1) || (i == alignpatpos.len() - 1 && j == 0)) { [INFO] [stdout] 512 + if !((j == alignpatpos.len() - 1 || j == 0) && i == 0 || (i == alignpatpos.len() - 1 && j == 0)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/lib.rs:556:8 [INFO] [stdout] | [INFO] [stdout] 556 | if (i == 0 && j == 0) || (i == 0 && j == alignpatpos.len() - 1) || (i == alignpatpos.len() - 1 && j == 0) { [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] 556 - if (i == 0 && j == 0) || (i == 0 && j == alignpatpos.len() - 1) || (i == alignpatpos.len() - 1 && j == 0) { [INFO] [stdout] 556 + if !(i != 0 || j != 0 && j != alignpatpos.len() - 1) || (i == alignpatpos.len() - 1 && j == 0) { [INFO] [stdout] | [INFO] [stdout] 556 - if (i == 0 && j == 0) || (i == 0 && j == alignpatpos.len() - 1) || (i == alignpatpos.len() - 1 && j == 0) { [INFO] [stdout] 556 + if (j == alignpatpos.len() - 1 || j == 0) && i == 0 || (i == alignpatpos.len() - 1 && j == 0) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:780:17 [INFO] [stdout] | [INFO] [stdout] 780 | debug_assert!(0 <= k && k <= 9); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: use: `(0..=9).contains(&k)` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/lib.rs:782:17 [INFO] [stdout] | [INFO] [stdout] 782 | debug_assert!(0 <= result && result <= 2568888); // Non-tight upper bound based on default values of PENALTY_N1, ..., N4 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0..=2568888).contains(&result)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual check for common ascii range [INFO] [stdout] --> src/lib.rs:1118:12 [INFO] [stdout] | [INFO] [stdout] 1118 | assert!((b'0' ..= b'9').contains(&b), "String contains non-numeric characters"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_ascii_check [INFO] [stdout] = note: `#[warn(clippy::manual_is_ascii_check)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1118 - assert!((b'0' ..= b'9').contains(&b), "String contains non-numeric characters"); [INFO] [stdout] 1118 + assert!(b.is_ascii_digit(), "String contains non-numeric characters"); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual check for common ascii range [INFO] [stdout] --> src/lib.rs:1274:24 [INFO] [stdout] | [INFO] [stdout] 1274 | text.chars().all(|c| ('0' ..= '9').contains(&c)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_is_ascii_check [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1274 - text.chars().all(|c| ('0' ..= '9').contains(&c)) [INFO] [stdout] 1274 + text.chars().all(|c: char| c.is_ascii_digit()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `BitBuffer` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/lib.rs:1365:2 [INFO] [stdout] | [INFO] [stdout] 1365 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/lib.rs:1449:3 [INFO] [stdout] | [INFO] [stdout] 1449 | (sidelen * sidelen + 7) / 8 + 1 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(sidelen * sidelen).div_ceil(8)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.63s [INFO] running `Command { std: "docker" "inspect" "16dbf88f121158312c3d76505591bd1eac008a4f0d0257834bd4939b07a576d4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "16dbf88f121158312c3d76505591bd1eac008a4f0d0257834bd4939b07a576d4", kill_on_drop: false }` [INFO] [stdout] 16dbf88f121158312c3d76505591bd1eac008a4f0d0257834bd4939b07a576d4