[INFO] fetching crate organicomplex 0.7.0... [INFO] linting organicomplex-0.7.0 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate organicomplex 0.7.0 into /workspace/builds/worker-1-tc1/source [INFO] started tweaking crates.io crate organicomplex 0.7.0 [INFO] finished tweaking crates.io crate organicomplex 0.7.0 [INFO] tweaked toml for crates.io crate organicomplex 0.7.0 written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate organicomplex 0.7.0 on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate crates.io crate organicomplex 0.7.0 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded version-compare v0.1.1 [INFO] [stderr] Downloaded sdl2 v0.38.0 [INFO] [stderr] Downloaded sdl2-sys v0.38.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] dee05857b1c0bd7779e956084bad1bd8524c457528347607d2445d1424cdf4a0 [INFO] running `Command { std: "docker" "start" "-a" "dee05857b1c0bd7779e956084bad1bd8524c457528347607d2445d1424cdf4a0", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "dee05857b1c0bd7779e956084bad1bd8524c457528347607d2445d1424cdf4a0", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "dee05857b1c0bd7779e956084bad1bd8524c457528347607d2445d1424cdf4a0", kill_on_drop: false }` [INFO] [stdout] dee05857b1c0bd7779e956084bad1bd8524c457528347607d2445d1424cdf4a0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 3837cce7347a409dd49ef3808eaba147b971e901f244605d28063436a8196565 [INFO] running `Command { std: "docker" "start" "-a" "3837cce7347a409dd49ef3808eaba147b971e901f244605d28063436a8196565", kill_on_drop: false }` [INFO] [stderr] Compiling zerocopy v0.8.34 [INFO] [stderr] Compiling quote v1.0.44 [INFO] [stderr] Compiling version-compare v0.1.1 [INFO] [stderr] Compiling sdl2 v0.38.0 [INFO] [stderr] Compiling zmij v1.0.17 [INFO] [stderr] Checking either v1.15.0 [INFO] [stderr] Checking getrandom v0.3.4 [INFO] [stderr] Compiling proc-macro2 v1.0.106 [INFO] [stderr] Checking rand_core v0.9.5 [INFO] [stderr] Compiling sdl2-sys v0.38.0 [INFO] [stderr] Checking serde_json v1.0.149 [INFO] [stderr] Checking rayon v1.11.0 [INFO] [stderr] Checking rand_xoshiro v0.7.0 [INFO] [stderr] Compiling syn v2.0.114 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Checking ppv-lite86 v0.2.21 [INFO] [stderr] Checking rand_chacha v0.9.0 [INFO] [stderr] Checking rand v0.9.2 [INFO] [stderr] Checking serde v1.0.228 [INFO] [stderr] Checking organicomplex v0.7.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/base.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | fn pre_err(self: Self, p: impl ToString) -> Result; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] = note: `#[warn(clippy::needless_arbitrary_self_type)]` on by default [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 30 - fn pre_err(self: Self, p: impl ToString) -> Result; [INFO] [stdout] 30 + fn pre_err(self, p: impl ToString) -> Result; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/base.rs:37:13 [INFO] [stdout] | [INFO] [stdout] 37 | fn pre_err(self: Self, p: impl ToString) -> Result { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 37 - fn pre_err(self: Self, p: impl ToString) -> Result { [INFO] [stdout] 37 + fn pre_err(self, p: impl ToString) -> Result { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/base.rs:30:13 [INFO] [stdout] | [INFO] [stdout] 30 | fn pre_err(self: Self, p: impl ToString) -> Result; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] = note: `#[warn(clippy::needless_arbitrary_self_type)]` on by default [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 30 - fn pre_err(self: Self, p: impl ToString) -> Result; [INFO] [stdout] 30 + fn pre_err(self, p: impl ToString) -> Result; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the type of the `self` parameter does not need to be arbitrary [INFO] [stdout] --> src/base.rs:37:13 [INFO] [stdout] | [INFO] [stdout] 37 | fn pre_err(self: Self, p: impl ToString) -> Result { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_arbitrary_self_type [INFO] [stdout] help: remove the type [INFO] [stdout] | [INFO] [stdout] 37 - fn pre_err(self: Self, p: impl ToString) -> Result { [INFO] [stdout] 37 + fn pre_err(self, p: impl ToString) -> Result { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `RGB` contains a capitalized acronym [INFO] [stdout] --> src/base/colors.rs:2:12 [INFO] [stdout] | [INFO] [stdout] 2 | pub struct RGB { [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Rgb` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `ARGB` contains a capitalized acronym [INFO] [stdout] --> src/base/colors.rs:9:12 [INFO] [stdout] | [INFO] [stdout] 9 | pub struct ARGB { [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Argb` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/base.rs:72:3 [INFO] [stdout] | [INFO] [stdout] 72 | while let Some(ch) = chars.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for ch in chars` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/fontset.rs:76:9 [INFO] [stdout] | [INFO] [stdout] 76 | / let mut fonts = Vec::>::new(); [INFO] [stdout] 77 | | [INFO] [stdout] 78 | | // Must be in the same order as CFont variants, for indexing to be correct [INFO] [stdout] 79 | | fonts.push(load_font(font_context, &fsd.system.file, fsd.system.size).pre_err("cannot load System font")?); [INFO] [stdout] 80 | | fonts.push(load_font(font_context, &fsd.meta.file, fsd.meta.size).pre_err("cannot load Meta font")?); [INFO] [stdout] 81 | | fonts.push(load_font(font_context, &fsd.info.file, fsd.info.size).pre_err("cannot load Parameters font")?); [INFO] [stdout] | |___________________________________________________________________________________________________________________^ help: consider using the `vec![]` macro: `let fonts = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/lingua.rs:62:25 [INFO] [stdout] | [INFO] [stdout] 62 | / match self.lingua_map.insert(prefixed_id.clone(), texts) { [INFO] [stdout] 63 | | Some(..) => return Err(format!("cannot load '{}': id-key '{}' exists already", &filepath, &prefixed_id)), [INFO] [stdout] 64 | | None => {} [INFO] [stdout] 65 | | }; [INFO] [stdout] | |_________________________^ help: try: `if let Some(..) = self.lingua_map.insert(prefixed_id.clone(), texts) { return Err(format!("cannot load '{}': id-key '{}' exists already", &filepath, &prefixed_id)) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/lingua.rs:98:9 [INFO] [stdout] | [INFO] [stdout] 98 | self.lingua_map.get(&id).map(|texts| texts.clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `self.lingua_map.get(&id).cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/master/meta.rs:189:21 [INFO] [stdout] | [INFO] [stdout] 189 | term.print_align(format!("{}", PROG_HOMEPAGE), term.nrows - 1, Align::Right); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `PROG_HOMEPAGE.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: name `RGB` contains a capitalized acronym [INFO] [stdout] --> src/base/colors.rs:2:12 [INFO] [stdout] | [INFO] [stdout] 2 | pub struct RGB { [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Rgb` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `ARGB` contains a capitalized acronym [INFO] [stdout] --> src/base/colors.rs:9:12 [INFO] [stdout] | [INFO] [stdout] 9 | pub struct ARGB { [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `Argb` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/master/meta.rs:281:157 [INFO] [stdout] | [INFO] [stdout] 281 | ...1_or_echo(format!("{} {}", MENU_ITEM_ID_PREFIX, s.to_string())).chars().count())) as i32; [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/play/automaton/control.rs:50:1 [INFO] [stdout] | [INFO] [stdout] 50 | / pub enum MControl { [INFO] [stdout] 51 | | Unset, [INFO] [stdout] | | ----- the second-largest variant carries no data at all [INFO] [stdout] 52 | |/ Set { [INFO] [stdout] 53 | || _mus_forest: Option, [INFO] [stdout] 54 | || snd_alchemlab: Option, [INFO] [stdout] 55 | || snd_tick: Option, [INFO] [stdout] ... || [INFO] [stdout] 66 | || tick_tock: bool [INFO] [stdout] 67 | || } [INFO] [stdout] | ||_____- the largest variant contains at least 305 bytes [INFO] [stdout] 68 | | } [INFO] [stdout] | |__^ the entire enum is at least 312 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] = note: `#[warn(clippy::large_enum_variant)]` on by default [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 61 ~ snd_kaleidoscope: Box>, [INFO] [stdout] 62 ~ snd_lightson: Box>, [INFO] [stdout] 63 ~ snd_lightsoff: Box>, [INFO] [stdout] 64 ~ snd_seed: Box>, [INFO] [stdout] 65 ~ snd_tearpage: Box>, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/play/automaton/control.rs:160:10 [INFO] [stdout] | [INFO] [stdout] 160 | if (!(state.manual_step)) || ((state.manual_step) && sys.poll_key(Key::Space)) { [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] 160 - if (!(state.manual_step)) || ((state.manual_step) && sys.poll_key(Key::Space)) { [INFO] [stdout] 160 + if !((state.manual_step) && !sys.poll_key(Key::Space)) { [INFO] [stdout] | [INFO] [stdout] 160 - if (!(state.manual_step)) || ((state.manual_step) && sys.poll_key(Key::Space)) { [INFO] [stdout] 160 + if !(state.manual_step) || sys.poll_key(Key::Space) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/play/automaton/control.rs:246:7 [INFO] [stdout] | [INFO] [stdout] 246 | / if sys.poll_key(Key::J) || middle_btn { [INFO] [stdout] 247 | | if state.edit_mode == EditMode::Field { [INFO] [stdout] 248 | | let pv = (state.pointer_field_y / state.cell_size) as usize; [INFO] [stdout] 249 | | let pw = (state.pointer_field_x / state.cell_size) as usize; [INFO] [stdout] ... | [INFO] [stdout] 254 | | } [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] 246 ~ if (sys.poll_key(Key::J) || middle_btn) { [INFO] [stdout] 247 ~ && state.edit_mode == EditMode::Field { [INFO] [stdout] 248 | let pv = (state.pointer_field_y / state.cell_size) as usize; [INFO] [stdout] ... [INFO] [stdout] 252 | } [INFO] [stdout] 253 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/play/automaton/control.rs:256:7 [INFO] [stdout] | [INFO] [stdout] 256 | / if sys.poll_key(Key::E) { [INFO] [stdout] 257 | | if state.edit_mode == EditMode::Field { [INFO] [stdout] 258 | | state.field.add_embryo( [INFO] [stdout] 259 | | state.pointer_field_u as usize, [INFO] [stdout] ... | [INFO] [stdout] 265 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 256 ~ if sys.poll_key(Key::E) [INFO] [stdout] 257 ~ && state.edit_mode == EditMode::Field { [INFO] [stdout] 258 | state.field.add_embryo( [INFO] [stdout] ... [INFO] [stdout] 263 | ); [INFO] [stdout] 264 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/play/automaton/control.rs:293:7 [INFO] [stdout] | [INFO] [stdout] 293 | / state.amplification = state.amplification + [INFO] [stdout] 294 | | 0.001f64 * match (sys.poll_key(Key::LeftBracket), sys.poll_key(Key::RightBracket)) { [INFO] [stdout] 295 | | (true, false) => -1.0, [INFO] [stdout] 296 | | (false, true) => 1.0, [INFO] [stdout] ... | [INFO] [stdout] 306 | | true => 10.0 [INFO] [stdout] 307 | | }; [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] help: replace it with [INFO] [stdout] | [INFO] [stdout] 293 ~ state.amplification += 0.001f64 * match (sys.poll_key(Key::LeftBracket), sys.poll_key(Key::RightBracket)) { [INFO] [stdout] 294 ~ (true, false) => -1.0, [INFO] [stdout] 295 ~ (false, true) => 1.0, [INFO] [stdout] 296 ~ _ => 0.0 [INFO] [stdout] 297 ~ } * match shiftkeypress { [INFO] [stdout] 298 ~ false => 1.0, [INFO] [stdout] 299 ~ true => 10.0 [INFO] [stdout] 300 ~ } * match altkeypress { [INFO] [stdout] 301 ~ false => 1.0, [INFO] [stdout] 302 ~ true => 10.0 [INFO] [stdout] 303 ~ } * match ctrlkeypress { [INFO] [stdout] 304 ~ false => 1.0, [INFO] [stdout] 305 ~ true => 10.0 [INFO] [stdout] 306 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/play/automaton/control.rs:325:29 [INFO] [stdout] | [INFO] [stdout] 325 | state.synchronicity = (state.synchronicity + [INFO] [stdout] | _______________________________________________^ [INFO] [stdout] 326 | | 0.001f64 * match (sys.poll_key(Key::Minus), sys.poll_key(Key::Equals)) { [INFO] [stdout] 327 | | (true, false) => -1.0, [INFO] [stdout] 328 | | (false, true) => 1.0, [INFO] [stdout] ... | [INFO] [stdout] 338 | | true => 10.0 [INFO] [stdout] 339 | | }).max(0.0).min(1.0); [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] help: replace with clamp [INFO] [stdout] | [INFO] [stdout] 325 ~ state.synchronicity = (state.synchronicity + 0.001f64 * match (sys.poll_key(Key::Minus), sys.poll_key(Key::Equals)) { [INFO] [stdout] 326 ~ (true, false) => -1.0, [INFO] [stdout] 327 ~ (false, true) => 1.0, [INFO] [stdout] 328 ~ _ => 0.0 [INFO] [stdout] 329 ~ } * match shiftkeypress { [INFO] [stdout] 330 ~ false => 1.0, [INFO] [stdout] 331 ~ true => 10.0 [INFO] [stdout] 332 ~ } * match altkeypress { [INFO] [stdout] 333 ~ false => 1.0, [INFO] [stdout] 334 ~ true => 10.0 [INFO] [stdout] 335 ~ } * match ctrlkeypress { [INFO] [stdout] 336 ~ false => 1.0, [INFO] [stdout] 337 ~ true => 10.0 [INFO] [stdout] 338 ~ }).clamp(0.0, 1.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/play/automaton/control.rs:363:7 [INFO] [stdout] | [INFO] [stdout] 363 | / if shiftkeypress && sys.poll_key(Key::Num9) { [INFO] [stdout] 364 | | if state.cell_size > 1 { [INFO] [stdout] 365 | | state.cell_size -= 1; [INFO] [stdout] 366 | | state.pointer_field_y = state.pointer_field_y * state.cell_size / (state.cell_size + 1); [INFO] [stdout] ... | [INFO] [stdout] 369 | | } [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] 363 ~ if shiftkeypress && sys.poll_key(Key::Num9) [INFO] [stdout] 364 ~ && state.cell_size > 1 { [INFO] [stdout] 365 | state.cell_size -= 1; [INFO] [stdout] 366 | state.pointer_field_y = state.pointer_field_y * state.cell_size / (state.cell_size + 1); [INFO] [stdout] 367 | state.pointer_field_x = state.pointer_field_x * state.cell_size / (state.cell_size + 1); [INFO] [stdout] 368 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/play/automaton/control.rs:389:24 [INFO] [stdout] | [INFO] [stdout] 389 | ... if ctrlkeypress { [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 390 | | ... [INFO] [stdout] 391 | | ... } else if altkeypress { [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/play/automaton/control.rs:391:30 [INFO] [stdout] | [INFO] [stdout] 391 | ... } else if altkeypress { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 392 | | ... [INFO] [stdout] 393 | | ... } else if state.edit_mode == EditMode::Field { [INFO] [stdout] | |_______________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/base.rs:72:3 [INFO] [stdout] | [INFO] [stdout] 72 | while let Some(ch) = chars.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for ch in chars` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/play/automaton/control.rs:399:24 [INFO] [stdout] | [INFO] [stdout] 399 | ... if ctrlkeypress { [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 400 | | ... [INFO] [stdout] 401 | | ... } else if altkeypress { [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/play/automaton/control.rs:401:30 [INFO] [stdout] | [INFO] [stdout] 401 | ... } else if altkeypress { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 402 | | ... [INFO] [stdout] 403 | | ... } else if state.edit_mode == EditMode::Field { [INFO] [stdout] | |_______________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/play/automaton/control.rs:449:25 [INFO] [stdout] | [INFO] [stdout] 449 | ... state.brush.re = (state.brush.re + (mouse_dx as f64) / 512.0).max(-1.0).min(1.0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(state.brush.re + (mouse_dx as f64) / 512.0).clamp(-1.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/play/automaton/control.rs:450:25 [INFO] [stdout] | [INFO] [stdout] 450 | ... state.brush.im = (state.brush.im - (mouse_dy as f64) / 512.0).max(-1.0).min(1.0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(state.brush.im - (mouse_dy as f64) / 512.0).clamp(-1.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/play/automaton/control.rs:452:25 [INFO] [stdout] | [INFO] [stdout] 452 | ... state.brush.re = (state.brush.re + (wheel_dw as f64) / 32.0).max(-1.0).min(1.0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(state.brush.re + (wheel_dw as f64) / 32.0).clamp(-1.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/play/automaton/control.rs:454:25 [INFO] [stdout] | [INFO] [stdout] 454 | ... state.brush.im = (state.brush.im + (wheel_dw as f64) / 32.0).max(-1.0).min(1.0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(state.brush.im + (wheel_dw as f64) / 32.0).clamp(-1.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calls to `push` immediately after creation [INFO] [stdout] --> src/fontset.rs:76:9 [INFO] [stdout] | [INFO] [stdout] 76 | / let mut fonts = Vec::>::new(); [INFO] [stdout] 77 | | [INFO] [stdout] 78 | | // Must be in the same order as CFont variants, for indexing to be correct [INFO] [stdout] 79 | | fonts.push(load_font(font_context, &fsd.system.file, fsd.system.size).pre_err("cannot load System font")?); [INFO] [stdout] 80 | | fonts.push(load_font(font_context, &fsd.meta.file, fsd.meta.size).pre_err("cannot load Meta font")?); [INFO] [stdout] 81 | | fonts.push(load_font(font_context, &fsd.info.file, fsd.info.size).pre_err("cannot load Parameters font")?); [INFO] [stdout] | |___________________________________________________________________________________________________________________^ help: consider using the `vec![]` macro: `let fonts = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/lingua.rs:62:25 [INFO] [stdout] | [INFO] [stdout] 62 | / match self.lingua_map.insert(prefixed_id.clone(), texts) { [INFO] [stdout] 63 | | Some(..) => return Err(format!("cannot load '{}': id-key '{}' exists already", &filepath, &prefixed_id)), [INFO] [stdout] 64 | | None => {} [INFO] [stdout] 65 | | }; [INFO] [stdout] | |_________________________^ help: try: `if let Some(..) = self.lingua_map.insert(prefixed_id.clone(), texts) { return Err(format!("cannot load '{}': id-key '{}' exists already", &filepath, &prefixed_id)) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/lingua.rs:98:9 [INFO] [stdout] | [INFO] [stdout] 98 | self.lingua_map.get(&id).map(|texts| texts.clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `self.lingua_map.get(&id).cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/play/automaton/field.rs:351:21 [INFO] [stdout] | [INFO] [stdout] 351 | let width = self.width() as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `self.width()` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/play/automaton/field.rs:366:36 [INFO] [stdout] | [INFO] [stdout] 366 | let mut seeds = vec![0u64; width as usize]; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `width` [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 `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `Vec` [INFO] [stdout] --> src/play/automaton/field.rs:368:43 [INFO] [stdout] | [INFO] [stdout] 368 | for (u, next_layer) in next_cells.into_iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter_mut` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `Vec` [INFO] [stdout] --> src/play/automaton/field.rs:374:48 [INFO] [stdout] | [INFO] [stdout] 374 | for (w, next_cell) in next_row.into_iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter_mut` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/master/meta.rs:189:21 [INFO] [stdout] | [INFO] [stdout] 189 | term.print_align(format!("{}", PROG_HOMEPAGE), term.nrows - 1, Align::Right); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `PROG_HOMEPAGE.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: clamp-like pattern without using clamp function [INFO] [stdout] --> src/play/automaton/render.rs:71:2 [INFO] [stdout] | [INFO] [stdout] 71 | (0x200isize + (x as isize)).max(0).min(0x3FF) as usize [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(0x200isize + (x as isize)).clamp(0, 0x3FF)` [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: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> src/master/meta.rs:281:157 [INFO] [stdout] | [INFO] [stdout] 281 | ...1_or_echo(format!("{} {}", MENU_ITEM_ID_PREFIX, s.to_string())).chars().count())) as i32; [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/play/automaton/render.rs:86:3 [INFO] [stdout] | [INFO] [stdout] 86 | / match self { [INFO] [stdout] 87 | | &mut Self::Unset => { [INFO] [stdout] 88 | | let topleft_x: i32 = -(sys.width() >> 1); [INFO] [stdout] 89 | | let topleft_y: i32 = -(sys.height() >> 1); [INFO] [stdout] ... | [INFO] [stdout] 94 | | &mut Self::Set{..} => Err(format!("{} {}", MID, ERR_ALREADY_SET)) [INFO] [stdout] 95 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] = note: `#[warn(clippy::match_ref_pats)]` on by default [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 86 ~ match *self { [INFO] [stdout] 87 ~ Self::Unset => { [INFO] [stdout] 88 | let topleft_x: i32 = -(sys.width() >> 1); [INFO] [stdout] ... [INFO] [stdout] 93 | [INFO] [stdout] 94 ~ Self::Set{..} => Err(format!("{} {}", MID, ERR_ALREADY_SET)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/play/automaton/render.rs:99:3 [INFO] [stdout] | [INFO] [stdout] 99 | / match self { [INFO] [stdout] 100 | | &mut Self::Set{topleft_x, topleft_y} => { [INFO] [stdout] 101 | | match &mut state.automaton { [INFO] [stdout] 102 | | Some(state) => { [INFO] [stdout] ... | [INFO] [stdout] 452 | | &mut Self::Unset => Err(format!("{} {}", MID, ERR_NOT_SET_CANNOT_RUN)) [INFO] [stdout] 453 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 99 ~ match *self { [INFO] [stdout] 100 ~ Self::Set{topleft_x, topleft_y} => { [INFO] [stdout] 101 | match &mut state.automaton { [INFO] [stdout] ... [INFO] [stdout] 451 | [INFO] [stdout] 452 ~ Self::Unset => Err(format!("{} {}", MID, ERR_NOT_SET_CANNOT_RUN)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/play/automaton/render.rs:147:39 [INFO] [stdout] | [INFO] [stdout] 147 | ... for (_v, row) in layer.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 147 - for (_v, row) in layer.iter().enumerate() { [INFO] [stdout] 147 + for row in layer.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/play/automaton/render.rs:149:39 [INFO] [stdout] | [INFO] [stdout] 149 | ... for (_w, cell) in row.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 149 - for (_w, cell) in row.iter().enumerate() { [INFO] [stdout] 149 + for cell in row.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/play/automaton/control.rs:50:1 [INFO] [stdout] | [INFO] [stdout] 50 | / pub enum MControl { [INFO] [stdout] 51 | | Unset, [INFO] [stdout] | | ----- the second-largest variant carries no data at all [INFO] [stdout] 52 | |/ Set { [INFO] [stdout] 53 | || _mus_forest: Option, [INFO] [stdout] 54 | || snd_alchemlab: Option, [INFO] [stdout] 55 | || snd_tick: Option, [INFO] [stdout] ... || [INFO] [stdout] 66 | || tick_tock: bool [INFO] [stdout] 67 | || } [INFO] [stdout] | ||_____- the largest variant contains at least 305 bytes [INFO] [stdout] 68 | | } [INFO] [stdout] | |__^ the entire enum is at least 312 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] = note: `#[warn(clippy::large_enum_variant)]` on by default [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 61 ~ snd_kaleidoscope: Box>, [INFO] [stdout] 62 ~ snd_lightson: Box>, [INFO] [stdout] 63 ~ snd_lightsoff: Box>, [INFO] [stdout] 64 ~ snd_seed: Box>, [INFO] [stdout] 65 ~ snd_tearpage: Box>, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/play/automaton/control.rs:160:10 [INFO] [stdout] | [INFO] [stdout] 160 | if (!(state.manual_step)) || ((state.manual_step) && sys.poll_key(Key::Space)) { [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] 160 - if (!(state.manual_step)) || ((state.manual_step) && sys.poll_key(Key::Space)) { [INFO] [stdout] 160 + if !((state.manual_step) && !sys.poll_key(Key::Space)) { [INFO] [stdout] | [INFO] [stdout] 160 - if (!(state.manual_step)) || ((state.manual_step) && sys.poll_key(Key::Space)) { [INFO] [stdout] 160 + if !(state.manual_step) || sys.poll_key(Key::Space) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/play/automaton/render.rs:325:19 [INFO] [stdout] | [INFO] [stdout] 325 | ... let im = (0x200i32 + (y << 2)).max(0).min(0x3FF) as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(0x200i32 + (y << 2)).clamp(0, 0x3FF)` [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] --> src/play/automaton/render.rs:327:20 [INFO] [stdout] | [INFO] [stdout] 327 | ... let re = (0x200i32 + (x << 2)).max(0).min(0x3FF) as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(0x200i32 + (x << 2)).clamp(0, 0x3FF)` [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: this `if` statement can be collapsed [INFO] [stdout] --> src/play/automaton/control.rs:246:7 [INFO] [stdout] | [INFO] [stdout] 246 | / if sys.poll_key(Key::J) || middle_btn { [INFO] [stdout] 247 | | if state.edit_mode == EditMode::Field { [INFO] [stdout] 248 | | let pv = (state.pointer_field_y / state.cell_size) as usize; [INFO] [stdout] 249 | | let pw = (state.pointer_field_x / state.cell_size) as usize; [INFO] [stdout] ... | [INFO] [stdout] 254 | | } [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] 246 ~ if (sys.poll_key(Key::J) || middle_btn) { [INFO] [stdout] 247 ~ && state.edit_mode == EditMode::Field { [INFO] [stdout] 248 | let pv = (state.pointer_field_y / state.cell_size) as usize; [INFO] [stdout] ... [INFO] [stdout] 252 | } [INFO] [stdout] 253 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/play/automaton/control.rs:256:7 [INFO] [stdout] | [INFO] [stdout] 256 | / if sys.poll_key(Key::E) { [INFO] [stdout] 257 | | if state.edit_mode == EditMode::Field { [INFO] [stdout] 258 | | state.field.add_embryo( [INFO] [stdout] 259 | | state.pointer_field_u as usize, [INFO] [stdout] ... | [INFO] [stdout] 265 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 256 ~ if sys.poll_key(Key::E) [INFO] [stdout] 257 ~ && state.edit_mode == EditMode::Field { [INFO] [stdout] 258 | state.field.add_embryo( [INFO] [stdout] ... [INFO] [stdout] 263 | ); [INFO] [stdout] 264 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/play/automaton/control.rs:293:7 [INFO] [stdout] | [INFO] [stdout] 293 | / state.amplification = state.amplification + [INFO] [stdout] 294 | | 0.001f64 * match (sys.poll_key(Key::LeftBracket), sys.poll_key(Key::RightBracket)) { [INFO] [stdout] 295 | | (true, false) => -1.0, [INFO] [stdout] 296 | | (false, true) => 1.0, [INFO] [stdout] ... | [INFO] [stdout] 306 | | true => 10.0 [INFO] [stdout] 307 | | }; [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] help: replace it with [INFO] [stdout] | [INFO] [stdout] 293 ~ state.amplification += 0.001f64 * match (sys.poll_key(Key::LeftBracket), sys.poll_key(Key::RightBracket)) { [INFO] [stdout] 294 ~ (true, false) => -1.0, [INFO] [stdout] 295 ~ (false, true) => 1.0, [INFO] [stdout] 296 ~ _ => 0.0 [INFO] [stdout] 297 ~ } * match shiftkeypress { [INFO] [stdout] 298 ~ false => 1.0, [INFO] [stdout] 299 ~ true => 10.0 [INFO] [stdout] 300 ~ } * match altkeypress { [INFO] [stdout] 301 ~ false => 1.0, [INFO] [stdout] 302 ~ true => 10.0 [INFO] [stdout] 303 ~ } * match ctrlkeypress { [INFO] [stdout] 304 ~ false => 1.0, [INFO] [stdout] 305 ~ true => 10.0 [INFO] [stdout] 306 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/play/automaton/control.rs:325:29 [INFO] [stdout] | [INFO] [stdout] 325 | state.synchronicity = (state.synchronicity + [INFO] [stdout] | _______________________________________________^ [INFO] [stdout] 326 | | 0.001f64 * match (sys.poll_key(Key::Minus), sys.poll_key(Key::Equals)) { [INFO] [stdout] 327 | | (true, false) => -1.0, [INFO] [stdout] 328 | | (false, true) => 1.0, [INFO] [stdout] ... | [INFO] [stdout] 338 | | true => 10.0 [INFO] [stdout] 339 | | }).max(0.0).min(1.0); [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] help: replace with clamp [INFO] [stdout] | [INFO] [stdout] 325 ~ state.synchronicity = (state.synchronicity + 0.001f64 * match (sys.poll_key(Key::Minus), sys.poll_key(Key::Equals)) { [INFO] [stdout] 326 ~ (true, false) => -1.0, [INFO] [stdout] 327 ~ (false, true) => 1.0, [INFO] [stdout] 328 ~ _ => 0.0 [INFO] [stdout] 329 ~ } * match shiftkeypress { [INFO] [stdout] 330 ~ false => 1.0, [INFO] [stdout] 331 ~ true => 10.0 [INFO] [stdout] 332 ~ } * match altkeypress { [INFO] [stdout] 333 ~ false => 1.0, [INFO] [stdout] 334 ~ true => 10.0 [INFO] [stdout] 335 ~ } * match ctrlkeypress { [INFO] [stdout] 336 ~ false => 1.0, [INFO] [stdout] 337 ~ true => 10.0 [INFO] [stdout] 338 ~ }).clamp(0.0, 1.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/play/automaton/control.rs:363:7 [INFO] [stdout] | [INFO] [stdout] 363 | / if shiftkeypress && sys.poll_key(Key::Num9) { [INFO] [stdout] 364 | | if state.cell_size > 1 { [INFO] [stdout] 365 | | state.cell_size -= 1; [INFO] [stdout] 366 | | state.pointer_field_y = state.pointer_field_y * state.cell_size / (state.cell_size + 1); [INFO] [stdout] ... | [INFO] [stdout] 369 | | } [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] 363 ~ if shiftkeypress && sys.poll_key(Key::Num9) [INFO] [stdout] 364 ~ && state.cell_size > 1 { [INFO] [stdout] 365 | state.cell_size -= 1; [INFO] [stdout] 366 | state.pointer_field_y = state.pointer_field_y * state.cell_size / (state.cell_size + 1); [INFO] [stdout] 367 | state.pointer_field_x = state.pointer_field_x * state.cell_size / (state.cell_size + 1); [INFO] [stdout] 368 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/play/automaton/control.rs:389:24 [INFO] [stdout] | [INFO] [stdout] 389 | ... if ctrlkeypress { [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 390 | | ... [INFO] [stdout] 391 | | ... } else if altkeypress { [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/play/automaton/control.rs:391:30 [INFO] [stdout] | [INFO] [stdout] 391 | ... } else if altkeypress { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 392 | | ... [INFO] [stdout] 393 | | ... } else if state.edit_mode == EditMode::Field { [INFO] [stdout] | |_______________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/play/automaton/control.rs:399:24 [INFO] [stdout] | [INFO] [stdout] 399 | ... if ctrlkeypress { [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 400 | | ... [INFO] [stdout] 401 | | ... } else if altkeypress { [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/play/automaton/control.rs:401:30 [INFO] [stdout] | [INFO] [stdout] 401 | ... } else if altkeypress { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 402 | | ... [INFO] [stdout] 403 | | ... } else if state.edit_mode == EditMode::Field { [INFO] [stdout] | |_______________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/play/automaton/render.rs:410:9 [INFO] [stdout] | [INFO] [stdout] 410 | / ... if state.show_field { [INFO] [stdout] 411 | | ... if (fpu >= 0) && (fpu < (state.field.height() as i32)) && (fpv >= 0) && (fpv < (state.field.width() as i32)) && (fpw >=... [INFO] [stdout] 412 | | ... let amph = cells[fpu as usize][fpv as usize][fpw as usize].amph; [INFO] [stdout] 413 | | ... sys.draw_text(font, format!("{} ({}, {}, {})", lingua.get1_or_echo("field cell"), fpu, fpv, fpw), 0, TEXT_COLOR, TE... [INFO] [stdout] ... | [INFO] [stdout] 420 | | ... } [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] 410 ~ if state.show_field [INFO] [stdout] 411 ~ && (fpu >= 0) && (fpu < (state.field.height() as i32)) && (fpv >= 0) && (fpv < (state.field.width() as i32)) && (fpw >= 0) && (fpw < (state.field.length() as i32)) { [INFO] [stdout] 412 | let amph = cells[fpu as usize][fpv as usize][fpw as usize].amph; [INFO] [stdout] ... [INFO] [stdout] 418 | info_y += fh << 1; [INFO] [stdout] 419 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/play/automaton/control.rs:449:25 [INFO] [stdout] | [INFO] [stdout] 449 | ... state.brush.re = (state.brush.re + (mouse_dx as f64) / 512.0).max(-1.0).min(1.0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(state.brush.re + (mouse_dx as f64) / 512.0).clamp(-1.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/play/automaton/control.rs:450:25 [INFO] [stdout] | [INFO] [stdout] 450 | ... state.brush.im = (state.brush.im - (mouse_dy as f64) / 512.0).max(-1.0).min(1.0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(state.brush.im - (mouse_dy as f64) / 512.0).clamp(-1.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/play/automaton/control.rs:452:25 [INFO] [stdout] | [INFO] [stdout] 452 | ... state.brush.re = (state.brush.re + (wheel_dw as f64) / 32.0).max(-1.0).min(1.0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(state.brush.re + (wheel_dw as f64) / 32.0).clamp(-1.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/play/automaton/control.rs:454:25 [INFO] [stdout] | [INFO] [stdout] 454 | ... state.brush.im = (state.brush.im + (wheel_dw as f64) / 32.0).max(-1.0).min(1.0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(state.brush.im + (wheel_dw as f64) / 32.0).clamp(-1.0, 1.0)` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/play/automaton/field.rs:351:21 [INFO] [stdout] | [INFO] [stdout] 351 | let width = self.width() as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: try: `self.width()` [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 (`usize` -> `usize`) [INFO] [stdout] --> src/play/automaton/field.rs:366:36 [INFO] [stdout] | [INFO] [stdout] 366 | let mut seeds = vec![0u64; width as usize]; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `width` [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 `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `Vec` [INFO] [stdout] --> src/play/automaton/field.rs:368:43 [INFO] [stdout] | [INFO] [stdout] 368 | for (u, next_layer) in next_cells.into_iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter_mut` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] = note: `#[warn(clippy::into_iter_on_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `Vec` [INFO] [stdout] --> src/play/automaton/field.rs:374:48 [INFO] [stdout] | [INFO] [stdout] 374 | for (w, next_cell) in next_row.into_iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter_mut` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/play/automaton/render.rs:71:2 [INFO] [stdout] | [INFO] [stdout] 71 | (0x200isize + (x as isize)).max(0).min(0x3FF) as usize [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(0x200isize + (x as isize)).clamp(0, 0x3FF)` [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: you don't need to add `&` to all patterns [INFO] [stdout] --> src/play/automaton/render.rs:86:3 [INFO] [stdout] | [INFO] [stdout] 86 | / match self { [INFO] [stdout] 87 | | &mut Self::Unset => { [INFO] [stdout] 88 | | let topleft_x: i32 = -(sys.width() >> 1); [INFO] [stdout] 89 | | let topleft_y: i32 = -(sys.height() >> 1); [INFO] [stdout] ... | [INFO] [stdout] 94 | | &mut Self::Set{..} => Err(format!("{} {}", MID, ERR_ALREADY_SET)) [INFO] [stdout] 95 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] = note: `#[warn(clippy::match_ref_pats)]` on by default [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 86 ~ match *self { [INFO] [stdout] 87 ~ Self::Unset => { [INFO] [stdout] 88 | let topleft_x: i32 = -(sys.width() >> 1); [INFO] [stdout] ... [INFO] [stdout] 93 | [INFO] [stdout] 94 ~ Self::Set{..} => Err(format!("{} {}", MID, ERR_ALREADY_SET)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/play/automaton/render.rs:99:3 [INFO] [stdout] | [INFO] [stdout] 99 | / match self { [INFO] [stdout] 100 | | &mut Self::Set{topleft_x, topleft_y} => { [INFO] [stdout] 101 | | match &mut state.automaton { [INFO] [stdout] 102 | | Some(state) => { [INFO] [stdout] ... | [INFO] [stdout] 452 | | &mut Self::Unset => Err(format!("{} {}", MID, ERR_NOT_SET_CANNOT_RUN)) [INFO] [stdout] 453 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 99 ~ match *self { [INFO] [stdout] 100 ~ Self::Set{topleft_x, topleft_y} => { [INFO] [stdout] 101 | match &mut state.automaton { [INFO] [stdout] ... [INFO] [stdout] 451 | [INFO] [stdout] 452 ~ Self::Unset => Err(format!("{} {}", MID, ERR_NOT_SET_CANNOT_RUN)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/play/automaton/render.rs:147:39 [INFO] [stdout] | [INFO] [stdout] 147 | ... for (_v, row) in layer.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 147 - for (_v, row) in layer.iter().enumerate() { [INFO] [stdout] 147 + for row in layer.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/play/automaton/render.rs:149:39 [INFO] [stdout] | [INFO] [stdout] 149 | ... for (_w, cell) in row.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 149 - for (_w, cell) in row.iter().enumerate() { [INFO] [stdout] 149 + for cell in row.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/play/automaton/render.rs:325:19 [INFO] [stdout] | [INFO] [stdout] 325 | ... let im = (0x200i32 + (y << 2)).max(0).min(0x3FF) as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(0x200i32 + (y << 2)).clamp(0, 0x3FF)` [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] --> src/play/automaton/render.rs:327:20 [INFO] [stdout] | [INFO] [stdout] 327 | ... let re = (0x200i32 + (x << 2)).max(0).min(0x3FF) as usize; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with clamp: `(0x200i32 + (x << 2)).clamp(0, 0x3FF)` [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: redundant pattern matching, consider using `is_ok()` [INFO] [stdout] --> src/state.rs:35:2 [INFO] [stdout] | [INFO] [stdout] 35 | / match File::open(&filepath) { [INFO] [stdout] 36 | | Ok(_) => true, [INFO] [stdout] 37 | | Err(_) => false [INFO] [stdout] 38 | | } [INFO] [stdout] | |_____^ help: try: `File::open(&filepath).is_ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/play/automaton/render.rs:410:9 [INFO] [stdout] | [INFO] [stdout] 410 | / ... if state.show_field { [INFO] [stdout] 411 | | ... if (fpu >= 0) && (fpu < (state.field.height() as i32)) && (fpv >= 0) && (fpv < (state.field.width() as i32)) && (fpw >=... [INFO] [stdout] 412 | | ... let amph = cells[fpu as usize][fpv as usize][fpw as usize].amph; [INFO] [stdout] 413 | | ... sys.draw_text(font, format!("{} ({}, {}, {})", lingua.get1_or_echo("field cell"), fpu, fpv, fpw), 0, TEXT_COLOR, TE... [INFO] [stdout] ... | [INFO] [stdout] 420 | | ... } [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] 410 ~ if state.show_field [INFO] [stdout] 411 ~ && (fpu >= 0) && (fpu < (state.field.height() as i32)) && (fpv >= 0) && (fpv < (state.field.width() as i32)) && (fpw >= 0) && (fpw < (state.field.length() as i32)) { [INFO] [stdout] 412 | let amph = cells[fpu as usize][fpv as usize][fpw as usize].amph; [INFO] [stdout] ... [INFO] [stdout] 418 | info_y += fh << 1; [INFO] [stdout] 419 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/sys/input/keys.rs:26:5 [INFO] [stdout] | [INFO] [stdout] 26 | / match k { [INFO] [stdout] 27 | | Some(k) => Some(match k { [INFO] [stdout] 28 | | Escape => Scancode::Escape, [INFO] [stdout] 29 | | Enter => Scancode::Return, [INFO] [stdout] ... | [INFO] [stdout] 136 | | None => None [INFO] [stdout] 137 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 26 ~ k.map(|k| match k { [INFO] [stdout] 27 + Escape => Scancode::Escape, [INFO] [stdout] 28 + Enter => Scancode::Return, [INFO] [stdout] 29 + KpEnter => Scancode::KpEnter, [INFO] [stdout] 30 + Space => Scancode::Space, [INFO] [stdout] 31 + [INFO] [stdout] 32 + Right => Scancode::Right, [INFO] [stdout] 33 + Up => Scancode::Up, [INFO] [stdout] 34 + Left => Scancode::Left, [INFO] [stdout] 35 + Down => Scancode::Down, [INFO] [stdout] 36 + [INFO] [stdout] 37 + Num0 => Scancode::Num0, [INFO] [stdout] 38 + Num1 => Scancode::Num1, [INFO] [stdout] 39 + Num2 => Scancode::Num2, [INFO] [stdout] 40 + Num3 => Scancode::Num3, [INFO] [stdout] 41 + Num4 => Scancode::Num4, [INFO] [stdout] 42 + Num5 => Scancode::Num5, [INFO] [stdout] 43 + Num6 => Scancode::Num6, [INFO] [stdout] 44 + Num7 => Scancode::Num7, [INFO] [stdout] 45 + Num8 => Scancode::Num8, [INFO] [stdout] 46 + Num9 => Scancode::Num9, [INFO] [stdout] 47 + [INFO] [stdout] 48 + Kp0 => Scancode::Kp0, [INFO] [stdout] 49 + Kp1 => Scancode::Kp1, [INFO] [stdout] 50 + Kp2 => Scancode::Kp2, [INFO] [stdout] 51 + Kp3 => Scancode::Kp3, [INFO] [stdout] 52 + Kp4 => Scancode::Kp4, [INFO] [stdout] 53 + Kp5 => Scancode::Kp5, [INFO] [stdout] 54 + Kp6 => Scancode::Kp6, [INFO] [stdout] 55 + Kp7 => Scancode::Kp7, [INFO] [stdout] 56 + Kp8 => Scancode::Kp8, [INFO] [stdout] 57 + Kp9 => Scancode::Kp9, [INFO] [stdout] 58 + [INFO] [stdout] 59 + KpDivide => Scancode::KpDivide, [INFO] [stdout] 60 + KpMultiply => Scancode::KpDivide, [INFO] [stdout] 61 + KpMinus => Scancode::KpMinus, [INFO] [stdout] 62 + KpPlus => Scancode::KpPlus, [INFO] [stdout] 63 + KpPeriod => Scancode::KpPeriod, [INFO] [stdout] 64 + [INFO] [stdout] 65 + A => Scancode::A, [INFO] [stdout] 66 + B => Scancode::B, [INFO] [stdout] 67 + C => Scancode::C, [INFO] [stdout] 68 + D => Scancode::D, [INFO] [stdout] 69 + E => Scancode::E, [INFO] [stdout] 70 + F => Scancode::F, [INFO] [stdout] 71 + G => Scancode::G, [INFO] [stdout] 72 + H => Scancode::H, [INFO] [stdout] 73 + I => Scancode::I, [INFO] [stdout] 74 + J => Scancode::J, [INFO] [stdout] 75 + K => Scancode::K, [INFO] [stdout] 76 + L => Scancode::L, [INFO] [stdout] 77 + M => Scancode::M, [INFO] [stdout] 78 + N => Scancode::N, [INFO] [stdout] 79 + O => Scancode::O, [INFO] [stdout] 80 + P => Scancode::P, [INFO] [stdout] 81 + Q => Scancode::Q, [INFO] [stdout] 82 + R => Scancode::R, [INFO] [stdout] 83 + S => Scancode::S, [INFO] [stdout] 84 + T => Scancode::T, [INFO] [stdout] 85 + U => Scancode::U, [INFO] [stdout] 86 + V => Scancode::V, [INFO] [stdout] 87 + W => Scancode::W, [INFO] [stdout] 88 + X => Scancode::X, [INFO] [stdout] 89 + Y => Scancode::Y, [INFO] [stdout] 90 + Z => Scancode::Z, [INFO] [stdout] 91 + [INFO] [stdout] 92 + F1 => Scancode::F1, [INFO] [stdout] 93 + F2 => Scancode::F2, [INFO] [stdout] 94 + F3 => Scancode::F3, [INFO] [stdout] 95 + F4 => Scancode::F4, [INFO] [stdout] 96 + F5 => Scancode::F5, [INFO] [stdout] 97 + F6 => Scancode::F6, [INFO] [stdout] 98 + F7 => Scancode::F7, [INFO] [stdout] 99 + F8 => Scancode::F8, [INFO] [stdout] 100 + F9 => Scancode::F9, [INFO] [stdout] 101 + F10 => Scancode::F10, [INFO] [stdout] 102 + F11 => Scancode::F11, [INFO] [stdout] 103 + F12 => Scancode::F12, [INFO] [stdout] 104 + [INFO] [stdout] 105 + Home => Scancode::Home, [INFO] [stdout] 106 + End => Scancode::End, [INFO] [stdout] 107 + PageUp => Scancode::PageUp, [INFO] [stdout] 108 + PageDown => Scancode::PageDown, [INFO] [stdout] 109 + [INFO] [stdout] 110 + Insert => Scancode::Insert, [INFO] [stdout] 111 + Delete => Scancode::Delete, [INFO] [stdout] 112 + Backspace => Scancode::Backspace, [INFO] [stdout] 113 + Tab => Scancode::Tab, [INFO] [stdout] 114 + [INFO] [stdout] 115 + LShift => Scancode::LShift, [INFO] [stdout] 116 + RShift => Scancode::RShift, [INFO] [stdout] 117 + LAlt => Scancode::LAlt, [INFO] [stdout] 118 + RAlt => Scancode::RAlt, [INFO] [stdout] 119 + LCtrl => Scancode::LCtrl, [INFO] [stdout] 120 + RCtrl => Scancode::RCtrl, [INFO] [stdout] 121 + [INFO] [stdout] 122 + Minus => Scancode::Minus, [INFO] [stdout] 123 + Equals => Scancode::Equals, [INFO] [stdout] 124 + LeftBracket => Scancode::LeftBracket, [INFO] [stdout] 125 + RightBracket => Scancode::RightBracket, [INFO] [stdout] 126 + Backslash => Scancode::Backslash, [INFO] [stdout] 127 + Semicolon => Scancode::Semicolon, [INFO] [stdout] 128 + Apostrophe => Scancode::Apostrophe, [INFO] [stdout] 129 + Grave => Scancode::Grave, [INFO] [stdout] 130 + Comma => Scancode::Comma, [INFO] [stdout] 131 + Period => Scancode::Period, [INFO] [stdout] 132 + Slash => Scancode::Slash [INFO] [stdout] 133 + [INFO] [stdout] 134 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/sys/input.rs:102:9 [INFO] [stdout] | [INFO] [stdout] 102 | / match self.keys_buffer.take(&key) { // removes from buffer [INFO] [stdout] 103 | | Some(_) => true, [INFO] [stdout] 104 | | None => false [INFO] [stdout] 105 | | } [INFO] [stdout] | |_________^ help: try: `self.keys_buffer.take(&key).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/sys/input.rs:190:9 [INFO] [stdout] | [INFO] [stdout] 190 | / match self.buttons_buffer.take(&(self.swap_if_lefthand(btn))) { // removes from buffer [INFO] [stdout] 191 | | Some(_) => true, [INFO] [stdout] 192 | | None => false [INFO] [stdout] 193 | | } [INFO] [stdout] | |_________^ help: try: `self.buttons_buffer.take(&(self.swap_if_lefthand(btn))).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/sys/input.rs:210:21 [INFO] [stdout] | [INFO] [stdout] 210 | / match keys::from_sdl(scancode) { [INFO] [stdout] 211 | | Some(k) => {self.keys_buffer.insert(k);}, [INFO] [stdout] 212 | | None => {} [INFO] [stdout] 213 | | } [INFO] [stdout] | |_____________________^ help: try: `if let Some(k) = keys::from_sdl(scancode) {self.keys_buffer.insert(k);}` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/sys/input.rs:216:21 [INFO] [stdout] | [INFO] [stdout] 216 | / match buttons::from_sdl(Some(mouse_btn)) { [INFO] [stdout] 217 | | Some(b) => {self.buttons_buffer.insert(b);}, [INFO] [stdout] 218 | | None => {} [INFO] [stdout] 219 | | } [INFO] [stdout] | |_____________________^ help: try: `if let Some(b) = buttons::from_sdl(Some(mouse_btn)) {self.buttons_buffer.insert(b);}` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/sys/video/geom.rs:96:5 [INFO] [stdout] | [INFO] [stdout] 96 | / pub fn draw_frame(&mut self, [INFO] [stdout] 97 | | x: i32, y: i32, width: i32, height: i32, // interior rectangle [INFO] [stdout] 98 | | color_int: ARGB, color_ext: ARGB, // internal and external edge color [INFO] [stdout] 99 | | thickness_binlog: i32) -> Result<(), String> { [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: redundant pattern matching, consider using `is_ok()` [INFO] [stdout] --> src/state.rs:35:2 [INFO] [stdout] | [INFO] [stdout] 35 | / match File::open(&filepath) { [INFO] [stdout] 36 | | Ok(_) => true, [INFO] [stdout] 37 | | Err(_) => false [INFO] [stdout] 38 | | } [INFO] [stdout] | |_____^ help: try: `File::open(&filepath).is_ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `slice` [INFO] [stdout] --> src/sys/video/image.rs:83:17 [INFO] [stdout] | [INFO] [stdout] 83 | scr_sub_rows.into_iter().for_each(|(i, vb_row)| { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter_mut` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/sys/video/pixel.rs:18:53 [INFO] [stdout] | [INFO] [stdout] 18 | buf[offs + 0] = (((color.b as u32) * a + (buf[offs + 0] as u32) * na) >> 8) as u8; [INFO] [stdout] | ^^^^^^^^ help: consider reducing it to: `offs` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/sys/video/pixel.rs:18:11 [INFO] [stdout] | [INFO] [stdout] 18 | buf[offs + 0] = (((color.b as u32) * a + (buf[offs + 0] as u32) * na) >> 8) as u8; [INFO] [stdout] | ^^^^^^^^ help: consider reducing it to: `offs` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/sys/video/pixel.rs:33:11 [INFO] [stdout] | [INFO] [stdout] 33 | buf[offs + 0] = color.b; [INFO] [stdout] | ^^^^^^^^ help: consider reducing it to: `offs` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/sys/video/text.rs:40:33 [INFO] [stdout] | [INFO] [stdout] 40 | None => Err(format!("sdl surface requires locking")) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"sdl surface requires locking".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: this function has too many arguments (9/7) [INFO] [stdout] --> src/sys/video/text.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | pub fn draw_text(&mut self, font: &Font, text: impl ToString, wrap: i32, color: RGB, shade: u8, margin: i32, x: i32, y: i32) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/sys/sys_audio.rs:10:23 [INFO] [stdout] | [INFO] [stdout] 10 | pub fn load_music<'a>(&self, filepath: impl ToString) -> Option { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/sys/sys_video.rs:110:2 [INFO] [stdout] | [INFO] [stdout] 110 | / pub fn draw_frame(&mut self, [INFO] [stdout] 111 | | x: i32, y: i32, width: i32, height: i32, // interior rectangle [INFO] [stdout] 112 | | color_int: ARGB, color_ext: ARGB, // internal and external edge color [INFO] [stdout] 113 | | thickness_binlog: i32) -> Result<(), String> { [INFO] [stdout] | |____________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> src/sys/sys_video.rs:135:5 [INFO] [stdout] | [INFO] [stdout] 135 | pub fn draw_text(&mut self, font: &Font, text: impl ToString, wrap: i32, color: RGB, shade: u8, margin: i32, x: i32, y: i32) -> Result<(), String> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/sys/input/keys.rs:26:5 [INFO] [stdout] | [INFO] [stdout] 26 | / match k { [INFO] [stdout] 27 | | Some(k) => Some(match k { [INFO] [stdout] 28 | | Escape => Scancode::Escape, [INFO] [stdout] 29 | | Enter => Scancode::Return, [INFO] [stdout] ... | [INFO] [stdout] 136 | | None => None [INFO] [stdout] 137 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 26 ~ k.map(|k| match k { [INFO] [stdout] 27 + Escape => Scancode::Escape, [INFO] [stdout] 28 + Enter => Scancode::Return, [INFO] [stdout] 29 + KpEnter => Scancode::KpEnter, [INFO] [stdout] 30 + Space => Scancode::Space, [INFO] [stdout] 31 + [INFO] [stdout] 32 + Right => Scancode::Right, [INFO] [stdout] 33 + Up => Scancode::Up, [INFO] [stdout] 34 + Left => Scancode::Left, [INFO] [stdout] 35 + Down => Scancode::Down, [INFO] [stdout] 36 + [INFO] [stdout] 37 + Num0 => Scancode::Num0, [INFO] [stdout] 38 + Num1 => Scancode::Num1, [INFO] [stdout] 39 + Num2 => Scancode::Num2, [INFO] [stdout] 40 + Num3 => Scancode::Num3, [INFO] [stdout] 41 + Num4 => Scancode::Num4, [INFO] [stdout] 42 + Num5 => Scancode::Num5, [INFO] [stdout] 43 + Num6 => Scancode::Num6, [INFO] [stdout] 44 + Num7 => Scancode::Num7, [INFO] [stdout] 45 + Num8 => Scancode::Num8, [INFO] [stdout] 46 + Num9 => Scancode::Num9, [INFO] [stdout] 47 + [INFO] [stdout] 48 + Kp0 => Scancode::Kp0, [INFO] [stdout] 49 + Kp1 => Scancode::Kp1, [INFO] [stdout] 50 + Kp2 => Scancode::Kp2, [INFO] [stdout] 51 + Kp3 => Scancode::Kp3, [INFO] [stdout] 52 + Kp4 => Scancode::Kp4, [INFO] [stdout] 53 + Kp5 => Scancode::Kp5, [INFO] [stdout] 54 + Kp6 => Scancode::Kp6, [INFO] [stdout] 55 + Kp7 => Scancode::Kp7, [INFO] [stdout] 56 + Kp8 => Scancode::Kp8, [INFO] [stdout] 57 + Kp9 => Scancode::Kp9, [INFO] [stdout] 58 + [INFO] [stdout] 59 + KpDivide => Scancode::KpDivide, [INFO] [stdout] 60 + KpMultiply => Scancode::KpDivide, [INFO] [stdout] 61 + KpMinus => Scancode::KpMinus, [INFO] [stdout] 62 + KpPlus => Scancode::KpPlus, [INFO] [stdout] 63 + KpPeriod => Scancode::KpPeriod, [INFO] [stdout] 64 + [INFO] [stdout] 65 + A => Scancode::A, [INFO] [stdout] 66 + B => Scancode::B, [INFO] [stdout] 67 + C => Scancode::C, [INFO] [stdout] 68 + D => Scancode::D, [INFO] [stdout] 69 + E => Scancode::E, [INFO] [stdout] 70 + F => Scancode::F, [INFO] [stdout] 71 + G => Scancode::G, [INFO] [stdout] 72 + H => Scancode::H, [INFO] [stdout] 73 + I => Scancode::I, [INFO] [stdout] 74 + J => Scancode::J, [INFO] [stdout] 75 + K => Scancode::K, [INFO] [stdout] 76 + L => Scancode::L, [INFO] [stdout] 77 + M => Scancode::M, [INFO] [stdout] 78 + N => Scancode::N, [INFO] [stdout] 79 + O => Scancode::O, [INFO] [stdout] 80 + P => Scancode::P, [INFO] [stdout] 81 + Q => Scancode::Q, [INFO] [stdout] 82 + R => Scancode::R, [INFO] [stdout] 83 + S => Scancode::S, [INFO] [stdout] 84 + T => Scancode::T, [INFO] [stdout] 85 + U => Scancode::U, [INFO] [stdout] 86 + V => Scancode::V, [INFO] [stdout] 87 + W => Scancode::W, [INFO] [stdout] 88 + X => Scancode::X, [INFO] [stdout] 89 + Y => Scancode::Y, [INFO] [stdout] 90 + Z => Scancode::Z, [INFO] [stdout] 91 + [INFO] [stdout] 92 + F1 => Scancode::F1, [INFO] [stdout] 93 + F2 => Scancode::F2, [INFO] [stdout] 94 + F3 => Scancode::F3, [INFO] [stdout] 95 + F4 => Scancode::F4, [INFO] [stdout] 96 + F5 => Scancode::F5, [INFO] [stdout] 97 + F6 => Scancode::F6, [INFO] [stdout] 98 + F7 => Scancode::F7, [INFO] [stdout] 99 + F8 => Scancode::F8, [INFO] [stdout] 100 + F9 => Scancode::F9, [INFO] [stdout] 101 + F10 => Scancode::F10, [INFO] [stdout] 102 + F11 => Scancode::F11, [INFO] [stdout] 103 + F12 => Scancode::F12, [INFO] [stdout] 104 + [INFO] [stdout] 105 + Home => Scancode::Home, [INFO] [stdout] 106 + End => Scancode::End, [INFO] [stdout] 107 + PageUp => Scancode::PageUp, [INFO] [stdout] 108 + PageDown => Scancode::PageDown, [INFO] [stdout] 109 + [INFO] [stdout] 110 + Insert => Scancode::Insert, [INFO] [stdout] 111 + Delete => Scancode::Delete, [INFO] [stdout] 112 + Backspace => Scancode::Backspace, [INFO] [stdout] 113 + Tab => Scancode::Tab, [INFO] [stdout] 114 + [INFO] [stdout] 115 + LShift => Scancode::LShift, [INFO] [stdout] 116 + RShift => Scancode::RShift, [INFO] [stdout] 117 + LAlt => Scancode::LAlt, [INFO] [stdout] 118 + RAlt => Scancode::RAlt, [INFO] [stdout] 119 + LCtrl => Scancode::LCtrl, [INFO] [stdout] 120 + RCtrl => Scancode::RCtrl, [INFO] [stdout] 121 + [INFO] [stdout] 122 + Minus => Scancode::Minus, [INFO] [stdout] 123 + Equals => Scancode::Equals, [INFO] [stdout] 124 + LeftBracket => Scancode::LeftBracket, [INFO] [stdout] 125 + RightBracket => Scancode::RightBracket, [INFO] [stdout] 126 + Backslash => Scancode::Backslash, [INFO] [stdout] 127 + Semicolon => Scancode::Semicolon, [INFO] [stdout] 128 + Apostrophe => Scancode::Apostrophe, [INFO] [stdout] 129 + Grave => Scancode::Grave, [INFO] [stdout] 130 + Comma => Scancode::Comma, [INFO] [stdout] 131 + Period => Scancode::Period, [INFO] [stdout] 132 + Slash => Scancode::Slash [INFO] [stdout] 133 + [INFO] [stdout] 134 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/sys/input.rs:102:9 [INFO] [stdout] | [INFO] [stdout] 102 | / match self.keys_buffer.take(&key) { // removes from buffer [INFO] [stdout] 103 | | Some(_) => true, [INFO] [stdout] 104 | | None => false [INFO] [stdout] 105 | | } [INFO] [stdout] | |_________^ help: try: `self.keys_buffer.take(&key).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/sys/input.rs:190:9 [INFO] [stdout] | [INFO] [stdout] 190 | / match self.buttons_buffer.take(&(self.swap_if_lefthand(btn))) { // removes from buffer [INFO] [stdout] 191 | | Some(_) => true, [INFO] [stdout] 192 | | None => false [INFO] [stdout] 193 | | } [INFO] [stdout] | |_________^ help: try: `self.buttons_buffer.take(&(self.swap_if_lefthand(btn))).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/sys/input.rs:210:21 [INFO] [stdout] | [INFO] [stdout] 210 | / match keys::from_sdl(scancode) { [INFO] [stdout] 211 | | Some(k) => {self.keys_buffer.insert(k);}, [INFO] [stdout] 212 | | None => {} [INFO] [stdout] 213 | | } [INFO] [stdout] | |_____________________^ help: try: `if let Some(k) = keys::from_sdl(scancode) {self.keys_buffer.insert(k);}` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/sys/input.rs:216:21 [INFO] [stdout] | [INFO] [stdout] 216 | / match buttons::from_sdl(Some(mouse_btn)) { [INFO] [stdout] 217 | | Some(b) => {self.buttons_buffer.insert(b);}, [INFO] [stdout] 218 | | None => {} [INFO] [stdout] 219 | | } [INFO] [stdout] | |_____________________^ help: try: `if let Some(b) = buttons::from_sdl(Some(mouse_btn)) {self.buttons_buffer.insert(b);}` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/sys/video/geom.rs:96:5 [INFO] [stdout] | [INFO] [stdout] 96 | / pub fn draw_frame(&mut self, [INFO] [stdout] 97 | | x: i32, y: i32, width: i32, height: i32, // interior rectangle [INFO] [stdout] 98 | | color_int: ARGB, color_ext: ARGB, // internal and external edge color [INFO] [stdout] 99 | | thickness_binlog: i32) -> Result<(), String> { [INFO] [stdout] | |____________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.into_iter()` call is equivalent to `.iter_mut()` and will not consume the `slice` [INFO] [stdout] --> src/sys/video/image.rs:83:17 [INFO] [stdout] | [INFO] [stdout] 83 | scr_sub_rows.into_iter().for_each(|(i, vb_row)| { [INFO] [stdout] | ^^^^^^^^^ help: call directly: `iter_mut` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#into_iter_on_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/sys/video/pixel.rs:18:53 [INFO] [stdout] | [INFO] [stdout] 18 | buf[offs + 0] = (((color.b as u32) * a + (buf[offs + 0] as u32) * na) >> 8) as u8; [INFO] [stdout] | ^^^^^^^^ help: consider reducing it to: `offs` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] = note: `#[warn(clippy::identity_op)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/sys/video/pixel.rs:18:11 [INFO] [stdout] | [INFO] [stdout] 18 | buf[offs + 0] = (((color.b as u32) * a + (buf[offs + 0] as u32) * na) >> 8) as u8; [INFO] [stdout] | ^^^^^^^^ help: consider reducing it to: `offs` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this operation has no effect [INFO] [stdout] --> src/sys/video/pixel.rs:33:11 [INFO] [stdout] | [INFO] [stdout] 33 | buf[offs + 0] = color.b; [INFO] [stdout] | ^^^^^^^^ help: consider reducing it to: `offs` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/sys/video/text.rs:40:33 [INFO] [stdout] | [INFO] [stdout] 40 | None => Err(format!("sdl surface requires locking")) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"sdl surface requires locking".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: this function has too many arguments (9/7) [INFO] [stdout] --> src/sys/video/text.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | pub fn draw_text(&mut self, font: &Font, text: impl ToString, wrap: i32, color: RGB, shade: u8, margin: i32, x: i32, y: i32) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/sys/sys_audio.rs:10:23 [INFO] [stdout] | [INFO] [stdout] 10 | pub fn load_music<'a>(&self, filepath: impl ToString) -> Option { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/sys/sys_video.rs:110:2 [INFO] [stdout] | [INFO] [stdout] 110 | / pub fn draw_frame(&mut self, [INFO] [stdout] 111 | | x: i32, y: i32, width: i32, height: i32, // interior rectangle [INFO] [stdout] 112 | | color_int: ARGB, color_ext: ARGB, // internal and external edge color [INFO] [stdout] 113 | | thickness_binlog: i32) -> Result<(), String> { [INFO] [stdout] | |____________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> src/sys/sys_video.rs:135:5 [INFO] [stdout] | [INFO] [stdout] 135 | pub fn draw_text(&mut self, font: &Font, text: impl ToString, wrap: i32, color: RGB, shade: u8, margin: i32, x: i32, y: i32) -> Result<(), String> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 9.62s [INFO] running `Command { std: "docker" "inspect" "3837cce7347a409dd49ef3808eaba147b971e901f244605d28063436a8196565", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "3837cce7347a409dd49ef3808eaba147b971e901f244605d28063436a8196565", kill_on_drop: false }` [INFO] [stdout] 3837cce7347a409dd49ef3808eaba147b971e901f244605d28063436a8196565