[INFO] cloning repository https://github.com/fukuyori/arduboy-emu [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/fukuyori/arduboy-emu" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ffukuyori%2Farduboy-emu", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ffukuyori%2Farduboy-emu'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 32b69ac3190722e71422447e298eaa9739a611bf [INFO] linting fukuyori/arduboy-emu against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ffukuyori%2Farduboy-emu" "/workspace/builds/worker-4-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-4-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/fukuyori/arduboy-emu [INFO] finished tweaking git repo https://github.com/fukuyori/arduboy-emu [INFO] tweaked toml for git repo https://github.com/fukuyori/arduboy-emu written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/fukuyori/arduboy-emu 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/fukuyori/arduboy-emu 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] Locking 1 package to latest compatible version [INFO] [stderr] Adding bincode v1.3.3 (available: v3.0.0) [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded toml_parser v1.0.7+spec-1.1.0 [INFO] [stderr] Downloaded claxon v0.4.3 [INFO] [stderr] Downloaded inotify v0.11.0 [INFO] [stderr] Downloaded tempfile v3.25.0 [INFO] [stderr] Downloaded unicode-ident v1.0.23 [INFO] [stderr] Downloaded cc v1.2.55 [INFO] [stderr] Downloaded libc v0.2.181 [INFO] [stderr] Downloaded orbclient v0.3.50 [INFO] [stderr] Downloaded anyhow v1.0.101 [INFO] [stderr] Downloaded sdl2-sys v0.38.0 [INFO] [stderr] Downloaded minifb v0.27.0 [INFO] [stderr] Downloaded syn v2.0.115 [INFO] [stderr] Downloaded sdl2 v0.38.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] c87545f5c74ef70850b0ae6e503f597387f5b8a25907d6de3509e5f7da7e7af9 [INFO] running `Command { std: "docker" "start" "-a" "c87545f5c74ef70850b0ae6e503f597387f5b8a25907d6de3509e5f7da7e7af9", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "c87545f5c74ef70850b0ae6e503f597387f5b8a25907d6de3509e5f7da7e7af9", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c87545f5c74ef70850b0ae6e503f597387f5b8a25907d6de3509e5f7da7e7af9", kill_on_drop: false }` [INFO] [stdout] c87545f5c74ef70850b0ae6e503f597387f5b8a25907d6de3509e5f7da7e7af9 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-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] 599855dea56af93fd7beb4dd193c39f98e3c8ce29bb0630158aef596cc285b95 [INFO] running `Command { std: "docker" "start" "-a" "599855dea56af93fd7beb4dd193c39f98e3c8ce29bb0630158aef596cc285b95", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.181 [INFO] [stderr] Compiling unicode-ident v1.0.23 [INFO] [stderr] Compiling quote v1.0.44 [INFO] [stderr] Checking bitflags v2.10.0 [INFO] [stderr] Compiling xml-rs v0.8.28 [INFO] [stderr] Checking libloading v0.8.9 [INFO] [stderr] Compiling memoffset v0.6.5 [INFO] [stderr] Compiling wayland-sys v0.29.5 [INFO] [stderr] Compiling proc-macro2 v1.0.106 [INFO] [stderr] Checking log v0.4.29 [INFO] [stderr] Checking dlib v0.5.2 [INFO] [stderr] Compiling serde_core v1.0.228 [INFO] [stderr] Compiling alsa-sys v0.3.1 [INFO] [stderr] Checking arrayvec v0.7.6 [INFO] [stderr] Checking smallvec v1.15.1 [INFO] [stderr] Checking bytemuck v1.25.0 [INFO] [stderr] Compiling cfg_aliases v0.2.1 [INFO] [stderr] Compiling nix v0.30.1 [INFO] [stderr] Compiling libudev-sys v0.1.4 [INFO] [stderr] Compiling getrandom v0.4.1 [INFO] [stderr] Checking symphonia-core v0.5.5 [INFO] [stderr] Checking scoped-tls v1.0.1 [INFO] [stderr] Checking downcast-rs v1.2.1 [INFO] [stderr] Compiling rustix v1.1.3 [INFO] [stderr] Compiling cc v1.2.55 [INFO] [stderr] Compiling x11-dl v2.21.0 [INFO] [stderr] Checking linux-raw-sys v0.11.0 [INFO] [stderr] Compiling syn v2.0.115 [INFO] [stderr] Compiling cpal v0.15.3 [INFO] [stderr] Compiling wayland-scanner v0.29.5 [INFO] [stderr] Checking miniz_oxide v0.8.9 [INFO] [stderr] Checking symphonia-metadata v0.5.5 [INFO] [stderr] Checking ogg v0.8.0 [INFO] [stderr] Checking symphonia-bundle-mp3 v0.5.5 [INFO] [stderr] Compiling minifb v0.27.0 [INFO] [stderr] Checking vec_map v0.8.2 [INFO] [stderr] Checking nix v0.24.3 [INFO] [stderr] Checking inotify-sys v0.1.5 [INFO] [stderr] Checking inotify v0.11.0 [INFO] [stderr] Checking xcursor v0.3.10 [INFO] [stderr] Checking alsa v0.9.1 [INFO] [stderr] Compiling wayland-client v0.29.5 [INFO] [stderr] Compiling wayland-protocols v0.29.5 [INFO] [stderr] Compiling gilrs v0.11.1 [INFO] [stderr] Checking uuid v1.20.0 [INFO] [stderr] Checking dasp_sample v0.11.0 [INFO] [stderr] Checking fastrand v2.3.0 [INFO] [stderr] Checking tempfile v3.25.0 [INFO] [stderr] Checking gilrs-core v0.6.7 [INFO] [stderr] Checking wayland-commons v0.29.5 [INFO] [stderr] Checking symphonia v0.5.5 [INFO] [stderr] Checking lewton v0.10.2 [INFO] [stderr] Checking hound v3.5.1 [INFO] [stderr] Checking claxon v0.4.3 [INFO] [stderr] Checking raw-window-handle v0.6.2 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Checking rodio v0.17.3 [INFO] [stderr] Checking wayland-cursor v0.29.5 [INFO] [stderr] Checking serde v1.0.228 [INFO] [stderr] Checking bincode v1.3.3 [INFO] [stderr] Checking arduboy-core v0.8.1 (/opt/rustwide/workdir/crates/core) [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> crates/core/src/peripherals/eeprom.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | / /// Read/write hooks are handled in Arduboy::read_data/write_data [INFO] [stdout] 12 | | [INFO] [stdout] | |_^ [INFO] [stdout] 13 | pub struct EepromCtrl; [INFO] [stdout] | --------------------- the comment documents this struct [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the comment should document the parent module use an inner doc comment [INFO] [stdout] | [INFO] [stdout] 8 ~ //! EEPROM control registers [INFO] [stdout] 9 ~ //! EECR = 0x3F, EEDR = 0x40, EEARL = 0x41, EEARH = 0x42 [INFO] [stdout] 10 ~ //! Actual EEPROM data is in Memory::eeprom [INFO] [stdout] 11 ~ //! Read/write hooks are handled in Arduboy::read_data/write_data [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> crates/core/src/peripherals/fx_flash.rs:14:1 [INFO] [stdout] | [INFO] [stdout] 14 | / /// - 0x20: Sector Erase (4KB) [INFO] [stdout] 15 | | [INFO] [stdout] | |_^ [INFO] [stdout] 16 | const FLASH_SIZE: usize = 16 * 1024 * 1024; // 16MB [INFO] [stdout] | ---------------- the comment documents this constant item [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the comment should document the parent module use an inner doc comment [INFO] [stdout] | [INFO] [stdout] 1 ~ //! W25Q128 SPI Flash emulation for Arduboy FX [INFO] [stdout] 2 ~ //! 16MB flash connected via SPI with CS on PD1 (Arduino D2) [INFO] [stdout] 3 ~ //! [INFO] [stdout] 4 ~ //! Supported commands: [INFO] [stdout] 5 ~ //! - 0x03: Read Data (addr24, then continuous read) [INFO] [stdout] 6 ~ //! - 0x0B: Fast Read (addr24 + dummy, then continuous read) [INFO] [stdout] 7 ~ //! - 0x9F: JEDEC ID → EF 40 18 (W25Q128) [INFO] [stdout] 8 ~ //! - 0xAB: Release Power Down / Device ID → returns device ID 0x17 [INFO] [stdout] 9 ~ //! - 0x05: Read Status Register 1 → 0x00 (not busy) [INFO] [stdout] 10 ~ //! - 0xB9: Power Down [INFO] [stdout] 11 ~ //! - 0x06: Write Enable [INFO] [stdout] 12 ~ //! - 0x04: Write Disable [INFO] [stdout] 13 ~ //! - 0x02: Page Program (addr24 + data) [INFO] [stdout] 14 ~ //! - 0x20: Sector Erase (4KB) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> crates/core/src/peripherals/eeprom.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | / /// Read/write hooks are handled in Arduboy::read_data/write_data [INFO] [stdout] 12 | | [INFO] [stdout] | |_^ [INFO] [stdout] 13 | pub struct EepromCtrl; [INFO] [stdout] | --------------------- the comment documents this struct [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the comment should document the parent module use an inner doc comment [INFO] [stdout] | [INFO] [stdout] 8 ~ //! EEPROM control registers [INFO] [stdout] 9 ~ //! EECR = 0x3F, EEDR = 0x40, EEARL = 0x41, EEARH = 0x42 [INFO] [stdout] 10 ~ //! Actual EEPROM data is in Memory::eeprom [INFO] [stdout] 11 ~ //! Read/write hooks are handled in Arduboy::read_data/write_data [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> crates/core/src/peripherals/fx_flash.rs:14:1 [INFO] [stdout] | [INFO] [stdout] 14 | / /// - 0x20: Sector Erase (4KB) [INFO] [stdout] 15 | | [INFO] [stdout] | |_^ [INFO] [stdout] 16 | const FLASH_SIZE: usize = 16 * 1024 * 1024; // 16MB [INFO] [stdout] | ---------------- the comment documents this constant item [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the comment should document the parent module use an inner doc comment [INFO] [stdout] | [INFO] [stdout] 1 ~ //! W25Q128 SPI Flash emulation for Arduboy FX [INFO] [stdout] 2 ~ //! 16MB flash connected via SPI with CS on PD1 (Arduino D2) [INFO] [stdout] 3 ~ //! [INFO] [stdout] 4 ~ //! Supported commands: [INFO] [stdout] 5 ~ //! - 0x03: Read Data (addr24, then continuous read) [INFO] [stdout] 6 ~ //! - 0x0B: Fast Read (addr24 + dummy, then continuous read) [INFO] [stdout] 7 ~ //! - 0x9F: JEDEC ID → EF 40 18 (W25Q128) [INFO] [stdout] 8 ~ //! - 0xAB: Release Power Down / Device ID → returns device ID 0x17 [INFO] [stdout] 9 ~ //! - 0x05: Read Status Register 1 → 0x00 (not busy) [INFO] [stdout] 10 ~ //! - 0xB9: Power Down [INFO] [stdout] 11 ~ //! - 0x06: Write Enable [INFO] [stdout] 12 ~ //! - 0x04: Write Disable [INFO] [stdout] 13 ~ //! - 0x02: Page Program (addr24 + data) [INFO] [stdout] 14 ~ //! - 0x20: Sector Erase (4KB) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Cpu` [INFO] [stdout] --> crates/core/src/cpu.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | / pub fn new() -> Self { [INFO] [stdout] 37 | | Cpu { pc: 0, sp: 0x0AFF, sreg: 0, tick: 0, sleeping: false } [INFO] [stdout] 38 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 35 + impl Default for Cpu { [INFO] [stdout] 36 + fn default() -> Self { [INFO] [stdout] 37 + Self::new() [INFO] [stdout] 38 + } [INFO] [stdout] 39 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> crates/core/src/cpu.rs:135:25 [INFO] [stdout] | [INFO] [stdout] 135 | let c = (self.cpu.sreg & 1) as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(self.cpu.sreg & 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: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> crates/core/src/cpu.rs:157:25 [INFO] [stdout] | [INFO] [stdout] 157 | let c = (self.cpu.sreg & 1) as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(self.cpu.sreg & 1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> crates/core/src/cpu.rs:167:25 [INFO] [stdout] | [INFO] [stdout] 167 | let c = (self.cpu.sreg & 1) as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(self.cpu.sreg & 1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> crates/core/src/cpu.rs:252:62 [INFO] [stdout] | [INFO] [stdout] 252 | let res = ((self.mem.reg(d) as i8 as i16) * (self.mem.reg(r) as u8 as i16)) as u16; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `self.mem.reg(r)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> crates/core/src/cpu.rs:263:28 [INFO] [stdout] | [INFO] [stdout] 263 | let z = if (res & 0xFFFF) == 0 { 1u8 } else { 0 }; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: consider reducing it to: `res` [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: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> crates/core/src/cpu.rs:313:25 [INFO] [stdout] | [INFO] [stdout] 313 | let c = (self.cpu.sreg & 1) as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(self.cpu.sreg & 1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: there is no need to manually implement bit rotation [INFO] [stdout] --> crates/core/src/cpu.rs:454:37 [INFO] [stdout] | [INFO] [stdout] 454 | self.mem.set_reg(d, (rd >> 4) | (rd << 4)); 1 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: this expression can be rewritten as: `rd.rotate_left(4)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_rotate [INFO] [stdout] = note: `#[warn(clippy::manual_rotate)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Ssd1306` [INFO] [stdout] --> crates/core/src/display.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | / pub fn new() -> Self { [INFO] [stdout] 55 | | Ssd1306 { [INFO] [stdout] 56 | | framebuffer: [0; FB_SIZE], [INFO] [stdout] 57 | | col: 0, [INFO] [stdout] ... | [INFO] [stdout] 72 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 53 + impl Default for Ssd1306 { [INFO] [stdout] 54 + fn default() -> Self { [INFO] [stdout] 55 + Self::new() [INFO] [stdout] 56 + } [INFO] [stdout] 57 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `pixels` [INFO] [stdout] --> crates/core/src/display.rs:219:18 [INFO] [stdout] | [INFO] [stdout] 219 | for i in 0..pixels.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 219 - for i in 0..pixels.len() { [INFO] [stdout] 219 + for (i, ) in pixels.iter_mut().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Pcd8544` [INFO] [stdout] --> crates/core/src/pcd8544.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | / pub fn new() -> Self { [INFO] [stdout] 41 | | let mut fb = [0u8; FB_SIZE]; [INFO] [stdout] 42 | | // Initialize alpha channel [INFO] [stdout] 43 | | for i in (3..FB_SIZE).step_by(4) { [INFO] [stdout] ... | [INFO] [stdout] 59 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 39 + impl Default for Pcd8544 { [INFO] [stdout] 40 + fn default() -> Self { [INFO] [stdout] 41 + Self::new() [INFO] [stdout] 42 + } [INFO] [stdout] 43 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/core/src/hex.rs:56:17 [INFO] [stdout] | [INFO] [stdout] 56 | / if byte_count >= 2 { [INFO] [stdout] 57 | | base_addr = (((bytes[4] as u32) << 8) | bytes[5] as u32) << 4; [INFO] [stdout] 58 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 54 ~ 0x02 [INFO] [stdout] 55 | // Extended segment address [INFO] [stdout] 56 ~ if byte_count >= 2 => { [INFO] [stdout] 57 | base_addr = (((bytes[4] as u32) << 8) | bytes[5] as u32) << 4; [INFO] [stdout] 58 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/core/src/hex.rs:65:17 [INFO] [stdout] | [INFO] [stdout] 65 | / if byte_count >= 2 { [INFO] [stdout] 66 | | base_addr = ((bytes[4] as u32) << 8 | bytes[5] as u32) << 16; [INFO] [stdout] 67 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 63 ~ 0x04 [INFO] [stdout] 64 | // Extended linear address [INFO] [stdout] 65 ~ if byte_count >= 2 => { [INFO] [stdout] 66 | base_addr = ((bytes[4] as u32) << 8 | bytes[5] as u32) << 16; [INFO] [stdout] 67 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> crates/core/src/hex.rs:86:8 [INFO] [stdout] | [INFO] [stdout] 86 | if chars.len() % 2 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `!chars.len().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] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Timer4` [INFO] [stdout] --> crates/core/src/peripherals/timer4.rs:58:5 [INFO] [stdout] | [INFO] [stdout] 58 | / pub fn new() -> Self { [INFO] [stdout] 59 | | Timer4 { [INFO] [stdout] 60 | | tcnt: 0, tc4h: 0, [INFO] [stdout] 61 | | ocr_a: 0, ocr_b: 0, ocr_c: 0xFF, ocr_d: 0, [INFO] [stdout] ... | [INFO] [stdout] 68 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 57 + impl Default for Timer4 { [INFO] [stdout] 58 + fn default() -> Self { [INFO] [stdout] 59 + Self::new() [INFO] [stdout] 60 + } [INFO] [stdout] 61 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> crates/core/src/peripherals/timer4.rs:141:16 [INFO] [stdout] | [INFO] [stdout] 141 | if freq >= 20.0 && freq <= 20000.0 { return freq; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(20.0..=20000.0).contains(&freq)` [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] --> crates/core/src/peripherals/timer4.rs:148:20 [INFO] [stdout] | [INFO] [stdout] 148 | if freq >= 20.0 && freq <= 20000.0 { return freq; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(20.0..=20000.0).contains(&freq)` [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: this OR pattern can be rewritten using a range [INFO] [stdout] --> crates/core/src/peripherals/timer4.rs:249:13 [INFO] [stdout] | [INFO] [stdout] 249 | 0xC5 | 0xC6 | 0xC7 => true, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `0xC5..=0xC7` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns [INFO] [stdout] = note: `#[warn(clippy::manual_range_patterns)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Spi` [INFO] [stdout] --> crates/core/src/peripherals/spi.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | / pub fn new() -> Self { [INFO] [stdout] 25 | | Spi { spif: false, wcol: false, spi2x: false, spie: false, spe: false } [INFO] [stdout] 26 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 23 + impl Default for Spi { [INFO] [stdout] 24 + fn default() -> Self { [INFO] [stdout] 25 + Self::new() [INFO] [stdout] 26 + } [INFO] [stdout] 27 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `EepromCtrl` [INFO] [stdout] --> crates/core/src/peripherals/eeprom.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | pub fn new() -> Self { EepromCtrl } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 15 + impl Default for EepromCtrl { [INFO] [stdout] 16 + fn default() -> Self { [INFO] [stdout] 17 + Self::new() [INFO] [stdout] 18 + } [INFO] [stdout] 19 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Adc` [INFO] [stdout] --> crates/core/src/peripherals/adc.rs:25:5 [INFO] [stdout] | [INFO] [stdout] 25 | / pub fn new() -> Self { [INFO] [stdout] 26 | | Adc { [INFO] [stdout] 27 | | aden: false, adsc: false, adie: false, adif: false, [INFO] [stdout] 28 | | adch: 0, adcl: 0, [INFO] [stdout] 29 | | } [INFO] [stdout] 30 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 24 + impl Default for Adc { [INFO] [stdout] 25 + fn default() -> Self { [INFO] [stdout] 26 + Self::new() [INFO] [stdout] 27 + } [INFO] [stdout] 28 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Pll` [INFO] [stdout] --> crates/core/src/peripherals/pll.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | / pub fn new() -> Self { [INFO] [stdout] 16 | | Pll { pindiv: false, plle: false, plock: false } [INFO] [stdout] 17 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 14 + impl Default for Pll { [INFO] [stdout] 15 + fn default() -> Self { [INFO] [stdout] 16 + Self::new() [INFO] [stdout] 17 + } [INFO] [stdout] 18 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `FxFlash` [INFO] [stdout] --> crates/core/src/peripherals/fx_flash.rs:52:5 [INFO] [stdout] | [INFO] [stdout] 52 | / pub fn new() -> Self { [INFO] [stdout] 53 | | FxFlash { [INFO] [stdout] 54 | | data: Vec::new(), // Lazy: only allocate when data is loaded [INFO] [stdout] 55 | | state: FxState::Idle, [INFO] [stdout] ... | [INFO] [stdout] 60 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 51 + impl Default for FxFlash { [INFO] [stdout] 52 + fn default() -> Self { [INFO] [stdout] 53 + Self::new() [INFO] [stdout] 54 + } [INFO] [stdout] 55 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ChannelBuffer` [INFO] [stdout] --> crates/core/src/audio_buffer.rs:64:5 [INFO] [stdout] | [INFO] [stdout] 64 | / pub fn new() -> Self { [INFO] [stdout] 65 | | ChannelBuffer { edges: Vec::with_capacity(4096), level: false } [INFO] [stdout] 66 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 63 + impl Default for ChannelBuffer { [INFO] [stdout] 64 + fn default() -> Self { [INFO] [stdout] 65 + Self::new() [INFO] [stdout] 66 + } [INFO] [stdout] 67 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ChannelBuffer` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> crates/core/src/audio_buffer.rs:83:5 [INFO] [stdout] | [INFO] [stdout] 83 | pub fn len(&self) -> usize { self.edges.len() } [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: you should consider adding a `Default` implementation for `AudioBuffer` [INFO] [stdout] --> crates/core/src/audio_buffer.rs:193:5 [INFO] [stdout] | [INFO] [stdout] 193 | / pub fn new() -> Self { [INFO] [stdout] 194 | | // Initialize filters with default 44100 Hz; reconfigured on first render [INFO] [stdout] 195 | | let sr = 44100.0; [INFO] [stdout] 196 | | AudioBuffer { [INFO] [stdout] ... | [INFO] [stdout] 213 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 192 + impl Default for AudioBuffer { [INFO] [stdout] 193 + fn default() -> Self { [INFO] [stdout] 194 + Self::new() [INFO] [stdout] 195 + } [INFO] [stdout] 196 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> crates/core/src/arduboy_file.rs:34:5 [INFO] [stdout] | [INFO] [stdout] 34 | result.files = files.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `arduboy_file::ArduboyFile { files: files.clone(), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> crates/core/src/arduboy_file.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | let mut result = ArduboyFile::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/core/src/profiler.rs:92:9 [INFO] [stdout] | [INFO] [stdout] 92 | v.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 92 - v.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 92 + v.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/core/src/profiler.rs:101:9 [INFO] [stdout] | [INFO] [stdout] 101 | v.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 101 - v.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 101 + v.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/core/src/profiler.rs:131:9 [INFO] [stdout] | [INFO] [stdout] 131 | ranges.sort_by(|a, b| b.2.cmp(&a.2)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 131 - ranges.sort_by(|a, b| b.2.cmp(&a.2)); [INFO] [stdout] 131 + ranges.sort_by_key(|b| std::cmp::Reverse(b.2)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/core/src/profiler.rs:138:21 [INFO] [stdout] | [INFO] [stdout] 138 | s.push_str(&format!("=== Profiler Report ===\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"=== Profiler Report ===\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/core/src/profiler.rs:147:21 [INFO] [stdout] | [INFO] [stdout] 147 | s.push_str(&format!("\n--- Top 20 Hotspots ---\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"\n--- Top 20 Hotspots ---\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/core/src/profiler.rs:167:25 [INFO] [stdout] | [INFO] [stdout] 167 | s.push_str(&format!("\n--- Top 10 Call Edges ---\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"\n--- Top 10 Call Edges ---\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/core/src/profiler.rs:176:25 [INFO] [stdout] | [INFO] [stdout] 176 | s.push_str(&format!("\n--- Top 10 Hot Regions ---\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"\n--- Top 10 Hot Regions ---\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `data` [INFO] [stdout] --> crates/core/src/debugger.rs:163:18 [INFO] [stdout] | [INFO] [stdout] 163 | for i in addr..addr + 16 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 163 - for i in addr..addr + 16 { [INFO] [stdout] 163 + for (i, ) in data.iter().enumerate().skip(addr).take(16) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Cpu` [INFO] [stdout] --> crates/core/src/cpu.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | / pub fn new() -> Self { [INFO] [stdout] 37 | | Cpu { pc: 0, sp: 0x0AFF, sreg: 0, tick: 0, sleeping: false } [INFO] [stdout] 38 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 35 + impl Default for Cpu { [INFO] [stdout] 36 + fn default() -> Self { [INFO] [stdout] 37 + Self::new() [INFO] [stdout] 38 + } [INFO] [stdout] 39 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `data` [INFO] [stdout] --> crates/core/src/debugger.rs:173:18 [INFO] [stdout] | [INFO] [stdout] 173 | for i in addr..line_end { [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] 173 - for i in addr..line_end { [INFO] [stdout] 173 + for in data.iter().take(line_end).skip(addr) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> crates/core/src/debugger.rs:175:16 [INFO] [stdout] | [INFO] [stdout] 175 | if c >= 0x20 && c < 0x7F { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: use: `(0x20..0x7F).contains(&c)` [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: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> crates/core/src/cpu.rs:135:25 [INFO] [stdout] | [INFO] [stdout] 135 | let c = (self.cpu.sreg & 1) as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(self.cpu.sreg & 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: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> crates/core/src/cpu.rs:157:25 [INFO] [stdout] | [INFO] [stdout] 157 | let c = (self.cpu.sreg & 1) as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(self.cpu.sreg & 1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> crates/core/src/cpu.rs:167:25 [INFO] [stdout] | [INFO] [stdout] 167 | let c = (self.cpu.sreg & 1) as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(self.cpu.sreg & 1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> crates/core/src/cpu.rs:252:62 [INFO] [stdout] | [INFO] [stdout] 252 | let res = ((self.mem.reg(d) as i8 as i16) * (self.mem.reg(r) as u8 as i16)) as u16; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `self.mem.reg(r)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> crates/core/src/cpu.rs:263:28 [INFO] [stdout] | [INFO] [stdout] 263 | let z = if (res & 0xFFFF) == 0 { 1u8 } else { 0 }; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: consider reducing it to: `res` [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: casting to the same type is unnecessary (`u8` -> `u8`) [INFO] [stdout] --> crates/core/src/cpu.rs:313:25 [INFO] [stdout] | [INFO] [stdout] 313 | let c = (self.cpu.sreg & 1) as u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(self.cpu.sreg & 1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> crates/core/src/gdb_server.rs:210:32 [INFO] [stdout] | [INFO] [stdout] 210 | ... if a >= 0x800000 && a < 0x810000 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0x800000..0x810000).contains(&a)` [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: redundant slicing of the whole range [INFO] [stdout] --> crates/core/src/gdb_server.rs:239:49 [INFO] [stdout] | [INFO] [stdout] 239 | let bp_type = parse_hex_u32(&parts[0][..]).unwrap_or(0); [INFO] [stdout] | ^^^^^^^^^^^^^ help: use the original value instead: `parts[0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing [INFO] [stdout] = note: `#[warn(clippy::redundant_slicing)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this OR pattern can be rewritten using a range [INFO] [stdout] --> crates/core/src/gdb_server.rs:250:25 [INFO] [stdout] | [INFO] [stdout] 250 | 2 | 3 | 4 => { [INFO] [stdout] | ^^^^^^^^^ help: try: `2..=4` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant slicing of the whole range [INFO] [stdout] --> crates/core/src/gdb_server.rs:266:49 [INFO] [stdout] | [INFO] [stdout] 266 | let bp_type = parse_hex_u32(&parts[0][..]).unwrap_or(0); [INFO] [stdout] | ^^^^^^^^^^^^^ help: use the original value instead: `parts[0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this OR pattern can be rewritten using a range [INFO] [stdout] --> crates/core/src/gdb_server.rs:274:25 [INFO] [stdout] | [INFO] [stdout] 274 | 2 | 3 | 4 => { [INFO] [stdout] | ^^^^^^^^^ help: try: `2..=4` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: there is no need to manually implement bit rotation [INFO] [stdout] --> crates/core/src/cpu.rs:454:37 [INFO] [stdout] | [INFO] [stdout] 454 | self.mem.set_reg(d, (rd >> 4) | (rd << 4)); 1 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: this expression can be rewritten as: `rd.rotate_left(4)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_rotate [INFO] [stdout] = note: `#[warn(clippy::manual_rotate)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> crates/core/src/elf.rs:242:12 [INFO] [stdout] | [INFO] [stdout] 242 | if version < 2 || version > 4 { pos = unit_end; continue; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(2..=4).contains(&version)` [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: the loop variable `j` is only used to index `std_lens` [INFO] [stdout] --> crates/core/src/elf.rs:257:18 [INFO] [stdout] | [INFO] [stdout] 257 | for j in 1..(opcode_base as usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 257 - for j in 1..(opcode_base as usize) { [INFO] [stdout] 257 + for in std_lens.iter_mut().take((opcode_base as usize)).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Ssd1306` [INFO] [stdout] --> crates/core/src/display.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | / pub fn new() -> Self { [INFO] [stdout] 55 | | Ssd1306 { [INFO] [stdout] 56 | | framebuffer: [0; FB_SIZE], [INFO] [stdout] 57 | | col: 0, [INFO] [stdout] ... | [INFO] [stdout] 72 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 53 + impl Default for Ssd1306 { [INFO] [stdout] 54 + fn default() -> Self { [INFO] [stdout] 55 + Self::new() [INFO] [stdout] 56 + } [INFO] [stdout] 57 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `pixels` [INFO] [stdout] --> crates/core/src/display.rs:219:18 [INFO] [stdout] | [INFO] [stdout] 219 | for i in 0..pixels.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 219 - for i in 0..pixels.len() { [INFO] [stdout] 219 + for (i, ) in pixels.iter_mut().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Pcd8544` [INFO] [stdout] --> crates/core/src/pcd8544.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | / pub fn new() -> Self { [INFO] [stdout] 41 | | let mut fb = [0u8; FB_SIZE]; [INFO] [stdout] 42 | | // Initialize alpha channel [INFO] [stdout] 43 | | for i in (3..FB_SIZE).step_by(4) { [INFO] [stdout] ... | [INFO] [stdout] 59 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 39 + impl Default for Pcd8544 { [INFO] [stdout] 40 + fn default() -> Self { [INFO] [stdout] 41 + Self::new() [INFO] [stdout] 42 + } [INFO] [stdout] 43 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/core/src/hex.rs:56:17 [INFO] [stdout] | [INFO] [stdout] 56 | / if byte_count >= 2 { [INFO] [stdout] 57 | | base_addr = (((bytes[4] as u32) << 8) | bytes[5] as u32) << 4; [INFO] [stdout] 58 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 54 ~ 0x02 [INFO] [stdout] 55 | // Extended segment address [INFO] [stdout] 56 ~ if byte_count >= 2 => { [INFO] [stdout] 57 | base_addr = (((bytes[4] as u32) << 8) | bytes[5] as u32) << 4; [INFO] [stdout] 58 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/core/src/hex.rs:65:17 [INFO] [stdout] | [INFO] [stdout] 65 | / if byte_count >= 2 { [INFO] [stdout] 66 | | base_addr = ((bytes[4] as u32) << 8 | bytes[5] as u32) << 16; [INFO] [stdout] 67 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 63 ~ 0x04 [INFO] [stdout] 64 | // Extended linear address [INFO] [stdout] 65 ~ if byte_count >= 2 => { [INFO] [stdout] 66 | base_addr = ((bytes[4] as u32) << 8 | bytes[5] as u32) << 16; [INFO] [stdout] 67 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> crates/core/src/hex.rs:86:8 [INFO] [stdout] | [INFO] [stdout] 86 | if chars.len() % 2 != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace with: `!chars.len().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] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Timer4` [INFO] [stdout] --> crates/core/src/peripherals/timer4.rs:58:5 [INFO] [stdout] | [INFO] [stdout] 58 | / pub fn new() -> Self { [INFO] [stdout] 59 | | Timer4 { [INFO] [stdout] 60 | | tcnt: 0, tc4h: 0, [INFO] [stdout] 61 | | ocr_a: 0, ocr_b: 0, ocr_c: 0xFF, ocr_d: 0, [INFO] [stdout] ... | [INFO] [stdout] 68 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 57 + impl Default for Timer4 { [INFO] [stdout] 58 + fn default() -> Self { [INFO] [stdout] 59 + Self::new() [INFO] [stdout] 60 + } [INFO] [stdout] 61 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> crates/core/src/peripherals/timer4.rs:141:16 [INFO] [stdout] | [INFO] [stdout] 141 | if freq >= 20.0 && freq <= 20000.0 { return freq; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(20.0..=20000.0).contains(&freq)` [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] --> crates/core/src/peripherals/timer4.rs:148:20 [INFO] [stdout] | [INFO] [stdout] 148 | if freq >= 20.0 && freq <= 20000.0 { return freq; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(20.0..=20000.0).contains(&freq)` [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: this OR pattern can be rewritten using a range [INFO] [stdout] --> crates/core/src/peripherals/timer4.rs:249:13 [INFO] [stdout] | [INFO] [stdout] 249 | 0xC5 | 0xC6 | 0xC7 => true, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `0xC5..=0xC7` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns [INFO] [stdout] = note: `#[warn(clippy::manual_range_patterns)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Spi` [INFO] [stdout] --> crates/core/src/peripherals/spi.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | / pub fn new() -> Self { [INFO] [stdout] 25 | | Spi { spif: false, wcol: false, spi2x: false, spie: false, spe: false } [INFO] [stdout] 26 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 23 + impl Default for Spi { [INFO] [stdout] 24 + fn default() -> Self { [INFO] [stdout] 25 + Self::new() [INFO] [stdout] 26 + } [INFO] [stdout] 27 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `EepromCtrl` [INFO] [stdout] --> crates/core/src/peripherals/eeprom.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | pub fn new() -> Self { EepromCtrl } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 15 + impl Default for EepromCtrl { [INFO] [stdout] 16 + fn default() -> Self { [INFO] [stdout] 17 + Self::new() [INFO] [stdout] 18 + } [INFO] [stdout] 19 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Adc` [INFO] [stdout] --> crates/core/src/peripherals/adc.rs:25:5 [INFO] [stdout] | [INFO] [stdout] 25 | / pub fn new() -> Self { [INFO] [stdout] 26 | | Adc { [INFO] [stdout] 27 | | aden: false, adsc: false, adie: false, adif: false, [INFO] [stdout] 28 | | adch: 0, adcl: 0, [INFO] [stdout] 29 | | } [INFO] [stdout] 30 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 24 + impl Default for Adc { [INFO] [stdout] 25 + fn default() -> Self { [INFO] [stdout] 26 + Self::new() [INFO] [stdout] 27 + } [INFO] [stdout] 28 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Pll` [INFO] [stdout] --> crates/core/src/peripherals/pll.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 15 | / pub fn new() -> Self { [INFO] [stdout] 16 | | Pll { pindiv: false, plle: false, plock: false } [INFO] [stdout] 17 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 14 + impl Default for Pll { [INFO] [stdout] 15 + fn default() -> Self { [INFO] [stdout] 16 + Self::new() [INFO] [stdout] 17 + } [INFO] [stdout] 18 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `FxFlash` [INFO] [stdout] --> crates/core/src/peripherals/fx_flash.rs:52:5 [INFO] [stdout] | [INFO] [stdout] 52 | / pub fn new() -> Self { [INFO] [stdout] 53 | | FxFlash { [INFO] [stdout] 54 | | data: Vec::new(), // Lazy: only allocate when data is loaded [INFO] [stdout] 55 | | state: FxState::Idle, [INFO] [stdout] ... | [INFO] [stdout] 60 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 51 + impl Default for FxFlash { [INFO] [stdout] 52 + fn default() -> Self { [INFO] [stdout] 53 + Self::new() [INFO] [stdout] 54 + } [INFO] [stdout] 55 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ChannelBuffer` [INFO] [stdout] --> crates/core/src/audio_buffer.rs:64:5 [INFO] [stdout] | [INFO] [stdout] 64 | / pub fn new() -> Self { [INFO] [stdout] 65 | | ChannelBuffer { edges: Vec::with_capacity(4096), level: false } [INFO] [stdout] 66 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 63 + impl Default for ChannelBuffer { [INFO] [stdout] 64 + fn default() -> Self { [INFO] [stdout] 65 + Self::new() [INFO] [stdout] 66 + } [INFO] [stdout] 67 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ChannelBuffer` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> crates/core/src/audio_buffer.rs:83:5 [INFO] [stdout] | [INFO] [stdout] 83 | pub fn len(&self) -> usize { self.edges.len() } [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: you should consider adding a `Default` implementation for `AudioBuffer` [INFO] [stdout] --> crates/core/src/audio_buffer.rs:193:5 [INFO] [stdout] | [INFO] [stdout] 193 | / pub fn new() -> Self { [INFO] [stdout] 194 | | // Initialize filters with default 44100 Hz; reconfigured on first render [INFO] [stdout] 195 | | let sr = 44100.0; [INFO] [stdout] 196 | | AudioBuffer { [INFO] [stdout] ... | [INFO] [stdout] 213 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 192 + impl Default for AudioBuffer { [INFO] [stdout] 193 + fn default() -> Self { [INFO] [stdout] 194 + Self::new() [INFO] [stdout] 195 + } [INFO] [stdout] 196 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> crates/core/src/arduboy_file.rs:34:5 [INFO] [stdout] | [INFO] [stdout] 34 | result.files = files.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `arduboy_file::ArduboyFile { files: files.clone(), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> crates/core/src/arduboy_file.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | let mut result = ArduboyFile::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> crates/core/src/lib.rs:449:13 [INFO] [stdout] | [INFO] [stdout] 449 | ((save_len + 4095) / 4096) * 16 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `save_len.div_ceil(4096)` [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: manually reimplementing `div_ceil` [INFO] [stdout] --> crates/core/src/lib.rs:454:26 [INFO] [stdout] | [INFO] [stdout] 454 | let data_pages = (data.len() + 255) / 256; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `data.len().div_ceil(256)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/core/src/profiler.rs:92:9 [INFO] [stdout] | [INFO] [stdout] 92 | v.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 92 - v.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 92 + v.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/core/src/profiler.rs:101:9 [INFO] [stdout] | [INFO] [stdout] 101 | v.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 101 - v.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 101 + v.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/core/src/profiler.rs:131:9 [INFO] [stdout] | [INFO] [stdout] 131 | ranges.sort_by(|a, b| b.2.cmp(&a.2)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 131 - ranges.sort_by(|a, b| b.2.cmp(&a.2)); [INFO] [stdout] 131 + ranges.sort_by_key(|b| std::cmp::Reverse(b.2)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/core/src/profiler.rs:138:21 [INFO] [stdout] | [INFO] [stdout] 138 | s.push_str(&format!("=== Profiler Report ===\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"=== Profiler Report ===\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/core/src/profiler.rs:147:21 [INFO] [stdout] | [INFO] [stdout] 147 | s.push_str(&format!("\n--- Top 20 Hotspots ---\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"\n--- Top 20 Hotspots ---\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/core/src/lib.rs:678:17 [INFO] [stdout] | [INFO] [stdout] 678 | top.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 678 - top.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 678 + top.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/core/src/profiler.rs:167:25 [INFO] [stdout] | [INFO] [stdout] 167 | s.push_str(&format!("\n--- Top 10 Call Edges ---\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"\n--- Top 10 Call Edges ---\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/core/src/profiler.rs:176:25 [INFO] [stdout] | [INFO] [stdout] 176 | s.push_str(&format!("\n--- Top 10 Hot Regions ---\n")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"\n--- Top 10 Hot Regions ---\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `data` [INFO] [stdout] --> crates/core/src/debugger.rs:163:18 [INFO] [stdout] | [INFO] [stdout] 163 | for i in addr..addr + 16 { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 163 - for i in addr..addr + 16 { [INFO] [stdout] 163 + for (i, ) in data.iter().enumerate().skip(addr).take(16) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `data` [INFO] [stdout] --> crates/core/src/debugger.rs:173:18 [INFO] [stdout] | [INFO] [stdout] 173 | for i in addr..line_end { [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] 173 - for i in addr..line_end { [INFO] [stdout] 173 + for in data.iter().take(line_end).skip(addr) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> crates/core/src/debugger.rs:175:16 [INFO] [stdout] | [INFO] [stdout] 175 | if c >= 0x20 && c < 0x7F { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: use: `(0x20..0x7F).contains(&c)` [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 `RangeInclusive::contains` implementation [INFO] [stdout] --> crates/core/src/lib.rs:1009:36 [INFO] [stdout] | [INFO] [stdout] 1009 | ... if half >= 400 && half <= 270000 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(400..=270000).contains(&half)` [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 `RangeInclusive::contains` implementation [INFO] [stdout] --> crates/core/src/lib.rs:1049:36 [INFO] [stdout] | [INFO] [stdout] 1049 | ... if half >= 400 && half <= 270000 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(400..=270000).contains(&half)` [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 `RangeInclusive::contains` implementation [INFO] [stdout] --> crates/core/src/lib.rs:1080:32 [INFO] [stdout] | [INFO] [stdout] 1080 | ... if half >= 400 && half <= 270000 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(400..=270000).contains(&half)` [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: this `if` statement can be collapsed [INFO] [stdout] --> crates/core/src/lib.rs:1151:9 [INFO] [stdout] | [INFO] [stdout] 1151 | / if self.cpu_type == CpuType::Atmega32u4 { [INFO] [stdout] 1152 | | if self.timer4.write(addr, value) { [INFO] [stdout] 1153 | | if a < self.mem.data.len() { self.mem.data[a] = value; } [INFO] [stdout] 1154 | | return; [INFO] [stdout] 1155 | | } [INFO] [stdout] 1156 | | } [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] 1151 ~ if self.cpu_type == CpuType::Atmega32u4 [INFO] [stdout] 1152 ~ && self.timer4.write(addr, value) { [INFO] [stdout] 1153 | if a < self.mem.data.len() { self.mem.data[a] = value; } [INFO] [stdout] 1154 | return; [INFO] [stdout] 1155 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> crates/core/src/lib.rs:1330:37 [INFO] [stdout] | [INFO] [stdout] 1330 | let ch = if value >= 0x20 && value < 0x7F { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0x20..0x7F).contains(&value)` [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: this `if` statement can be collapsed [INFO] [stdout] --> crates/core/src/lib.rs:1427:25 [INFO] [stdout] | [INFO] [stdout] 1427 | / if ardu_cs_active && ardu_dc_cmd { [INFO] [stdout] 1428 | | if byte >= 0x80 { [INFO] [stdout] 1429 | | self.display_type = DisplayType::Ssd1306; [INFO] [stdout] 1430 | | if self.debug { [INFO] [stdout] ... | [INFO] [stdout] 1434 | | } [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] 1427 ~ if ardu_cs_active && ardu_dc_cmd [INFO] [stdout] 1428 ~ && byte >= 0x80 { [INFO] [stdout] 1429 | self.display_type = DisplayType::Ssd1306; [INFO] [stdout] ... [INFO] [stdout] 1432 | } [INFO] [stdout] 1433 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> crates/core/src/lib.rs:1435:25 [INFO] [stdout] | [INFO] [stdout] 1435 | / if self.display_type == DisplayType::Unknown && gb_cs_active && gb_dc_cmd { [INFO] [stdout] 1436 | | if byte == 0x21 || byte == 0x20 { [INFO] [stdout] 1437 | | self.display_type = DisplayType::Pcd8544; [INFO] [stdout] 1438 | | if self.debug { [INFO] [stdout] ... | [INFO] [stdout] 1442 | | } [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] 1435 ~ if self.display_type == DisplayType::Unknown && gb_cs_active && gb_dc_cmd [INFO] [stdout] 1436 ~ && (byte == 0x21 || byte == 0x20) { [INFO] [stdout] 1437 | self.display_type = DisplayType::Pcd8544; [INFO] [stdout] ... [INFO] [stdout] 1440 | } [INFO] [stdout] 1441 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> crates/core/src/lib.rs:1593:17 [INFO] [stdout] | [INFO] [stdout] 1593 | return; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1592 - self.do_interrupt(vec_addr); [INFO] [stdout] 1593 - return; [INFO] [stdout] 1592 + self.do_interrupt(vec_addr); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> crates/core/src/gdb_server.rs:210:32 [INFO] [stdout] | [INFO] [stdout] 210 | ... if a >= 0x800000 && a < 0x810000 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0x800000..0x810000).contains(&a)` [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: redundant slicing of the whole range [INFO] [stdout] --> crates/core/src/gdb_server.rs:239:49 [INFO] [stdout] | [INFO] [stdout] 239 | let bp_type = parse_hex_u32(&parts[0][..]).unwrap_or(0); [INFO] [stdout] | ^^^^^^^^^^^^^ help: use the original value instead: `parts[0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing [INFO] [stdout] = note: `#[warn(clippy::redundant_slicing)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this OR pattern can be rewritten using a range [INFO] [stdout] --> crates/core/src/gdb_server.rs:250:25 [INFO] [stdout] | [INFO] [stdout] 250 | 2 | 3 | 4 => { [INFO] [stdout] | ^^^^^^^^^ help: try: `2..=4` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant slicing of the whole range [INFO] [stdout] --> crates/core/src/gdb_server.rs:266:49 [INFO] [stdout] | [INFO] [stdout] 266 | let bp_type = parse_hex_u32(&parts[0][..]).unwrap_or(0); [INFO] [stdout] | ^^^^^^^^^^^^^ help: use the original value instead: `parts[0]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_slicing [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this OR pattern can be rewritten using a range [INFO] [stdout] --> crates/core/src/gdb_server.rs:274:25 [INFO] [stdout] | [INFO] [stdout] 274 | 2 | 3 | 4 => { [INFO] [stdout] | ^^^^^^^^^ help: try: `2..=4` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32768]` which implements the `Copy` trait [INFO] [stdout] --> crates/core/src/lib.rs:1702:37 [INFO] [stdout] | [INFO] [stdout] 1702 | DisplayType::Pcd8544 => self.pcd8544.framebuffer.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.pcd8544.framebuffer` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32768]` which implements the `Copy` trait [INFO] [stdout] --> crates/core/src/lib.rs:1703:18 [INFO] [stdout] | [INFO] [stdout] 1703 | _ => self.display.framebuffer.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.display.framebuffer` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `!RangeInclusive::contains` implementation [INFO] [stdout] --> crates/core/src/elf.rs:242:12 [INFO] [stdout] | [INFO] [stdout] 242 | if version < 2 || version > 4 { pos = unit_end; continue; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `!(2..=4).contains(&version)` [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: the loop variable `j` is only used to index `std_lens` [INFO] [stdout] --> crates/core/src/elf.rs:257:18 [INFO] [stdout] | [INFO] [stdout] 257 | for j in 1..(opcode_base as usize) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 257 - for j in 1..(opcode_base as usize) { [INFO] [stdout] 257 + for in std_lens.iter_mut().take((opcode_base as usize)).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> crates/core/src/lib.rs:449:13 [INFO] [stdout] | [INFO] [stdout] 449 | ((save_len + 4095) / 4096) * 16 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `save_len.div_ceil(4096)` [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: manually reimplementing `div_ceil` [INFO] [stdout] --> crates/core/src/lib.rs:454:26 [INFO] [stdout] | [INFO] [stdout] 454 | let data_pages = (data.len() + 255) / 256; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `data.len().div_ceil(256)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/core/src/lib.rs:678:17 [INFO] [stdout] | [INFO] [stdout] 678 | top.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 678 - top.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 678 + top.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> crates/core/src/lib.rs:1009:36 [INFO] [stdout] | [INFO] [stdout] 1009 | ... if half >= 400 && half <= 270000 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(400..=270000).contains(&half)` [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 `RangeInclusive::contains` implementation [INFO] [stdout] --> crates/core/src/lib.rs:1049:36 [INFO] [stdout] | [INFO] [stdout] 1049 | ... if half >= 400 && half <= 270000 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(400..=270000).contains(&half)` [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 `RangeInclusive::contains` implementation [INFO] [stdout] --> crates/core/src/lib.rs:1080:32 [INFO] [stdout] | [INFO] [stdout] 1080 | ... if half >= 400 && half <= 270000 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(400..=270000).contains(&half)` [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: this `if` statement can be collapsed [INFO] [stdout] --> crates/core/src/lib.rs:1151:9 [INFO] [stdout] | [INFO] [stdout] 1151 | / if self.cpu_type == CpuType::Atmega32u4 { [INFO] [stdout] 1152 | | if self.timer4.write(addr, value) { [INFO] [stdout] 1153 | | if a < self.mem.data.len() { self.mem.data[a] = value; } [INFO] [stdout] 1154 | | return; [INFO] [stdout] 1155 | | } [INFO] [stdout] 1156 | | } [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] 1151 ~ if self.cpu_type == CpuType::Atmega32u4 [INFO] [stdout] 1152 ~ && self.timer4.write(addr, value) { [INFO] [stdout] 1153 | if a < self.mem.data.len() { self.mem.data[a] = value; } [INFO] [stdout] 1154 | return; [INFO] [stdout] 1155 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> crates/core/src/lib.rs:1330:37 [INFO] [stdout] | [INFO] [stdout] 1330 | let ch = if value >= 0x20 && value < 0x7F { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0x20..0x7F).contains(&value)` [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: this `if` statement can be collapsed [INFO] [stdout] --> crates/core/src/lib.rs:1427:25 [INFO] [stdout] | [INFO] [stdout] 1427 | / if ardu_cs_active && ardu_dc_cmd { [INFO] [stdout] 1428 | | if byte >= 0x80 { [INFO] [stdout] 1429 | | self.display_type = DisplayType::Ssd1306; [INFO] [stdout] 1430 | | if self.debug { [INFO] [stdout] ... | [INFO] [stdout] 1434 | | } [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] 1427 ~ if ardu_cs_active && ardu_dc_cmd [INFO] [stdout] 1428 ~ && byte >= 0x80 { [INFO] [stdout] 1429 | self.display_type = DisplayType::Ssd1306; [INFO] [stdout] ... [INFO] [stdout] 1432 | } [INFO] [stdout] 1433 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> crates/core/src/lib.rs:1435:25 [INFO] [stdout] | [INFO] [stdout] 1435 | / if self.display_type == DisplayType::Unknown && gb_cs_active && gb_dc_cmd { [INFO] [stdout] 1436 | | if byte == 0x21 || byte == 0x20 { [INFO] [stdout] 1437 | | self.display_type = DisplayType::Pcd8544; [INFO] [stdout] 1438 | | if self.debug { [INFO] [stdout] ... | [INFO] [stdout] 1442 | | } [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] 1435 ~ if self.display_type == DisplayType::Unknown && gb_cs_active && gb_dc_cmd [INFO] [stdout] 1436 ~ && (byte == 0x21 || byte == 0x20) { [INFO] [stdout] 1437 | self.display_type = DisplayType::Pcd8544; [INFO] [stdout] ... [INFO] [stdout] 1440 | } [INFO] [stdout] 1441 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> crates/core/src/lib.rs:1593:17 [INFO] [stdout] | [INFO] [stdout] 1593 | return; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1592 - self.do_interrupt(vec_addr); [INFO] [stdout] 1593 - return; [INFO] [stdout] 1592 + self.do_interrupt(vec_addr); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32768]` which implements the `Copy` trait [INFO] [stdout] --> crates/core/src/lib.rs:1702:37 [INFO] [stdout] | [INFO] [stdout] 1702 | DisplayType::Pcd8544 => self.pcd8544.framebuffer.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.pcd8544.framebuffer` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `[u8; 32768]` which implements the `Copy` trait [INFO] [stdout] --> crates/core/src/lib.rs:1703:18 [INFO] [stdout] | [INFO] [stdout] 1703 | _ => self.display.framebuffer.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.display.framebuffer` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking arduboy-frontend v0.8.1 (/opt/rustwide/workdir/crates/frontend-minifb) [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:189:17 [INFO] [stdout] | [INFO] [stdout] 189 | / if debug { [INFO] [stdout] 190 | | for (_, gp) in gilrs.gamepads() { [INFO] [stdout] 191 | | if gp.is_connected() { println!("Gamepad connected: \"{}\"", gp.name()); } [INFO] [stdout] 192 | | } [INFO] [stdout] 193 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 188 ~ EventType::Connected [INFO] [stdout] 189 ~ if debug => { [INFO] [stdout] 190 | for (_, gp) in gilrs.gamepads() { [INFO] [stdout] 191 | if gp.is_connected() { println!("Gamepad connected: \"{}\"", gp.name()); } [INFO] [stdout] 192 | } [INFO] [stdout] 193 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:219:16 [INFO] [stdout] | [INFO] [stdout] 219 | if raw % 2 == 0 { state.a = pressed; } else { state.b = pressed; } [INFO] [stdout] | ^^^^^^^^^^^^ help: replace with: `raw.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] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:229:32 [INFO] [stdout] | [INFO] [stdout] 229 | Axis::RightStickX => { if state.left_stick_x.abs() < 0.01 { state.left_stick_x = value; } } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 229 - Axis::RightStickX => { if state.left_stick_x.abs() < 0.01 { state.left_stick_x = value; } } [INFO] [stdout] 229 + Axis::RightStickX if state.left_stick_x.abs() < 0.01 => { state.left_stick_x = value; } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:230:32 [INFO] [stdout] | [INFO] [stdout] 230 | Axis::RightStickY => { if state.left_stick_y.abs() < 0.01 { state.left_stick_y = value; } } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 230 - Axis::RightStickY => { if state.left_stick_y.abs() < 0.01 { state.left_stick_y = value; } } [INFO] [stdout] 230 + Axis::RightStickY if state.left_stick_y.abs() < 0.01 => { state.left_stick_y = value; } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:422:5 [INFO] [stdout] | [INFO] [stdout] 422 | games.sort_by(|a, b| a.to_lowercase().cmp(&b.to_lowercase())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 422 - games.sort_by(|a, b| a.to_lowercase().cmp(&b.to_lowercase())); [INFO] [stdout] 422 + games.sort_by_key(|a| a.to_lowercase()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:559:32 [INFO] [stdout] | [INFO] [stdout] 559 | let initial_scale: usize = args.iter() [INFO] [stdout] | ________________________________^ [INFO] [stdout] 560 | | .position(|a| a == "--scale") [INFO] [stdout] 561 | | .and_then(|i| args.get(i + 1)) [INFO] [stdout] 562 | | .and_then(|s| s.parse().ok()) [INFO] [stdout] 563 | | .unwrap_or(6).max(1).min(6); [INFO] [stdout] | |___________________________________^ [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] help: replace with clamp [INFO] [stdout] | [INFO] [stdout] 559 ~ let initial_scale: usize = args.iter() [INFO] [stdout] 560 + .position(|a| a == "--scale") [INFO] [stdout] 561 + .and_then(|i| args.get(i + 1)) [INFO] [stdout] 562 + .and_then(|s| s.parse().ok()) [INFO] [stdout] 563 ~ .unwrap_or(6).clamp(1, 6); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:1300:55 [INFO] [stdout] | [INFO] [stdout] 1300 | ... let is_inner_corner = (sx == 0 && sy == 0) [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 1301 | | ... || (sx == 0 && sy == cur_scale - 1) [INFO] [stdout] 1302 | | ... || (sx == cur_scale - 1 && sy == 0) [INFO] [stdout] 1303 | | ... || (sx == cur_scale - 1 && sy == cur_scale - 1); [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] 1300 - let is_inner_corner = (sx == 0 && sy == 0) [INFO] [stdout] 1301 - || (sx == 0 && sy == cur_scale - 1) [INFO] [stdout] 1302 - || (sx == cur_scale - 1 && sy == 0) [INFO] [stdout] 1303 - || (sx == cur_scale - 1 && sy == cur_scale - 1); [INFO] [stdout] 1300 + let is_inner_corner = !(sy != 0 && sy != cur_scale - 1 || sx != 0 && sx != cur_scale - 1); [INFO] [stdout] | [INFO] [stdout] 1300 - let is_inner_corner = (sx == 0 && sy == 0) [INFO] [stdout] 1301 - || (sx == 0 && sy == cur_scale - 1) [INFO] [stdout] 1302 - || (sx == cur_scale - 1 && sy == 0) [INFO] [stdout] 1303 - || (sx == cur_scale - 1 && sy == cur_scale - 1); [INFO] [stdout] 1300 + let is_inner_corner = (sx == cur_scale - 1 || sx == 0) && (sy == cur_scale - 1 || sy == 0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:1300:55 [INFO] [stdout] | [INFO] [stdout] 1300 | ... let is_inner_corner = (sx == 0 && sy == 0) [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 1301 | | ... || (sx == 0 && sy == cur_scale - 1) [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] 1300 - let is_inner_corner = (sx == 0 && sy == 0) [INFO] [stdout] 1301 - || (sx == 0 && sy == cur_scale - 1) [INFO] [stdout] 1300 + let is_inner_corner = !(sx != 0 || sy != 0 && sy != cur_scale - 1) [INFO] [stdout] | [INFO] [stdout] 1300 - let is_inner_corner = (sx == 0 && sy == 0) [INFO] [stdout] 1301 - || (sx == 0 && sy == cur_scale - 1) [INFO] [stdout] 1300 + let is_inner_corner = (sy == cur_scale - 1 || sy == 0) && sx == 0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (10/7) [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:701:1 [INFO] [stdout] | [INFO] [stdout] 701 | / fn run_gui(arduboy: &mut Arduboy, start_muted: bool, debug: bool, initial_scale: usize, [INFO] [stdout] 702 | | serial_enabled: bool, hex_path: &str, game_title: &str, no_save: bool, [INFO] [stdout] 703 | | lcd_start: bool, no_blur: bool) [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: called `unwrap` on `notify_msg` after checking its variant with `is_some` [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:1457:34 [INFO] [stdout] | [INFO] [stdout] 1456 | let ntf = if notify_msg.is_some() && Instant::now() < notify_until { [INFO] [stdout] | -------------------- the check is happening here [INFO] [stdout] 1457 | format!(" [{}]", notify_msg.as_ref().unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:189:17 [INFO] [stdout] | [INFO] [stdout] 189 | / if debug { [INFO] [stdout] 190 | | for (_, gp) in gilrs.gamepads() { [INFO] [stdout] 191 | | if gp.is_connected() { println!("Gamepad connected: \"{}\"", gp.name()); } [INFO] [stdout] 192 | | } [INFO] [stdout] 193 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 188 ~ EventType::Connected [INFO] [stdout] 189 ~ if debug => { [INFO] [stdout] 190 | for (_, gp) in gilrs.gamepads() { [INFO] [stdout] 191 | if gp.is_connected() { println!("Gamepad connected: \"{}\"", gp.name()); } [INFO] [stdout] 192 | } [INFO] [stdout] 193 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `.is_multiple_of()` [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:219:16 [INFO] [stdout] | [INFO] [stdout] 219 | if raw % 2 == 0 { state.a = pressed; } else { state.b = pressed; } [INFO] [stdout] | ^^^^^^^^^^^^ help: replace with: `raw.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] = note: `#[warn(clippy::manual_is_multiple_of)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:229:32 [INFO] [stdout] | [INFO] [stdout] 229 | Axis::RightStickX => { if state.left_stick_x.abs() < 0.01 { state.left_stick_x = value; } } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 229 - Axis::RightStickX => { if state.left_stick_x.abs() < 0.01 { state.left_stick_x = value; } } [INFO] [stdout] 229 + Axis::RightStickX if state.left_stick_x.abs() < 0.01 => { state.left_stick_x = value; } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:230:32 [INFO] [stdout] | [INFO] [stdout] 230 | Axis::RightStickY => { if state.left_stick_y.abs() < 0.01 { state.left_stick_y = value; } } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 230 - Axis::RightStickY => { if state.left_stick_y.abs() < 0.01 { state.left_stick_y = value; } } [INFO] [stdout] 230 + Axis::RightStickY if state.left_stick_y.abs() < 0.01 => { state.left_stick_y = value; } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:1219:29 [INFO] [stdout] | [INFO] [stdout] 1219 | let fit_scale = fit_scale_w.min(fit_scale_h).max(1).min(12); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `fit_scale_w.min(fit_scale_h).clamp(1, 12)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:1223:25 [INFO] [stdout] | [INFO] [stdout] 1223 | scale = fit_scale.min(6).max(1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `fit_scale.clamp(1, 6)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:1534:37 [INFO] [stdout] | [INFO] [stdout] 1534 | let parts: Vec<&str> = line.trim().split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^ help: remove `trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trim_split_whitespace [INFO] [stdout] = note: `#[warn(clippy::trim_split_whitespace)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:422:5 [INFO] [stdout] | [INFO] [stdout] 422 | games.sort_by(|a, b| a.to_lowercase().cmp(&b.to_lowercase())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 422 - games.sort_by(|a, b| a.to_lowercase().cmp(&b.to_lowercase())); [INFO] [stdout] 422 + games.sort_by_key(|a| a.to_lowercase()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:1900:20 [INFO] [stdout] | [INFO] [stdout] 1900 | || press_frame.map_or(false, |pf| frame >= pf && frame < pf + 20); [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] 1900 - || press_frame.map_or(false, |pf| frame >= pf && frame < pf + 20); [INFO] [stdout] 1900 + || press_frame.is_some_and(|pf| frame >= pf && frame < pf + 20); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:559:32 [INFO] [stdout] | [INFO] [stdout] 559 | let initial_scale: usize = args.iter() [INFO] [stdout] | ________________________________^ [INFO] [stdout] 560 | | .position(|a| a == "--scale") [INFO] [stdout] 561 | | .and_then(|i| args.get(i + 1)) [INFO] [stdout] 562 | | .and_then(|s| s.parse().ok()) [INFO] [stdout] 563 | | .unwrap_or(6).max(1).min(6); [INFO] [stdout] | |___________________________________^ [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] help: replace with clamp [INFO] [stdout] | [INFO] [stdout] 559 ~ let initial_scale: usize = args.iter() [INFO] [stdout] 560 + .position(|a| a == "--scale") [INFO] [stdout] 561 + .and_then(|i| args.get(i + 1)) [INFO] [stdout] 562 + .and_then(|s| s.parse().ok()) [INFO] [stdout] 563 ~ .unwrap_or(6).clamp(1, 6); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:1300:55 [INFO] [stdout] | [INFO] [stdout] 1300 | ... let is_inner_corner = (sx == 0 && sy == 0) [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 1301 | | ... || (sx == 0 && sy == cur_scale - 1) [INFO] [stdout] 1302 | | ... || (sx == cur_scale - 1 && sy == 0) [INFO] [stdout] 1303 | | ... || (sx == cur_scale - 1 && sy == cur_scale - 1); [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] 1300 - let is_inner_corner = (sx == 0 && sy == 0) [INFO] [stdout] 1301 - || (sx == 0 && sy == cur_scale - 1) [INFO] [stdout] 1302 - || (sx == cur_scale - 1 && sy == 0) [INFO] [stdout] 1303 - || (sx == cur_scale - 1 && sy == cur_scale - 1); [INFO] [stdout] 1300 + let is_inner_corner = !(sy != 0 && sy != cur_scale - 1 || sx != 0 && sx != cur_scale - 1); [INFO] [stdout] | [INFO] [stdout] 1300 - let is_inner_corner = (sx == 0 && sy == 0) [INFO] [stdout] 1301 - || (sx == 0 && sy == cur_scale - 1) [INFO] [stdout] 1302 - || (sx == cur_scale - 1 && sy == 0) [INFO] [stdout] 1303 - || (sx == cur_scale - 1 && sy == cur_scale - 1); [INFO] [stdout] 1300 + let is_inner_corner = (sx == cur_scale - 1 || sx == 0) && (sy == cur_scale - 1 || sy == 0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:1300:55 [INFO] [stdout] | [INFO] [stdout] 1300 | ... let is_inner_corner = (sx == 0 && sy == 0) [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 1301 | | ... || (sx == 0 && sy == cur_scale - 1) [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] 1300 - let is_inner_corner = (sx == 0 && sy == 0) [INFO] [stdout] 1301 - || (sx == 0 && sy == cur_scale - 1) [INFO] [stdout] 1300 + let is_inner_corner = !(sx != 0 || sy != 0 && sy != cur_scale - 1) [INFO] [stdout] | [INFO] [stdout] 1300 - let is_inner_corner = (sx == 0 && sy == 0) [INFO] [stdout] 1301 - || (sx == 0 && sy == cur_scale - 1) [INFO] [stdout] 1300 + let is_inner_corner = (sy == cur_scale - 1 || sy == 0) && sx == 0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (10/7) [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:701:1 [INFO] [stdout] | [INFO] [stdout] 701 | / fn run_gui(arduboy: &mut Arduboy, start_muted: bool, debug: bool, initial_scale: usize, [INFO] [stdout] 702 | | serial_enabled: bool, hex_path: &str, game_title: &str, no_save: bool, [INFO] [stdout] 703 | | lcd_start: bool, no_blur: bool) [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: called `unwrap` on `notify_msg` after checking its variant with `is_some` [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:1457:34 [INFO] [stdout] | [INFO] [stdout] 1456 | let ntf = if notify_msg.is_some() && Instant::now() < notify_until { [INFO] [stdout] | -------------------- the check is happening here [INFO] [stdout] 1457 | format!(" [{}]", notify_msg.as_ref().unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:1219:29 [INFO] [stdout] | [INFO] [stdout] 1219 | let fit_scale = fit_scale_w.min(fit_scale_h).max(1).min(12); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `fit_scale_w.min(fit_scale_h).clamp(1, 12)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:1223:25 [INFO] [stdout] | [INFO] [stdout] 1223 | scale = fit_scale.min(6).max(1); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `fit_scale.clamp(1, 6)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: found call to `str::trim` before `str::split_whitespace` [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:1534:37 [INFO] [stdout] | [INFO] [stdout] 1534 | let parts: Vec<&str> = line.trim().split_whitespace().collect(); [INFO] [stdout] | ^^^^^^^ help: remove `trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trim_split_whitespace [INFO] [stdout] = note: `#[warn(clippy::trim_split_whitespace)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> crates/frontend-minifb/src/main.rs:1900:20 [INFO] [stdout] | [INFO] [stdout] 1900 | || press_frame.map_or(false, |pf| frame >= pf && frame < pf + 20); [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] 1900 - || press_frame.map_or(false, |pf| frame >= pf && frame < pf + 20); [INFO] [stdout] 1900 + || press_frame.is_some_and(|pf| frame >= pf && frame < pf + 20); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 54.16s [INFO] running `Command { std: "docker" "inspect" "599855dea56af93fd7beb4dd193c39f98e3c8ce29bb0630158aef596cc285b95", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "599855dea56af93fd7beb4dd193c39f98e3c8ce29bb0630158aef596cc285b95", kill_on_drop: false }` [INFO] [stdout] 599855dea56af93fd7beb4dd193c39f98e3c8ce29bb0630158aef596cc285b95