[INFO] cloning repository https://github.com/felixnaredi/the-idiot [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/felixnaredi/the-idiot" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ffelixnaredi%2Fthe-idiot", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ffelixnaredi%2Fthe-idiot'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] c8d21cba5847c3d4d7931463d26423588ee84d6c [INFO] linting felixnaredi/the-idiot against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ffelixnaredi%2Fthe-idiot" "/workspace/builds/worker-6-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-6-tc1/source'... [INFO] [stderr] done. [INFO] removed /workspace/builds/worker-6-tc1/source/rust-toolchain.toml [INFO] started tweaking git repo https://github.com/felixnaredi/the-idiot [INFO] finished tweaking git repo https://github.com/felixnaredi/the-idiot [INFO] tweaked toml for git repo https://github.com/felixnaredi/the-idiot written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/felixnaredi/the-idiot on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/felixnaredi/the-idiot already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded getset v0.1.1 [INFO] [stderr] Downloaded enum-map-derive v0.4.6 [INFO] [stderr] Downloaded wasmer_enumset_derive v0.5.0 [INFO] [stderr] Downloaded cursive v0.16.3 [INFO] [stderr] Downloaded enum-map v0.6.4 [INFO] [stderr] Downloaded num v0.3.1 [INFO] [stderr] Downloaded num-complex v0.3.1 [INFO] [stderr] Downloaded array-macro v1.0.5 [INFO] [stderr] Downloaded libc v0.2.102 [INFO] [stderr] Downloaded wasmer_enumset v1.0.1 [INFO] [stderr] Downloaded syn v1.0.76 [INFO] [stderr] Downloaded cursive_core v0.2.2 [INFO] [stderr] Downloaded ahash v0.6.3 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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] 41dece0ed71c3c934714bd06d45d27a071e7264d121be5296629fb2924a2780e [INFO] running `Command { std: "docker" "start" "-a" "41dece0ed71c3c934714bd06d45d27a071e7264d121be5296629fb2924a2780e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "41dece0ed71c3c934714bd06d45d27a071e7264d121be5296629fb2924a2780e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "41dece0ed71c3c934714bd06d45d27a071e7264d121be5296629fb2924a2780e", kill_on_drop: false }` [INFO] [stdout] 41dece0ed71c3c934714bd06d45d27a071e7264d121be5296629fb2924a2780e [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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] f88c37a4d2279f728e65b347990b0efb66bd18671eaf87a671205d1c3681b85e [INFO] running `Command { std: "docker" "start" "-a" "f88c37a4d2279f728e65b347990b0efb66bd18671eaf87a671205d1c3681b85e", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.29 [INFO] [stderr] Compiling syn v1.0.76 [INFO] [stderr] Compiling libc v0.2.102 [INFO] [stderr] Compiling version_check v0.9.3 [INFO] [stderr] Compiling strsim v0.9.3 [INFO] [stderr] Compiling crossbeam-utils v0.8.5 [INFO] [stderr] Checking unicode-xid v0.2.2 [INFO] [stderr] Compiling num-traits v0.2.14 [INFO] [stderr] Compiling num-integer v0.1.44 [INFO] [stderr] Compiling num-iter v0.1.42 [INFO] [stderr] Compiling num-rational v0.3.2 [INFO] [stderr] Compiling ncurses v5.101.0 [INFO] [stderr] Checking array-macro v1.0.5 [INFO] [stderr] Checking once_cell v1.8.0 [INFO] [stderr] Checking owning_ref v0.4.1 [INFO] [stderr] Checking xi-unicode v0.3.0 [INFO] [stderr] Checking unicode-width v0.1.8 [INFO] [stderr] Compiling ahash v0.6.3 [INFO] [stderr] Compiling proc-macro-error-attr v1.0.4 [INFO] [stderr] Compiling proc-macro-error v1.0.4 [INFO] [stderr] Checking crossbeam-channel v0.5.1 [INFO] [stderr] Checking quote v1.0.9 [INFO] [stderr] Checking getrandom v0.2.3 [INFO] [stderr] Checking time v0.1.43 [INFO] [stderr] Checking signal-hook-registry v1.4.0 [INFO] [stderr] Checking term_size v0.3.2 [INFO] [stderr] Checking num-complex v0.3.1 [INFO] [stderr] Checking rand_core v0.6.3 [INFO] [stderr] Checking signal-hook v0.3.10 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand v0.8.4 [INFO] [stderr] Checking num v0.3.1 [INFO] [stderr] Compiling darling_core v0.10.2 [INFO] [stderr] Compiling serde_derive v1.0.130 [INFO] [stderr] Compiling enum-map-derive v0.4.6 [INFO] [stderr] Compiling getset v0.1.1 [INFO] [stderr] Checking enum-map v0.6.4 [INFO] [stderr] Compiling darling_macro v0.10.2 [INFO] [stderr] Compiling darling v0.10.2 [INFO] [stderr] Compiling wasmer_enumset_derive v0.5.0 [INFO] [stderr] Checking wasmer_enumset v1.0.1 [INFO] [stderr] Checking serde v1.0.130 [INFO] [stderr] Checking chrono v0.4.19 [INFO] [stderr] Checking serde_json v1.0.68 [INFO] [stderr] Checking uuid v0.8.2 [INFO] [stderr] Checking cursive_core v0.2.2 [INFO] [stderr] Checking cursive v0.16.3 [INFO] [stderr] Checking the-idiot v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: the feature `iter_zip` has been stable since 1.59.0 and no longer requires an attribute to enable [INFO] [stdout] --> src/main.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | #![feature(iter_zip)] [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(stable_features)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the feature `iter_zip` has been stable since 1.59.0 and no longer requires an attribute to enable [INFO] [stdout] --> src/main.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | #![feature(iter_zip)] [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(stable_features)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:81:9 [INFO] [stdout] | [INFO] [stdout] 81 | self.on_new_game.as_ref().map(|listener| listener(s)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] = note: `#[warn(clippy::option_map_unit_fn)]` on by default [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 81 - self.on_new_game.as_ref().map(|listener| listener(s)); [INFO] [stdout] 81 + if let Some(listener) = self.on_new_game.as_ref() { listener(s) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:92:21 [INFO] [stdout] | [INFO] [stdout] 92 | self.on_event.as_ref().map(|listener| listener(s, event)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 92 - self.on_event.as_ref().map(|listener| listener(s, event)); [INFO] [stdout] 92 + if let Some(listener) = self.on_event.as_ref() { listener(s, event) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:99:21 [INFO] [stdout] | [INFO] [stdout] 99 | self.on_error.as_ref().map(|listener| listener(&error)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 99 - self.on_error.as_ref().map(|listener| listener(&error)); [INFO] [stdout] 99 + if let Some(listener) = self.on_error.as_ref() { listener(&error) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:110:21 [INFO] [stdout] | [INFO] [stdout] 110 | self.on_event.as_ref().map(|listener| listener(s, event)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 110 - self.on_event.as_ref().map(|listener| listener(s, event)); [INFO] [stdout] 110 + if let Some(listener) = self.on_event.as_ref() { listener(s, event) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:116:21 [INFO] [stdout] | [INFO] [stdout] 116 | self.on_error.as_ref().map(|listener| listener(&error)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 116 - self.on_error.as_ref().map(|listener| listener(&error)); [INFO] [stdout] 116 + if let Some(listener) = self.on_error.as_ref() { listener(&error) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:127:21 [INFO] [stdout] | [INFO] [stdout] 127 | self.on_event.as_ref().map(|listener| listener(s, event)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 127 - self.on_event.as_ref().map(|listener| listener(s, event)); [INFO] [stdout] 127 + if let Some(listener) = self.on_event.as_ref() { listener(s, event) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:133:21 [INFO] [stdout] | [INFO] [stdout] 133 | self.on_error.as_ref().map(|listener| listener(&error)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 133 - self.on_error.as_ref().map(|listener| listener(&error)); [INFO] [stdout] 133 + if let Some(listener) = self.on_error.as_ref() { listener(&error) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:141:9 [INFO] [stdout] | [INFO] [stdout] 141 | / self.on_deck_size_changed.as_ref().map(|listener| { [INFO] [stdout] 142 | | self.game [INFO] [stdout] 143 | | .as_ref() [INFO] [stdout] 144 | | .map(Game::deck) [INFO] [stdout] 145 | | .map(Deck::len) [INFO] [stdout] 146 | | .map(|len| listener(s, len)); [INFO] [stdout] 147 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 141 ~ if let Some(listener) = self.on_deck_size_changed.as_ref() { self.game [INFO] [stdout] 142 + .as_ref() [INFO] [stdout] 143 + .map(Game::deck) [INFO] [stdout] 144 + .map(Deck::len) [INFO] [stdout] 145 + .map(|len| listener(s, len)); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:142:13 [INFO] [stdout] | [INFO] [stdout] 142 | / self.game [INFO] [stdout] 143 | | .as_ref() [INFO] [stdout] 144 | | .map(Game::deck) [INFO] [stdout] 145 | | .map(Deck::len) [INFO] [stdout] 146 | | .map(|len| listener(s, len)); [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 142 ~ if let Some(len) = self.game [INFO] [stdout] 143 + .as_ref() [INFO] [stdout] 144 + .map(Game::deck) [INFO] [stdout] 145 + .map(Deck::len) { listener(s, len) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:152:9 [INFO] [stdout] | [INFO] [stdout] 152 | / self.on_check_deal_possible.as_ref().map(|listener| { [INFO] [stdout] 153 | | self.game [INFO] [stdout] 154 | | .as_ref() [INFO] [stdout] 155 | | .map(Game::check_deal) [INFO] [stdout] 156 | | .map(|result| listener(s, result.is_ok())); [INFO] [stdout] 157 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 152 ~ if let Some(listener) = self.on_check_deal_possible.as_ref() { self.game [INFO] [stdout] 153 + .as_ref() [INFO] [stdout] 154 + .map(Game::check_deal) [INFO] [stdout] 155 + .map(|result| listener(s, result.is_ok())); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:153:13 [INFO] [stdout] | [INFO] [stdout] 153 | / self.game [INFO] [stdout] 154 | | .as_ref() [INFO] [stdout] 155 | | .map(Game::check_deal) [INFO] [stdout] 156 | | .map(|result| listener(s, result.is_ok())); [INFO] [stdout] | |__________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 153 ~ if let Some(result) = self.game [INFO] [stdout] 154 + .as_ref() [INFO] [stdout] 155 + .map(Game::check_deal) { listener(s, result.is_ok()) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:162:9 [INFO] [stdout] | [INFO] [stdout] 162 | / self.on_check_place_possible.as_ref().map(|listener| { [INFO] [stdout] 163 | | self.game.as_ref().map(Game::table).map(|table| { [INFO] [stdout] 164 | | listener( [INFO] [stdout] 165 | | s, [INFO] [stdout] ... | [INFO] [stdout] 169 | | }); [INFO] [stdout] 170 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 162 ~ if let Some(listener) = self.on_check_place_possible.as_ref() { self.game.as_ref().map(Game::table).map(|table| { [INFO] [stdout] 163 + listener( [INFO] [stdout] 164 + s, [INFO] [stdout] 165 + table.iter().map(Vec::len).any(|len| len > 1) [INFO] [stdout] 166 + && table.iter().map(Vec::is_empty).any(|x| x), [INFO] [stdout] 167 + ); [INFO] [stdout] 168 + }); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:163:13 [INFO] [stdout] | [INFO] [stdout] 163 | / self.game.as_ref().map(Game::table).map(|table| { [INFO] [stdout] 164 | | listener( [INFO] [stdout] 165 | | s, [INFO] [stdout] 166 | | table.iter().map(Vec::len).any(|len| len > 1) [INFO] [stdout] 167 | | && table.iter().map(Vec::is_empty).any(|x| x), [INFO] [stdout] 168 | | ); [INFO] [stdout] 169 | | }); [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 163 ~ if let Some(table) = self.game.as_ref().map(Game::table) { listener( [INFO] [stdout] 164 + s, [INFO] [stdout] 165 + table.iter().map(Vec::len).any(|len| len > 1) [INFO] [stdout] 166 + && table.iter().map(Vec::is_empty).any(|x| x), [INFO] [stdout] 167 + ); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `.map(...).any(identity)` [INFO] [stdout] --> src/controllers/model_controller.rs:167:41 [INFO] [stdout] | [INFO] [stdout] 167 | && table.iter().map(Vec::is_empty).any(|x| x), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_all_any_identity [INFO] [stdout] = note: `#[warn(clippy::map_all_any_identity)]` on by default [INFO] [stdout] help: use `.any(...)` instead [INFO] [stdout] | [INFO] [stdout] 167 - && table.iter().map(Vec::is_empty).any(|x| x), [INFO] [stdout] 167 + && table.iter().any(Vec::is_empty), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/controllers/model_controller.rs:178:18 [INFO] [stdout] | [INFO] [stdout] 178 | .map(Game::game_result) [INFO] [stdout] | __________________^ [INFO] [stdout] 179 | | .flatten() [INFO] [stdout] | |__________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(Game::game_result)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/view_controller.rs:75:25 [INFO] [stdout] | [INFO] [stdout] 75 | / mode.map(|mode| match mode { [INFO] [stdout] 76 | | Mode::Eliminate => { [INFO] [stdout] 77 | | model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 78 | | model_controller.borrow_mut().eliminate(s, index) [INFO] [stdout] ... | [INFO] [stdout] 99 | | }); [INFO] [stdout] | |__________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 75 - mode.map(|mode| match mode { [INFO] [stdout] 76 - Mode::Eliminate => { [INFO] [stdout] 77 - model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 78 - model_controller.borrow_mut().eliminate(s, index) [INFO] [stdout] 79 - }); [INFO] [stdout] 80 - } [INFO] [stdout] 81 - Mode::PlaceFrom => { [INFO] [stdout] 82 - from_index.upgrade().map(|from_index| { [INFO] [stdout] 83 - let _ = from_index.borrow_mut().insert(index); [INFO] [stdout] 84 - }); [INFO] [stdout] 85 - set_mode(s, Mode::PlaceTo); [INFO] [stdout] 86 - } [INFO] [stdout] 87 - Mode::PlaceTo => { [INFO] [stdout] 88 - from_index.upgrade().map(|from_index| { [INFO] [stdout] 89 - from_index.borrow_mut().take().map(|from_index| { [INFO] [stdout] 90 - model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 91 - model_controller [INFO] [stdout] 92 - .borrow_mut() [INFO] [stdout] 93 - .place(s, from_index, index); [INFO] [stdout] 94 - }) [INFO] [stdout] 95 - }) [INFO] [stdout] 96 - }); [INFO] [stdout] 97 - set_mode(s, Mode::Eliminate); [INFO] [stdout] 98 - } [INFO] [stdout] 99 - }); [INFO] [stdout] 75 + if let Some(mode) = mode { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/view_controller.rs:77:33 [INFO] [stdout] | [INFO] [stdout] 77 | / ... model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 78 | | ... model_controller.borrow_mut().eliminate(s, index) [INFO] [stdout] 79 | | ... }); [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 77 - model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 78 - model_controller.borrow_mut().eliminate(s, index) [INFO] [stdout] 79 - }); [INFO] [stdout] 77 + if let Some(model_controller) = model_controller.upgrade() { model_controller.borrow_mut().eliminate(s, index) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/view_controller.rs:82:33 [INFO] [stdout] | [INFO] [stdout] 82 | / ... from_index.upgrade().map(|from_index| { [INFO] [stdout] 83 | | ... let _ = from_index.borrow_mut().insert(index); [INFO] [stdout] 84 | | ... }); [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 82 - from_index.upgrade().map(|from_index| { [INFO] [stdout] 83 - let _ = from_index.borrow_mut().insert(index); [INFO] [stdout] 84 - }); [INFO] [stdout] 82 + if let Some(from_index) = from_index.upgrade() { let _ = from_index.borrow_mut().insert(index); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/view_controller.rs:119:33 [INFO] [stdout] | [INFO] [stdout] 119 | / ... model_controller [INFO] [stdout] 120 | | ... .upgrade() [INFO] [stdout] 121 | | ... .map(|model_controller| model_controller.borrow_mut().deal(s)); [INFO] [stdout] | |________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 119 ~ if let Some(model_controller) = model_controller [INFO] [stdout] 120 + .upgrade() { model_controller.borrow_mut().deal(s) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/view_controller.rs:142:33 [INFO] [stdout] | [INFO] [stdout] 142 | / ... model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 143 | | ... model_controller.borrow_mut().new_game(s) [INFO] [stdout] 144 | | ... }); [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 142 - model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 143 - model_controller.borrow_mut().new_game(s) [INFO] [stdout] 144 - }); [INFO] [stdout] 142 + if let Some(model_controller) = model_controller.upgrade() { model_controller.borrow_mut().new_game(s) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/view_controller.rs:151:33 [INFO] [stdout] | [INFO] [stdout] 151 | / ... model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 152 | | ... model_controller.borrow_mut().drop_game() [INFO] [stdout] 153 | | ... }); [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 151 - model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 152 - model_controller.borrow_mut().drop_game() [INFO] [stdout] 153 - }); [INFO] [stdout] 151 + if let Some(model_controller) = model_controller.upgrade() { model_controller.borrow_mut().drop_game() } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/game/card.rs:113:18 [INFO] [stdout] | [INFO] [stdout] 113 | .map(|suit| { [INFO] [stdout] | __________________^ [INFO] [stdout] 114 | | vec![ [INFO] [stdout] 115 | | Ace, [INFO] [stdout] 116 | | Num(2), [INFO] [stdout] ... | [INFO] [stdout] 131 | | }) [INFO] [stdout] 132 | | .flatten() [INFO] [stdout] | |__________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 113 ~ .flat_map(|suit| { [INFO] [stdout] 114 + vec![ [INFO] [stdout] 115 + Ace, [INFO] [stdout] 116 + Num(2), [INFO] [stdout] 117 + Num(3), [INFO] [stdout] 118 + Num(4), [INFO] [stdout] 119 + Num(5), [INFO] [stdout] 120 + Num(6), [INFO] [stdout] 121 + Num(7), [INFO] [stdout] 122 + Num(8), [INFO] [stdout] 123 + Num(9), [INFO] [stdout] 124 + Num(10), [INFO] [stdout] 125 + Knight, [INFO] [stdout] 126 + Queen, [INFO] [stdout] 127 + King, [INFO] [stdout] 128 + ] [INFO] [stdout] 129 + .into_iter() [INFO] [stdout] 130 + .map(move |rank| Card::new(suit.clone(), rank)) [INFO] [stdout] 131 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/game/card.rs:203:17 [INFO] [stdout] | [INFO] [stdout] 203 | assert!(!(Ace > Num(2))); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `(Ace <= Num(2))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/game/card.rs:204:17 [INFO] [stdout] | [INFO] [stdout] 204 | assert!(!(Num(2) > Num(10))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `(Num(2) <= Num(10))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/game/card.rs:205:17 [INFO] [stdout] | [INFO] [stdout] 205 | assert!(!(Num(10) > Knight)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try: `(Num(10) <= Knight)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/game/card.rs:206:17 [INFO] [stdout] | [INFO] [stdout] 206 | assert!(!(Knight > Queen)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `(Knight <= Queen)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/game/card.rs:207:17 [INFO] [stdout] | [INFO] [stdout] 207 | assert!(!(Queen > King)); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try: `(Queen <= King)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/game.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | mod game; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/game/game.rs:91:9 [INFO] [stdout] | [INFO] [stdout] 91 | / (self.deck.len() > 3) [INFO] [stdout] 92 | | .then(|| ()) [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 92 - .then(|| ()) [INFO] [stdout] 92 + .then_some(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/game/game.rs:99:17 [INFO] [stdout] | [INFO] [stdout] 99 | / (suits.insert(suit)) [INFO] [stdout] 100 | | .then(|| ()) [INFO] [stdout] | |________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 100 - .then(|| ()) [INFO] [stdout] 100 + .then_some(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `table` [INFO] [stdout] --> src/game/game.rs:117:18 [INFO] [stdout] | [INFO] [stdout] 117 | for i in 0..4 { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 117 - for i in 0..4 { [INFO] [stdout] 117 + for in table.iter_mut().take(4) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/game/game.rs:148:9 [INFO] [stdout] | [INFO] [stdout] 148 | / table [INFO] [stdout] 149 | | .iter() [INFO] [stdout] 150 | | .map(|row| row.last().map(|other| other.greater(card))) [INFO] [stdout] 151 | | .any(|compare| compare == Some(Some(true))) [INFO] [stdout] 152 | | .then(|| ()) [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 152 - .then(|| ()) [INFO] [stdout] 152 + .then_some(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/game/game.rs:184:9 [INFO] [stdout] | [INFO] [stdout] 184 | / (table[from].len() > 1) [INFO] [stdout] 185 | | .then(|| ()) [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 185 - .then(|| ()) [INFO] [stdout] 185 + .then_some(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/game/game.rs:189:9 [INFO] [stdout] | [INFO] [stdout] 189 | / table[to] [INFO] [stdout] 190 | | .last() [INFO] [stdout] 191 | | .is_none() [INFO] [stdout] 192 | | .then(|| ()) [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 192 - .then(|| ()) [INFO] [stdout] 192 + .then_some(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/game/game.rs:226:9 [INFO] [stdout] | [INFO] [stdout] 226 | self.deck.is_empty().then(|| ())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 226 - self.deck.is_empty().then(|| ())?; [INFO] [stdout] 226 + self.deck.is_empty().then_some(())?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/game/game.rs:229:9 [INFO] [stdout] | [INFO] [stdout] 229 | / (0..4) [INFO] [stdout] 230 | | .map(|i| self.check_eliminate(i)) [INFO] [stdout] 231 | | .all(|result| result.is_err()) [INFO] [stdout] 232 | | .then(|| ())?; [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 232 - .then(|| ())?; [INFO] [stdout] 232 + .then_some(())?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/game/game.rs:235:9 [INFO] [stdout] | [INFO] [stdout] 235 | / (!((self.table.iter().map(Vec::is_empty).any(|x| x)) [INFO] [stdout] 236 | | && (self.table.iter().map(Vec::len).any(|len| len > 1)))) [INFO] [stdout] 237 | | .then(|| ())?; [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 237 - .then(|| ())?; [INFO] [stdout] 237 + .then_some(())?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `.map(...).any(identity)` [INFO] [stdout] --> src/game/game.rs:235:31 [INFO] [stdout] | [INFO] [stdout] 235 | (!((self.table.iter().map(Vec::is_empty).any(|x| x)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_all_any_identity [INFO] [stdout] help: use `.any(...)` instead [INFO] [stdout] | [INFO] [stdout] 235 - (!((self.table.iter().map(Vec::is_empty).any(|x| x)) [INFO] [stdout] 235 + (!((self.table.iter().any(Vec::is_empty)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:81:9 [INFO] [stdout] | [INFO] [stdout] 81 | self.on_new_game.as_ref().map(|listener| listener(s)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] = note: `#[warn(clippy::option_map_unit_fn)]` on by default [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 81 - self.on_new_game.as_ref().map(|listener| listener(s)); [INFO] [stdout] 81 + if let Some(listener) = self.on_new_game.as_ref() { listener(s) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:92:21 [INFO] [stdout] | [INFO] [stdout] 92 | self.on_event.as_ref().map(|listener| listener(s, event)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 92 - self.on_event.as_ref().map(|listener| listener(s, event)); [INFO] [stdout] 92 + if let Some(listener) = self.on_event.as_ref() { listener(s, event) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:99:21 [INFO] [stdout] | [INFO] [stdout] 99 | self.on_error.as_ref().map(|listener| listener(&error)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 99 - self.on_error.as_ref().map(|listener| listener(&error)); [INFO] [stdout] 99 + if let Some(listener) = self.on_error.as_ref() { listener(&error) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:110:21 [INFO] [stdout] | [INFO] [stdout] 110 | self.on_event.as_ref().map(|listener| listener(s, event)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 110 - self.on_event.as_ref().map(|listener| listener(s, event)); [INFO] [stdout] 110 + if let Some(listener) = self.on_event.as_ref() { listener(s, event) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:116:21 [INFO] [stdout] | [INFO] [stdout] 116 | self.on_error.as_ref().map(|listener| listener(&error)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 116 - self.on_error.as_ref().map(|listener| listener(&error)); [INFO] [stdout] 116 + if let Some(listener) = self.on_error.as_ref() { listener(&error) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:127:21 [INFO] [stdout] | [INFO] [stdout] 127 | self.on_event.as_ref().map(|listener| listener(s, event)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 127 - self.on_event.as_ref().map(|listener| listener(s, event)); [INFO] [stdout] 127 + if let Some(listener) = self.on_event.as_ref() { listener(s, event) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:133:21 [INFO] [stdout] | [INFO] [stdout] 133 | self.on_error.as_ref().map(|listener| listener(&error)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 133 - self.on_error.as_ref().map(|listener| listener(&error)); [INFO] [stdout] 133 + if let Some(listener) = self.on_error.as_ref() { listener(&error) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:141:9 [INFO] [stdout] | [INFO] [stdout] 141 | / self.on_deck_size_changed.as_ref().map(|listener| { [INFO] [stdout] 142 | | self.game [INFO] [stdout] 143 | | .as_ref() [INFO] [stdout] 144 | | .map(Game::deck) [INFO] [stdout] 145 | | .map(Deck::len) [INFO] [stdout] 146 | | .map(|len| listener(s, len)); [INFO] [stdout] 147 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 141 ~ if let Some(listener) = self.on_deck_size_changed.as_ref() { self.game [INFO] [stdout] 142 + .as_ref() [INFO] [stdout] 143 + .map(Game::deck) [INFO] [stdout] 144 + .map(Deck::len) [INFO] [stdout] 145 + .map(|len| listener(s, len)); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:142:13 [INFO] [stdout] | [INFO] [stdout] 142 | / self.game [INFO] [stdout] 143 | | .as_ref() [INFO] [stdout] 144 | | .map(Game::deck) [INFO] [stdout] 145 | | .map(Deck::len) [INFO] [stdout] 146 | | .map(|len| listener(s, len)); [INFO] [stdout] | |____________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 142 ~ if let Some(len) = self.game [INFO] [stdout] 143 + .as_ref() [INFO] [stdout] 144 + .map(Game::deck) [INFO] [stdout] 145 + .map(Deck::len) { listener(s, len) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:152:9 [INFO] [stdout] | [INFO] [stdout] 152 | / self.on_check_deal_possible.as_ref().map(|listener| { [INFO] [stdout] 153 | | self.game [INFO] [stdout] 154 | | .as_ref() [INFO] [stdout] 155 | | .map(Game::check_deal) [INFO] [stdout] 156 | | .map(|result| listener(s, result.is_ok())); [INFO] [stdout] 157 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 152 ~ if let Some(listener) = self.on_check_deal_possible.as_ref() { self.game [INFO] [stdout] 153 + .as_ref() [INFO] [stdout] 154 + .map(Game::check_deal) [INFO] [stdout] 155 + .map(|result| listener(s, result.is_ok())); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:153:13 [INFO] [stdout] | [INFO] [stdout] 153 | / self.game [INFO] [stdout] 154 | | .as_ref() [INFO] [stdout] 155 | | .map(Game::check_deal) [INFO] [stdout] 156 | | .map(|result| listener(s, result.is_ok())); [INFO] [stdout] | |__________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 153 ~ if let Some(result) = self.game [INFO] [stdout] 154 + .as_ref() [INFO] [stdout] 155 + .map(Game::check_deal) { listener(s, result.is_ok()) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:162:9 [INFO] [stdout] | [INFO] [stdout] 162 | / self.on_check_place_possible.as_ref().map(|listener| { [INFO] [stdout] 163 | | self.game.as_ref().map(Game::table).map(|table| { [INFO] [stdout] 164 | | listener( [INFO] [stdout] 165 | | s, [INFO] [stdout] ... | [INFO] [stdout] 169 | | }); [INFO] [stdout] 170 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 162 ~ if let Some(listener) = self.on_check_place_possible.as_ref() { self.game.as_ref().map(Game::table).map(|table| { [INFO] [stdout] 163 + listener( [INFO] [stdout] 164 + s, [INFO] [stdout] 165 + table.iter().map(Vec::len).any(|len| len > 1) [INFO] [stdout] 166 + && table.iter().map(Vec::is_empty).any(|x| x), [INFO] [stdout] 167 + ); [INFO] [stdout] 168 + }); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/model_controller.rs:163:13 [INFO] [stdout] | [INFO] [stdout] 163 | / self.game.as_ref().map(Game::table).map(|table| { [INFO] [stdout] 164 | | listener( [INFO] [stdout] 165 | | s, [INFO] [stdout] 166 | | table.iter().map(Vec::len).any(|len| len > 1) [INFO] [stdout] 167 | | && table.iter().map(Vec::is_empty).any(|x| x), [INFO] [stdout] 168 | | ); [INFO] [stdout] 169 | | }); [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 163 ~ if let Some(table) = self.game.as_ref().map(Game::table) { listener( [INFO] [stdout] 164 + s, [INFO] [stdout] 165 + table.iter().map(Vec::len).any(|len| len > 1) [INFO] [stdout] 166 + && table.iter().map(Vec::is_empty).any(|x| x), [INFO] [stdout] 167 + ); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `.map(...).any(identity)` [INFO] [stdout] --> src/controllers/model_controller.rs:167:41 [INFO] [stdout] | [INFO] [stdout] 167 | && table.iter().map(Vec::is_empty).any(|x| x), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_all_any_identity [INFO] [stdout] = note: `#[warn(clippy::map_all_any_identity)]` on by default [INFO] [stdout] help: use `.any(...)` instead [INFO] [stdout] | [INFO] [stdout] 167 - && table.iter().map(Vec::is_empty).any(|x| x), [INFO] [stdout] 167 + && table.iter().any(Vec::is_empty), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/controllers/model_controller.rs:178:18 [INFO] [stdout] | [INFO] [stdout] 178 | .map(Game::game_result) [INFO] [stdout] | __________________^ [INFO] [stdout] 179 | | .flatten() [INFO] [stdout] | |__________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(Game::game_result)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: passing a unit value to a function [INFO] [stdout] --> src/game/history.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | Ok(self.events.push(event)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg [INFO] [stdout] = note: `#[warn(clippy::unit_arg)]` on by default [INFO] [stdout] help: move the expression in front of the call and replace it with the unit literal `()` [INFO] [stdout] | [INFO] [stdout] 45 ~ self.events.push(event); [INFO] [stdout] 46 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/view_controller.rs:75:25 [INFO] [stdout] | [INFO] [stdout] 75 | / mode.map(|mode| match mode { [INFO] [stdout] 76 | | Mode::Eliminate => { [INFO] [stdout] 77 | | model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 78 | | model_controller.borrow_mut().eliminate(s, index) [INFO] [stdout] ... | [INFO] [stdout] 99 | | }); [INFO] [stdout] | |__________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 75 - mode.map(|mode| match mode { [INFO] [stdout] 76 - Mode::Eliminate => { [INFO] [stdout] 77 - model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 78 - model_controller.borrow_mut().eliminate(s, index) [INFO] [stdout] 79 - }); [INFO] [stdout] 80 - } [INFO] [stdout] 81 - Mode::PlaceFrom => { [INFO] [stdout] 82 - from_index.upgrade().map(|from_index| { [INFO] [stdout] 83 - let _ = from_index.borrow_mut().insert(index); [INFO] [stdout] 84 - }); [INFO] [stdout] 85 - set_mode(s, Mode::PlaceTo); [INFO] [stdout] 86 - } [INFO] [stdout] 87 - Mode::PlaceTo => { [INFO] [stdout] 88 - from_index.upgrade().map(|from_index| { [INFO] [stdout] 89 - from_index.borrow_mut().take().map(|from_index| { [INFO] [stdout] 90 - model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 91 - model_controller [INFO] [stdout] 92 - .borrow_mut() [INFO] [stdout] 93 - .place(s, from_index, index); [INFO] [stdout] 94 - }) [INFO] [stdout] 95 - }) [INFO] [stdout] 96 - }); [INFO] [stdout] 97 - set_mode(s, Mode::Eliminate); [INFO] [stdout] 98 - } [INFO] [stdout] 99 - }); [INFO] [stdout] 75 + if let Some(mode) = mode { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/view_controller.rs:77:33 [INFO] [stdout] | [INFO] [stdout] 77 | / ... model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 78 | | ... model_controller.borrow_mut().eliminate(s, index) [INFO] [stdout] 79 | | ... }); [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 77 - model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 78 - model_controller.borrow_mut().eliminate(s, index) [INFO] [stdout] 79 - }); [INFO] [stdout] 77 + if let Some(model_controller) = model_controller.upgrade() { model_controller.borrow_mut().eliminate(s, index) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/view_controller.rs:82:33 [INFO] [stdout] | [INFO] [stdout] 82 | / ... from_index.upgrade().map(|from_index| { [INFO] [stdout] 83 | | ... let _ = from_index.borrow_mut().insert(index); [INFO] [stdout] 84 | | ... }); [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 82 - from_index.upgrade().map(|from_index| { [INFO] [stdout] 83 - let _ = from_index.borrow_mut().insert(index); [INFO] [stdout] 84 - }); [INFO] [stdout] 82 + if let Some(from_index) = from_index.upgrade() { let _ = from_index.borrow_mut().insert(index); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/view_controller.rs:119:33 [INFO] [stdout] | [INFO] [stdout] 119 | / ... model_controller [INFO] [stdout] 120 | | ... .upgrade() [INFO] [stdout] 121 | | ... .map(|model_controller| model_controller.borrow_mut().deal(s)); [INFO] [stdout] | |________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 119 ~ if let Some(model_controller) = model_controller [INFO] [stdout] 120 + .upgrade() { model_controller.borrow_mut().deal(s) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/view_controller.rs:142:33 [INFO] [stdout] | [INFO] [stdout] 142 | / ... model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 143 | | ... model_controller.borrow_mut().new_game(s) [INFO] [stdout] 144 | | ... }); [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 142 - model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 143 - model_controller.borrow_mut().new_game(s) [INFO] [stdout] 144 - }); [INFO] [stdout] 142 + if let Some(model_controller) = model_controller.upgrade() { model_controller.borrow_mut().new_game(s) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> src/controllers/view_controller.rs:151:33 [INFO] [stdout] | [INFO] [stdout] 151 | / ... model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 152 | | ... model_controller.borrow_mut().drop_game() [INFO] [stdout] 153 | | ... }); [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 151 - model_controller.upgrade().map(|model_controller| { [INFO] [stdout] 152 - model_controller.borrow_mut().drop_game() [INFO] [stdout] 153 - }); [INFO] [stdout] 151 + if let Some(model_controller) = model_controller.upgrade() { model_controller.borrow_mut().drop_game() } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/views/highlight_view.rs:65:5 [INFO] [stdout] | [INFO] [stdout] 65 | theme.palette = palatte; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `cursive::theme::Theme { palette: palatte, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/views/highlight_view.rs:64:5 [INFO] [stdout] | [INFO] [stdout] 64 | let mut theme = Theme::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/views/row_view.rs:43:16 [INFO] [stdout] | [INFO] [stdout] 43 | on_action: Option)>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/views/row_view.rs:145:47 [INFO] [stdout] | [INFO] [stdout] 145 | let on_action = Rc::clone(&on_action); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `on_action` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/game/card.rs:113:18 [INFO] [stdout] | [INFO] [stdout] 113 | .map(|suit| { [INFO] [stdout] | __________________^ [INFO] [stdout] 114 | | vec![ [INFO] [stdout] 115 | | Ace, [INFO] [stdout] 116 | | Num(2), [INFO] [stdout] ... | [INFO] [stdout] 131 | | }) [INFO] [stdout] 132 | | .flatten() [INFO] [stdout] | |__________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 113 ~ .flat_map(|suit| { [INFO] [stdout] 114 + vec![ [INFO] [stdout] 115 + Ace, [INFO] [stdout] 116 + Num(2), [INFO] [stdout] 117 + Num(3), [INFO] [stdout] 118 + Num(4), [INFO] [stdout] 119 + Num(5), [INFO] [stdout] 120 + Num(6), [INFO] [stdout] 121 + Num(7), [INFO] [stdout] 122 + Num(8), [INFO] [stdout] 123 + Num(9), [INFO] [stdout] 124 + Num(10), [INFO] [stdout] 125 + Knight, [INFO] [stdout] 126 + Queen, [INFO] [stdout] 127 + King, [INFO] [stdout] 128 + ] [INFO] [stdout] 129 + .into_iter() [INFO] [stdout] 130 + .map(move |rank| Card::new(suit.clone(), rank)) [INFO] [stdout] 131 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/game.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | mod game; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/game/game.rs:91:9 [INFO] [stdout] | [INFO] [stdout] 91 | / (self.deck.len() > 3) [INFO] [stdout] 92 | | .then(|| ()) [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 92 - .then(|| ()) [INFO] [stdout] 92 + .then_some(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/game/game.rs:99:17 [INFO] [stdout] | [INFO] [stdout] 99 | / (suits.insert(suit)) [INFO] [stdout] 100 | | .then(|| ()) [INFO] [stdout] | |________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 100 - .then(|| ()) [INFO] [stdout] 100 + .then_some(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `table` [INFO] [stdout] --> src/game/game.rs:117:18 [INFO] [stdout] | [INFO] [stdout] 117 | for i in 0..4 { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 117 - for i in 0..4 { [INFO] [stdout] 117 + for in table.iter_mut().take(4) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/game/game.rs:148:9 [INFO] [stdout] | [INFO] [stdout] 148 | / table [INFO] [stdout] 149 | | .iter() [INFO] [stdout] 150 | | .map(|row| row.last().map(|other| other.greater(card))) [INFO] [stdout] 151 | | .any(|compare| compare == Some(Some(true))) [INFO] [stdout] 152 | | .then(|| ()) [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 152 - .then(|| ()) [INFO] [stdout] 152 + .then_some(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/game/game.rs:184:9 [INFO] [stdout] | [INFO] [stdout] 184 | / (table[from].len() > 1) [INFO] [stdout] 185 | | .then(|| ()) [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 185 - .then(|| ()) [INFO] [stdout] 185 + .then_some(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/game/game.rs:189:9 [INFO] [stdout] | [INFO] [stdout] 189 | / table[to] [INFO] [stdout] 190 | | .last() [INFO] [stdout] 191 | | .is_none() [INFO] [stdout] 192 | | .then(|| ()) [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 192 - .then(|| ()) [INFO] [stdout] 192 + .then_some(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/game/game.rs:226:9 [INFO] [stdout] | [INFO] [stdout] 226 | self.deck.is_empty().then(|| ())?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 226 - self.deck.is_empty().then(|| ())?; [INFO] [stdout] 226 + self.deck.is_empty().then_some(())?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/game/game.rs:229:9 [INFO] [stdout] | [INFO] [stdout] 229 | / (0..4) [INFO] [stdout] 230 | | .map(|i| self.check_eliminate(i)) [INFO] [stdout] 231 | | .all(|result| result.is_err()) [INFO] [stdout] 232 | | .then(|| ())?; [INFO] [stdout] | |________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 232 - .then(|| ())?; [INFO] [stdout] 232 + .then_some(())?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> src/game/game.rs:235:9 [INFO] [stdout] | [INFO] [stdout] 235 | / (!((self.table.iter().map(Vec::is_empty).any(|x| x)) [INFO] [stdout] 236 | | && (self.table.iter().map(Vec::len).any(|len| len > 1)))) [INFO] [stdout] 237 | | .then(|| ())?; [INFO] [stdout] | |____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 237 - .then(|| ())?; [INFO] [stdout] 237 + .then_some(())?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `.map(...).any(identity)` [INFO] [stdout] --> src/game/game.rs:235:31 [INFO] [stdout] | [INFO] [stdout] 235 | (!((self.table.iter().map(Vec::is_empty).any(|x| x)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_all_any_identity [INFO] [stdout] help: use `.any(...)` instead [INFO] [stdout] | [INFO] [stdout] 235 - (!((self.table.iter().map(Vec::is_empty).any(|x| x)) [INFO] [stdout] 235 + (!((self.table.iter().any(Vec::is_empty)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: passing a unit value to a function [INFO] [stdout] --> src/game/history.rs:45:13 [INFO] [stdout] | [INFO] [stdout] 45 | Ok(self.events.push(event)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg [INFO] [stdout] = note: `#[warn(clippy::unit_arg)]` on by default [INFO] [stdout] help: move the expression in front of the call and replace it with the unit literal `()` [INFO] [stdout] | [INFO] [stdout] 45 ~ self.events.push(event); [INFO] [stdout] 46 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/views/highlight_view.rs:65:5 [INFO] [stdout] | [INFO] [stdout] 65 | theme.palette = palatte; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `cursive::theme::Theme { palette: palatte, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/views/highlight_view.rs:64:5 [INFO] [stdout] | [INFO] [stdout] 64 | let mut theme = Theme::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/views/row_view.rs:43:16 [INFO] [stdout] | [INFO] [stdout] 43 | on_action: Option)>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/views/row_view.rs:145:47 [INFO] [stdout] | [INFO] [stdout] 145 | let on_action = Rc::clone(&on_action); [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `on_action` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 18.52s [INFO] running `Command { std: "docker" "inspect" "f88c37a4d2279f728e65b347990b0efb66bd18671eaf87a671205d1c3681b85e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "f88c37a4d2279f728e65b347990b0efb66bd18671eaf87a671205d1c3681b85e", kill_on_drop: false }` [INFO] [stdout] f88c37a4d2279f728e65b347990b0efb66bd18671eaf87a671205d1c3681b85e