[INFO] cloning repository https://github.com/crome110/rs-mahjong [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/crome110/rs-mahjong" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fcrome110%2Frs-mahjong", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fcrome110%2Frs-mahjong'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 360fcd80785a081752452a74b455e94490eee813 [INFO] linting crome110/rs-mahjong against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fcrome110%2Frs-mahjong" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/crome110/rs-mahjong [INFO] finished tweaking git repo https://github.com/crome110/rs-mahjong [INFO] tweaked toml for git repo https://github.com/crome110/rs-mahjong written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/crome110/rs-mahjong 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/crome110/rs-mahjong 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] Downloading crates ... [INFO] [stderr] Downloaded rustc-demangle v0.1.15 [INFO] [stderr] Downloaded backtrace v0.3.32 [INFO] [stderr] Downloaded backtrace-sys v0.1.29 [INFO] [stderr] Downloaded libc v0.2.58 [INFO] [stderr] Downloaded syn v0.15.38 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 089b9c560ccdfeae2b62bb3110dd302b5e5a1662bbedc20f3603a0d14938e046 [INFO] running `Command { std: "docker" "start" "-a" "089b9c560ccdfeae2b62bb3110dd302b5e5a1662bbedc20f3603a0d14938e046", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "089b9c560ccdfeae2b62bb3110dd302b5e5a1662bbedc20f3603a0d14938e046", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "089b9c560ccdfeae2b62bb3110dd302b5e5a1662bbedc20f3603a0d14938e046", kill_on_drop: false }` [INFO] [stdout] 089b9c560ccdfeae2b62bb3110dd302b5e5a1662bbedc20f3603a0d14938e046 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 657a96ab739cf70307e9d8d7e598ee292ba66be99f0b2cb6b9d9f386bcb4df7c [INFO] running `Command { std: "docker" "start" "-a" "657a96ab739cf70307e9d8d7e598ee292ba66be99f0b2cb6b9d9f386bcb4df7c", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v0.4.30 [INFO] [stderr] Compiling unicode-xid v0.1.0 [INFO] [stderr] Compiling libc v0.2.58 [INFO] [stderr] Compiling syn v0.15.38 [INFO] [stderr] Compiling cc v1.0.37 [INFO] [stderr] Compiling failure_derive v0.1.5 [INFO] [stderr] Checking rustc-demangle v0.1.15 [INFO] [stderr] Checking cfg-if v0.1.9 [INFO] [stderr] Compiling quote v0.6.12 [INFO] [stderr] Compiling backtrace-sys v0.1.29 [INFO] [stderr] Checking backtrace v0.3.32 [INFO] [stderr] Compiling synstructure v0.10.2 [INFO] [stderr] Checking failure v0.1.5 [INFO] [stderr] Checking mahjong v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/yaku.rs:83:23 [INFO] [stdout] | [INFO] [stdout] 83 | pub rule: Box Option>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(bare_trait_objects)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 83 | pub rule: Box Option>, [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/yaku.rs:87:28 [INFO] [stdout] | [INFO] [stdout] 87 | pub fu: Option Fu>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 87 | pub fu: Option Fu>>, [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/yaku.rs:105:23 [INFO] [stdout] | [INFO] [stdout] 105 | pub rule: Box) -> u32>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 105 | pub rule: Box) -> u32>, [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/yaku.rs:91:70 [INFO] [stdout] | [INFO] [stdout] 91 | ... pub fn new(name: &str, sub: Option>, rule: Box Option>, fu: Option Fu>>) -> S... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 91 | pub fn new(name: &str, sub: Option>, rule: Box Option>, fu: Option Fu>>) -> Self { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/yaku.rs:91:112 [INFO] [stdout] | [INFO] [stdout] 91 | ... pub fn new(name: &str, sub: Option>, rule: Box Option>, fu: Option Fu>>) -> S... [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 91 | pub fn new(name: &str, sub: Option>, rule: Box Option>, fu: Option Fu>>) -> Self { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/yaku.rs:111:42 [INFO] [stdout] | [INFO] [stdout] 111 | pub fn new(name: &str, rule: Box) -> u32>, sub: Option>) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 111 | pub fn new(name: &str, rule: Box) -> u32>, sub: Option>) -> Self { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/yaku.rs:83:23 [INFO] [stdout] | [INFO] [stdout] 83 | pub rule: Box Option>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: `#[warn(bare_trait_objects)]` (part of `#[warn(rust_2021_compatibility)]`) on by default [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 83 | pub rule: Box Option>, [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/yaku.rs:87:28 [INFO] [stdout] | [INFO] [stdout] 87 | pub fu: Option Fu>>, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 87 | pub fu: Option Fu>>, [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/yaku.rs:105:23 [INFO] [stdout] | [INFO] [stdout] 105 | pub rule: Box) -> u32>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 105 | pub rule: Box) -> u32>, [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/yaku.rs:91:70 [INFO] [stdout] | [INFO] [stdout] 91 | ... pub fn new(name: &str, sub: Option>, rule: Box Option>, fu: Option Fu>>) -> S... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 91 | pub fn new(name: &str, sub: Option>, rule: Box Option>, fu: Option Fu>>) -> Self { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/yaku.rs:91:112 [INFO] [stdout] | [INFO] [stdout] 91 | ... pub fn new(name: &str, sub: Option>, rule: Box Option>, fu: Option Fu>>) -> S... [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 91 | pub fn new(name: &str, sub: Option>, rule: Box Option>, fu: Option Fu>>) -> Self { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait objects without an explicit `dyn` are deprecated [INFO] [stdout] --> src/yaku.rs:111:42 [INFO] [stdout] | [INFO] [stdout] 111 | pub fn new(name: &str, rule: Box) -> u32>, sub: Option>) -> Self { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! [INFO] [stdout] = note: for more information, see [INFO] [stdout] help: if this is a dyn-compatible trait, use `dyn` [INFO] [stdout] | [INFO] [stdout] 111 | pub fn new(name: &str, rule: Box) -> u32>, sub: Option>) -> Self { [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `pong` is never used [INFO] [stdout] --> src/parse.rs:158:8 [INFO] [stdout] | [INFO] [stdout] 157 | impl Node { [INFO] [stdout] | --------- method in this implementation [INFO] [stdout] 158 | fn pong(&self) -> &Box> { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `DisplayVec` is never constructed [INFO] [stdout] --> src/groups.rs:239:12 [INFO] [stdout] | [INFO] [stdout] 239 | pub struct DisplayVec(pub Vec); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `situation`, `dora`, and `ura_dora` are never read [INFO] [stdout] --> src/evaluate.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 12 | pub struct Evaluator { [INFO] [stdout] | --------- fields in this struct [INFO] [stdout] 13 | /// 確定している状況役(リーチ、ツモなど) [INFO] [stdout] 14 | situation: Vec, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 24 | dora: Vec, [INFO] [stdout] | ^^^^ [INFO] [stdout] 25 | /// 裏ドラ [INFO] [stdout] 26 | ura_dora: Vec, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `evaluate` and `evaluate_str` are never used [INFO] [stdout] --> src/evaluate.rs:532:12 [INFO] [stdout] | [INFO] [stdout] 531 | impl Evaluator { [INFO] [stdout] | -------------- methods in this implementation [INFO] [stdout] 532 | pub fn evaluate(&self, parsed_hand: &ParsedHand, draw: bool, situation: &Vec) -> Option { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 618 | pub fn evaluate_str(&self, string: &str, draw: bool, situation: &Vec) -> Result, failure::Erro... [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/tiles.rs:201:9 [INFO] [stdout] | [INFO] [stdout] 201 | / match self { [INFO] [stdout] 202 | | Tile::Honour(_) => false, [INFO] [stdout] 203 | | _ => true, [INFO] [stdout] 204 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 201 - match self { [INFO] [stdout] 202 - Tile::Honour(_) => false, [INFO] [stdout] 203 - _ => true, [INFO] [stdout] 204 - } [INFO] [stdout] 201 + !matches!(self, Tile::Honour(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/tiles.rs:215:13 [INFO] [stdout] | [INFO] [stdout] 215 | let num; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `num` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 215 ~ [INFO] [stdout] 216 ~ let num = match self { [INFO] [stdout] 217 ~ Tile::Character(u) => { u } [INFO] [stdout] 218 ~ Tile::Circle(u) => { u } [INFO] [stdout] 219 ~ Tile::Bamboo(u) => { u } [INFO] [stdout] 220 | _ => unreachable!() [INFO] [stdout] 221 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parse.rs:32:12 [INFO] [stdout] | [INFO] [stdout] 32 | if nodes.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `nodes.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `writeln!` [INFO] [stdout] --> src/parse.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 67 | writeln!(f, "")?; [INFO] [stdout] | ^^^^^^^^^^----^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#writeln_empty_string [INFO] [stdout] = note: `#[warn(clippy::writeln_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `writeln!` [INFO] [stdout] --> src/parse.rs:70:13 [INFO] [stdout] | [INFO] [stdout] 70 | writeln!(f, "") [INFO] [stdout] | ^^^^^^^^^^----^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#writeln_empty_string [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/parse.rs:115:13 [INFO] [stdout] | [INFO] [stdout] 115 | / match leaf { [INFO] [stdout] 116 | | Ok(leaf_ok) => { [INFO] [stdout] 117 | | root.nodes.push(leaf_ok); [INFO] [stdout] ... | [INFO] [stdout] 120 | | } [INFO] [stdout] | |_____________^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 115 ~ if let Ok(leaf_ok) = leaf { [INFO] [stdout] 116 + root.nodes.push(leaf_ok); [INFO] [stdout] 117 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `heads.get(0)` [INFO] [stdout] --> src/parse.rs:125:33 [INFO] [stdout] | [INFO] [stdout] 125 | let (head, tiles) = heads.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `heads.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/parse.rs:158:23 [INFO] [stdout] | [INFO] [stdout] 158 | fn pong(&self) -> &Box> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `&Option` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] = note: `#[warn(clippy::borrowed_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parse.rs:218:9 [INFO] [stdout] | [INFO] [stdout] 218 | return Ok(Node { remaining, open_sets, sets, pong: Box::new(pong), chow: Box::new(chow) }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 218 - return Ok(Node { remaining, open_sets, sets, pong: Box::new(pong), chow: Box::new(chow) }); [INFO] [stdout] 218 + Ok(Node { remaining, open_sets, sets, pong: Box::new(pong), chow: Box::new(chow) }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parse.rs:164:12 [INFO] [stdout] | [INFO] [stdout] 164 | if remaining.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `remaining.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [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/parse.rs:188:9 [INFO] [stdout] | [INFO] [stdout] 188 | / match first.next() { [INFO] [stdout] 189 | | Some(second) => match second.next() { [INFO] [stdout] 190 | | Some(third) => { [INFO] [stdout] 191 | | if remaining.contains(&second) & &remaining.contains(&third) { [INFO] [stdout] ... | [INFO] [stdout] 211 | | _ => {} [INFO] [stdout] 212 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 188 ~ if let Some(second) = first.next() { match second.next() { [INFO] [stdout] 189 + Some(third) => { [INFO] [stdout] 190 + if remaining.contains(&second) & &remaining.contains(&third) { [INFO] [stdout] 191 + [INFO] [stdout] 192 ~ // 刻子に使う牌を削除 [INFO] [stdout] 193 + let mut tiles = remaining.clone(); [INFO] [stdout] 194 + let head0 = tiles.iter().position(|t| t == &first).unwrap(); [INFO] [stdout] 195 + let head0 = tiles.remove(head0); [INFO] [stdout] 196 + let head1 = tiles.iter().position(|t| t == &second).unwrap(); [INFO] [stdout] 197 + let head1 = tiles.remove(head1); [INFO] [stdout] 198 + let head2 = tiles.iter().position(|t| t == &third).unwrap(); [INFO] [stdout] 199 + let head2 = tiles.remove(head2); [INFO] [stdout] 200 + [INFO] [stdout] 201 + let set = Set::new(vec![head0, head1, head2])?; [INFO] [stdout] 202 + let mut sets = sets.clone(); [INFO] [stdout] 203 + sets.push(set); [INFO] [stdout] 204 + [INFO] [stdout] 205 + chow = Node::new(tiles, open_sets.clone(), sets).ok(); [INFO] [stdout] 206 + } [INFO] [stdout] 207 + } [INFO] [stdout] 208 + _ => {} [INFO] [stdout] 209 + } } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/parse.rs:191:21 [INFO] [stdout] | [INFO] [stdout] 191 | / if remaining.contains(&second) & &remaining.contains(&third) { [INFO] [stdout] 192 | | [INFO] [stdout] 193 | | // 刻子に使う牌を削除 [INFO] [stdout] 194 | | let mut tiles = remaining.clone(); [INFO] [stdout] ... | [INFO] [stdout] 206 | | chow = Node::new(tiles, open_sets.clone(), sets).ok(); [INFO] [stdout] 207 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 190 ~ Some(third) [INFO] [stdout] 191 ~ if remaining.contains(&second) & &remaining.contains(&third) => { [INFO] [stdout] 192 | [INFO] [stdout] ... [INFO] [stdout] 206 | chow = Node::new(tiles, open_sets.clone(), sets).ok(); [INFO] [stdout] 207 ~ } [INFO] [stdout] | [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/parse.rs:189:29 [INFO] [stdout] | [INFO] [stdout] 189 | Some(second) => match second.next() { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 190 | | Some(third) => { [INFO] [stdout] 191 | | if remaining.contains(&second) & &remaining.contains(&third) { [INFO] [stdout] ... | [INFO] [stdout] 209 | | _ => {} [INFO] [stdout] 210 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 189 ~ Some(second) => if let Some(third) = second.next() { [INFO] [stdout] 190 + if remaining.contains(&second) & &remaining.contains(&third) { [INFO] [stdout] 191 + [INFO] [stdout] 192 ~ // 刻子に使う牌を削除 [INFO] [stdout] 193 + let mut tiles = remaining.clone(); [INFO] [stdout] 194 + let head0 = tiles.iter().position(|t| t == &first).unwrap(); [INFO] [stdout] 195 + let head0 = tiles.remove(head0); [INFO] [stdout] 196 + let head1 = tiles.iter().position(|t| t == &second).unwrap(); [INFO] [stdout] 197 + let head1 = tiles.remove(head1); [INFO] [stdout] 198 + let head2 = tiles.iter().position(|t| t == &third).unwrap(); [INFO] [stdout] 199 + let head2 = tiles.remove(head2); [INFO] [stdout] 200 + [INFO] [stdout] 201 + let set = Set::new(vec![head0, head1, head2])?; [INFO] [stdout] 202 + let mut sets = sets.clone(); [INFO] [stdout] 203 + sets.push(set); [INFO] [stdout] 204 + [INFO] [stdout] 205 + chow = Node::new(tiles, open_sets.clone(), sets).ok(); [INFO] [stdout] 206 + } [INFO] [stdout] 207 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/parse.rs:191:24 [INFO] [stdout] | [INFO] [stdout] 191 | if remaining.contains(&second) & &remaining.contains(&third) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------------------------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `remaining.contains(&third)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/parse.rs:221:12 [INFO] [stdout] | [INFO] [stdout] 221 | if self.pong.is_none() & &self.chow.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^-------------------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `self.chow.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary operation [INFO] [stdout] --> src/parse.rs:225:9 [INFO] [stdout] | [INFO] [stdout] 225 | &self.pong.clone().map(|ref node| vec.append(&mut node.search_leafs())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `self.pong.clone().map(|ref node| vec.append(&mut node.search_leafs()));` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation [INFO] [stdout] = note: `#[warn(clippy::unnecessary_operation)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary operation [INFO] [stdout] --> src/parse.rs:226:9 [INFO] [stdout] | [INFO] [stdout] 226 | &self.chow.clone().map(|ref node| vec.append(&mut node.search_leafs())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `self.chow.clone().map(|ref node| vec.append(&mut node.search_leafs()));` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/groups.rs:71:9 [INFO] [stdout] | [INFO] [stdout] 71 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 71 - return true; [INFO] [stdout] 71 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/groups.rs:102:21 [INFO] [stdout] | [INFO] [stdout] 102 | / match tile { [INFO] [stdout] 103 | | Tile::Character(u) => u, [INFO] [stdout] 104 | | Tile::Circle(u) => u, [INFO] [stdout] 105 | | Tile::Bamboo(u) => u, [INFO] [stdout] 106 | | _ => unreachable!() [INFO] [stdout] 107 | | }.clone() [INFO] [stdout] | |_____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 102 ~ *match tile { [INFO] [stdout] 103 + Tile::Character(u) => u, [INFO] [stdout] 104 + Tile::Circle(u) => u, [INFO] [stdout] 105 + Tile::Bamboo(u) => u, [INFO] [stdout] 106 + _ => unreachable!() [INFO] [stdout] 107 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.get(0)` [INFO] [stdout] --> src/groups.rs:110:15 [INFO] [stdout] | [INFO] [stdout] 110 | match self.get(0) { [INFO] [stdout] | ^^^^^^^^^^^ help: try: `self.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/groups.rs:161:45 [INFO] [stdout] | [INFO] [stdout] 161 | ... while let Some(c) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for c in iter.by_ref()` [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: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/groups.rs:165:93 [INFO] [stdout] | [INFO] [stdout] 165 | ... nums.iter().map(|u| Tile::Character(u.clone())).collect() [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/groups.rs:168:90 [INFO] [stdout] | [INFO] [stdout] 168 | ... nums.iter().map(|u| Tile::Circle(u.clone())).collect() [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/groups.rs:171:90 [INFO] [stdout] | [INFO] [stdout] 171 | ... nums.iter().map(|u| Tile::Bamboo(u.clone())).collect() [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `writeln!` [INFO] [stdout] --> src/groups.rs:247:13 [INFO] [stdout] | [INFO] [stdout] 247 | writeln!(f, "")?; [INFO] [stdout] | ^^^^^^^^^^----^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#writeln_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/groups.rs:285:20 [INFO] [stdout] | [INFO] [stdout] 285 | if store_tmp.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!store_tmp.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/groups.rs:291:17 [INFO] [stdout] | [INFO] [stdout] 291 | while let Some(c) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for c in iter.by_ref()` [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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/groups.rs:302:20 [INFO] [stdout] | [INFO] [stdout] 302 | if store_tmp.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!store_tmp.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/groups.rs:308:17 [INFO] [stdout] | [INFO] [stdout] 308 | while let Some(c) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for c in iter.by_ref()` [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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/groups.rs:322:12 [INFO] [stdout] | [INFO] [stdout] 322 | if store_tmp.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!store_tmp.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/groups.rs:366:34 [INFO] [stdout] | [INFO] [stdout] 366 | fn consists_of(&self, tiles: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 366 - fn consists_of(&self, tiles: &Vec) -> bool { [INFO] [stdout] 366 + fn consists_of(&self, tiles: &[Tile]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/groups.rs:393:60 [INFO] [stdout] | [INFO] [stdout] 393 | let TilesNewType(mut vec) = TilesNewType::from_str(&s)?; [INFO] [stdout] | ^^ help: change this to: `s` [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: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/groups.rs:410:17 [INFO] [stdout] | [INFO] [stdout] 410 | / if vec.is_flat() { [INFO] [stdout] 411 | | // 明槓 (暗槓はHand.parse()時に判断する) [INFO] [stdout] 412 | | Ok(OpenSet::Kong(vec)) [INFO] [stdout] 413 | | } else { [INFO] [stdout] 414 | | Err(format_err!("入力が不正です: [{}]", s)) [INFO] [stdout] 415 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 409 ~ 4 [INFO] [stdout] 410 ~ if vec.is_flat() => { [INFO] [stdout] 411 | // 明槓 (暗槓はHand.parse()時に判断する) [INFO] [stdout] 412 | Ok(OpenSet::Kong(vec)) [INFO] [stdout] 413 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/groups.rs:480:31 [INFO] [stdout] | [INFO] [stdout] 480 | vec.iter().all(|tile| match tile { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 481 | | Tile::Character(_) => true, [INFO] [stdout] 482 | | _ => false, [INFO] [stdout] 483 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 480 - vec.iter().all(|tile| match tile { [INFO] [stdout] 481 - Tile::Character(_) => true, [INFO] [stdout] 482 - _ => false, [INFO] [stdout] 483 - }) [INFO] [stdout] 480 + vec.iter().all(|tile| matches!(tile, Tile::Character(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/groups.rs:493:31 [INFO] [stdout] | [INFO] [stdout] 493 | vec.iter().all(|tile| match tile { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 494 | | Tile::Circle(_) => true, [INFO] [stdout] 495 | | _ => false, [INFO] [stdout] 496 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 493 - vec.iter().all(|tile| match tile { [INFO] [stdout] 494 - Tile::Circle(_) => true, [INFO] [stdout] 495 - _ => false, [INFO] [stdout] 496 - }) [INFO] [stdout] 493 + vec.iter().all(|tile| matches!(tile, Tile::Circle(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/groups.rs:506:31 [INFO] [stdout] | [INFO] [stdout] 506 | vec.iter().all(|tile| match tile { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 507 | | Tile::Bamboo(_) => true, [INFO] [stdout] 508 | | _ => false, [INFO] [stdout] 509 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 506 - vec.iter().all(|tile| match tile { [INFO] [stdout] 507 - Tile::Bamboo(_) => true, [INFO] [stdout] 508 - _ => false, [INFO] [stdout] 509 - }) [INFO] [stdout] 506 + vec.iter().all(|tile| matches!(tile, Tile::Bamboo(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/groups.rs:519:31 [INFO] [stdout] | [INFO] [stdout] 519 | vec.iter().all(|tile| match tile { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 520 | | Tile::Honour(_) => true, [INFO] [stdout] 521 | | _ => false, [INFO] [stdout] 522 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 519 - vec.iter().all(|tile| match tile { [INFO] [stdout] 520 - Tile::Honour(_) => true, [INFO] [stdout] 521 - _ => false, [INFO] [stdout] 522 - }) [INFO] [stdout] 519 + vec.iter().all(|tile| matches!(tile, Tile::Honour(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/groups.rs:663:31 [INFO] [stdout] | [INFO] [stdout] 663 | vec.iter().all(|tile| match tile { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 664 | | Tile::Character(_) => true, [INFO] [stdout] 665 | | _ => false, [INFO] [stdout] 666 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 663 - vec.iter().all(|tile| match tile { [INFO] [stdout] 664 - Tile::Character(_) => true, [INFO] [stdout] 665 - _ => false, [INFO] [stdout] 666 - }) [INFO] [stdout] 663 + vec.iter().all(|tile| matches!(tile, Tile::Character(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/groups.rs:675:31 [INFO] [stdout] | [INFO] [stdout] 675 | vec.iter().all(|tile| match tile { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 676 | | Tile::Circle(_) => true, [INFO] [stdout] 677 | | _ => false, [INFO] [stdout] 678 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 675 - vec.iter().all(|tile| match tile { [INFO] [stdout] 676 - Tile::Circle(_) => true, [INFO] [stdout] 677 - _ => false, [INFO] [stdout] 678 - }) [INFO] [stdout] 675 + vec.iter().all(|tile| matches!(tile, Tile::Circle(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/groups.rs:687:31 [INFO] [stdout] | [INFO] [stdout] 687 | vec.iter().all(|tile| match tile { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 688 | | Tile::Bamboo(_) => true, [INFO] [stdout] 689 | | _ => false, [INFO] [stdout] 690 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 687 - vec.iter().all(|tile| match tile { [INFO] [stdout] 688 - Tile::Bamboo(_) => true, [INFO] [stdout] 689 - _ => false, [INFO] [stdout] 690 - }) [INFO] [stdout] 687 + vec.iter().all(|tile| matches!(tile, Tile::Bamboo(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/groups.rs:699:31 [INFO] [stdout] | [INFO] [stdout] 699 | vec.iter().all(|tile| match tile { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 700 | | Tile::Honour(_) => true, [INFO] [stdout] 701 | | _ => false, [INFO] [stdout] 702 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 699 - vec.iter().all(|tile| match tile { [INFO] [stdout] 700 - Tile::Honour(_) => true, [INFO] [stdout] 701 - _ => false, [INFO] [stdout] 702 - }) [INFO] [stdout] 699 + vec.iter().all(|tile| matches!(tile, Tile::Honour(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Han` which implements the `Copy` trait [INFO] [stdout] --> src/yaku.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | self.han_value.clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.han_value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/yaku.rs:83:19 [INFO] [stdout] | [INFO] [stdout] 83 | pub rule: Box 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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/yaku.rs:87:17 [INFO] [stdout] | [INFO] [stdout] 87 | pub fu: Option Fu>>, [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] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/yaku.rs:91:66 [INFO] [stdout] | [INFO] [stdout] 91 | ... pub fn new(name: &str, sub: Option>, rule: Box Option>, fu: Option Fu>>) -> S... [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] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/yaku.rs:91:101 [INFO] [stdout] | [INFO] [stdout] 91 | ... pub fn new(name: &str, sub: Option>, rule: Box Option>, fu: Option Fu>>) -> S... [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] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/yaku.rs:105:19 [INFO] [stdout] | [INFO] [stdout] 105 | pub rule: Box) -> u32>, [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] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/yaku.rs:111:38 [INFO] [stdout] | [INFO] [stdout] 111 | pub fn new(name: &str, rule: Box) -> u32>, sub: Option>) -> Self { [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] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evaluate.rs:44:50 [INFO] [stdout] | [INFO] [stdout] 44 | / ... if node.sets.iter().all(|set| match set { [INFO] [stdout] 45 | | ... Set::Pung(_) => false, [INFO] [stdout] 46 | | ... _ => true, [INFO] [stdout] 47 | | ... }) { [INFO] [stdout] ... | [INFO] [stdout] 51 | | ... } [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] 47 ~ }) [INFO] [stdout] 48 ~ && (fu == &Fu(30) || fu == &Fu(22)) { [INFO] [stdout] 49 | return Some(Han(1)); [INFO] [stdout] 50 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/evaluate.rs:44:80 [INFO] [stdout] | [INFO] [stdout] 44 | ... if node.sets.iter().all(|set| match set { [INFO] [stdout] | _____________________________________________________^ [INFO] [stdout] 45 | | ... Set::Pung(_) => false, [INFO] [stdout] 46 | | ... _ => true, [INFO] [stdout] 47 | | ... }) { [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 44 - if node.sets.iter().all(|set| match set { [INFO] [stdout] 45 - Set::Pung(_) => false, [INFO] [stdout] 46 - _ => true, [INFO] [stdout] 47 - }) { [INFO] [stdout] 44 + if node.sets.iter().all(|set| !matches!(set, Set::Pung(_))) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `bool` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:58:45 [INFO] [stdout] | [INFO] [stdout] 58 | ... if draw.clone() { Fu(20) } else { Fu(30) } [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*draw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/evaluate.rs:68:35 [INFO] [stdout] | [INFO] [stdout] 68 | / ... match set { [INFO] [stdout] 69 | | ... Set::Chow(_) => chows.push(set.clone()), [INFO] [stdout] 70 | | ... _ => {} [INFO] [stdout] 71 | | ... }); [INFO] [stdout] | |_______________________^ help: try: `if let Set::Chow(_) = set { chows.push(set.clone()) }` [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/evaluate.rs:84:35 [INFO] [stdout] | [INFO] [stdout] 84 | / ... match set { [INFO] [stdout] 85 | | ... Set::Chow(_) => { [INFO] [stdout] 86 | | ... chows.push(set.clone()) [INFO] [stdout] ... | [INFO] [stdout] 89 | | ... }); [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 84 ~ if let Set::Chow(_) = set { [INFO] [stdout] 85 + chows.push(set.clone()) [INFO] [stdout] 86 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/evaluate.rs:105:57 [INFO] [stdout] | [INFO] [stdout] 105 | ... sets.iter().all(|set| match set { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 106 | | ... Set::Pair(_) => true, [INFO] [stdout] 107 | | ... _ => false [INFO] [stdout] 108 | | ... }) { Some(Han(2)) } else { None } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 105 - sets.iter().all(|set| match set { [INFO] [stdout] 106 - Set::Pair(_) => true, [INFO] [stdout] 107 - _ => false [INFO] [stdout] 108 - }) { Some(Han(2)) } else { None } [INFO] [stdout] 105 + sets.iter().all(|set| matches!(set, Set::Pair(_))) { Some(Han(2)) } else { None } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:141:45 [INFO] [stdout] | [INFO] [stdout] 141 | ... let sum = match chow { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 142 | | ... Tile::Character(u) => { [INFO] [stdout] 143 | | ... u [INFO] [stdout] ... | [INFO] [stdout] 151 | | ... _ => unreachable!() [INFO] [stdout] 152 | | ... }.clone(); [INFO] [stdout] | |_______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 141 ~ let sum = *match chow { [INFO] [stdout] 142 + Tile::Character(u) => { [INFO] [stdout] 143 + u [INFO] [stdout] 144 + } [INFO] [stdout] 145 + Tile::Circle(u) => { [INFO] [stdout] 146 + u [INFO] [stdout] 147 + } [INFO] [stdout] 148 + Tile::Bamboo(u) => { [INFO] [stdout] 149 + u [INFO] [stdout] 150 + } [INFO] [stdout] 151 + _ => unreachable!() [INFO] [stdout] 152 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:155:42 [INFO] [stdout] | [INFO] [stdout] 155 | ... if match chow_sum { [INFO] [stdout] | __________________________^ [INFO] [stdout] 156 | | ... Tile::Character(u) => { [INFO] [stdout] 157 | | ... u [INFO] [stdout] ... | [INFO] [stdout] 165 | | ... _ => unreachable!() [INFO] [stdout] 166 | | ... }.clone() == sum { [INFO] [stdout] | |_______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 155 ~ if *match chow_sum { [INFO] [stdout] 156 + Tile::Character(u) => { [INFO] [stdout] 157 + u [INFO] [stdout] 158 + } [INFO] [stdout] 159 + Tile::Circle(u) => { [INFO] [stdout] 160 + u [INFO] [stdout] 161 + } [INFO] [stdout] 162 + Tile::Bamboo(u) => { [INFO] [stdout] 163 + u [INFO] [stdout] 164 + } [INFO] [stdout] 165 + _ => unreachable!() [INFO] [stdout] 166 ~ } == sum { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/evaluate.rs:204:34 [INFO] [stdout] | [INFO] [stdout] 204 | ... if false || [INFO] [stdout] | __________________________^ [INFO] [stdout] 205 | | ... chow_sums.contains(&Tile::Character(6)) [INFO] [stdout] 206 | | ... && chow_sums.contains(&Tile::Character(15)) [INFO] [stdout] 207 | | ... && chow_sums.contains(&Tile::Character(24)) || [INFO] [stdout] 208 | | ... chow_sums.contains(&Tile::Circle(6)) [INFO] [stdout] 209 | | ... && chow_sums.contains(&Tile::Circle(15)) [INFO] [stdout] 210 | | ... && chow_sums.contains(&Tile::Circle(24)) || [INFO] [stdout] | |______________________________________________________________________^ help: try: `chow_sums.contains(&Tile::Character(6)) && chow_sums.contains(&Tile::Character(15)) && chow_sums.contains(&Tile::Character(24)) || chow_sums.contains(&Tile::Circle(6)) && chow_sums.contains(&Tile::Circle(15)) && chow_sums.contains(&Tile::Circle(24))` [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/evaluate.rs:204:34 [INFO] [stdout] | [INFO] [stdout] 204 | ... if false || [INFO] [stdout] | __________________________^ [INFO] [stdout] 205 | | ... chow_sums.contains(&Tile::Character(6)) [INFO] [stdout] 206 | | ... && chow_sums.contains(&Tile::Character(15)) [INFO] [stdout] 207 | | ... && chow_sums.contains(&Tile::Character(24)) || [INFO] [stdout] | |_________________________________________________________________________^ help: try: `chow_sums.contains(&Tile::Character(6)) && chow_sums.contains(&Tile::Character(15)) && chow_sums.contains(&Tile::Character(24))` [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: match expression looks like `matches!` macro [INFO] [stdout] --> src/evaluate.rs:233:82 [INFO] [stdout] | [INFO] [stdout] 233 | ... candidate.node().open_sets.iter().filter(|set| match set { [INFO] [stdout] | ______________________________________________________________________^ [INFO] [stdout] 234 | | ... OpenSet::ConcealedKong(_) => true, [INFO] [stdout] 235 | | ... _ => false, [INFO] [stdout] 236 | | ... }).count() == 3 + 1 { [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 233 - candidate.node().open_sets.iter().filter(|set| match set { [INFO] [stdout] 234 - OpenSet::ConcealedKong(_) => true, [INFO] [stdout] 235 - _ => false, [INFO] [stdout] 236 - }).count() == 3 + 1 { [INFO] [stdout] 233 + candidate.node().open_sets.iter().filter(|set| matches!(set, OpenSet::ConcealedKong(_))).count() == 3 + 1 { [INFO] [stdout] | [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/evaluate.rs:245:35 [INFO] [stdout] | [INFO] [stdout] 245 | / ... match set { [INFO] [stdout] 246 | | ... Set::Pung(_) => { [INFO] [stdout] 247 | | ... if let Some(tile) = set.sum_tile() { [INFO] [stdout] 248 | | ... pong_sums.push(tile); [INFO] [stdout] ... | [INFO] [stdout] 251 | | ... _ => {} [INFO] [stdout] 252 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 245 ~ if let Set::Pung(_) = set { [INFO] [stdout] 246 + if let Some(tile) = set.sum_tile() { [INFO] [stdout] 247 + pong_sums.push(tile); [INFO] [stdout] 248 + } [INFO] [stdout] 249 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:270:72 [INFO] [stdout] | [INFO] [stdout] 270 | ... pong_sums.contains(&Tile::Circle(u.clone())) [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:271:79 [INFO] [stdout] | [INFO] [stdout] 271 | ... && pong_sums.contains(&Tile::Bamboo(u.clone())), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:273:75 [INFO] [stdout] | [INFO] [stdout] 273 | ... pong_sums.contains(&Tile::Character(u.clone())) [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:274:79 [INFO] [stdout] | [INFO] [stdout] 274 | ... && pong_sums.contains(&Tile::Bamboo(u.clone())), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:276:75 [INFO] [stdout] | [INFO] [stdout] 276 | ... pong_sums.contains(&Tile::Character(u.clone())) [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:277:79 [INFO] [stdout] | [INFO] [stdout] 277 | ... && pong_sums.contains(&Tile::Circle(u.clone())), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/evaluate.rs:333:57 [INFO] [stdout] | [INFO] [stdout] 333 | ... if candidate.closed() { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 334 | | ... Some(Han(2)) [INFO] [stdout] 335 | | ... } else { Some(Han(2)) } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/evaluate.rs:335:42 [INFO] [stdout] | [INFO] [stdout] 335 | ... } else { Some(Han(2)) } [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: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/evaluate.rs:409:53 [INFO] [stdout] | [INFO] [stdout] 409 | ...l_tiles: Vec = _original_tiles.iter().filter(|tile| tile != &&winning).map(|t| t.clone()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `_original_tiles.iter().filter(|tile| tile != &&winning).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: match expression looks like `matches!` macro [INFO] [stdout] --> src/evaluate.rs:442:39 [INFO] [stdout] | [INFO] [stdout] 442 | .filter(|set| match set { [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 443 | | OpenSet::ConcealedKong(_) => true, [INFO] [stdout] 444 | | _ => false, [INFO] [stdout] 445 | | }).count() == 4 + 1 [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 442 - .filter(|set| match set { [INFO] [stdout] 443 - OpenSet::ConcealedKong(_) => true, [INFO] [stdout] 444 - _ => false, [INFO] [stdout] 445 - }).count() == 4 + 1 [INFO] [stdout] 442 + .filter(|set| matches!(set, OpenSet::ConcealedKong(_))).count() == 4 + 1 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `pong` is never used [INFO] [stdout] --> src/parse.rs:158:8 [INFO] [stdout] | [INFO] [stdout] 157 | impl Node { [INFO] [stdout] | --------- method in this implementation [INFO] [stdout] 158 | fn pong(&self) -> &Box> { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `DisplayVec` is never constructed [INFO] [stdout] --> src/groups.rs:239:12 [INFO] [stdout] | [INFO] [stdout] 239 | pub struct DisplayVec(pub Vec); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `situation`, `dora`, and `ura_dora` are never read [INFO] [stdout] --> src/evaluate.rs:14:5 [INFO] [stdout] | [INFO] [stdout] 12 | pub struct Evaluator { [INFO] [stdout] | --------- fields in this struct [INFO] [stdout] 13 | /// 確定している状況役(リーチ、ツモなど) [INFO] [stdout] 14 | situation: Vec, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 24 | dora: Vec, [INFO] [stdout] | ^^^^ [INFO] [stdout] 25 | /// 裏ドラ [INFO] [stdout] 26 | ura_dora: Vec, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `evaluate` and `evaluate_str` are never used [INFO] [stdout] --> src/evaluate.rs:532:12 [INFO] [stdout] | [INFO] [stdout] 531 | impl Evaluator { [INFO] [stdout] | -------------- methods in this implementation [INFO] [stdout] 532 | pub fn evaluate(&self, parsed_hand: &ParsedHand, draw: bool, situation: &Vec) -> Option { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 618 | pub fn evaluate_str(&self, string: &str, draw: bool, situation: &Vec) -> Result, failure::Erro... [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/tiles.rs:201:9 [INFO] [stdout] | [INFO] [stdout] 201 | / match self { [INFO] [stdout] 202 | | Tile::Honour(_) => false, [INFO] [stdout] 203 | | _ => true, [INFO] [stdout] 204 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 201 - match self { [INFO] [stdout] 202 - Tile::Honour(_) => false, [INFO] [stdout] 203 - _ => true, [INFO] [stdout] 204 - } [INFO] [stdout] 201 + !matches!(self, Tile::Honour(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/tiles.rs:215:13 [INFO] [stdout] | [INFO] [stdout] 215 | let num; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `num` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 215 ~ [INFO] [stdout] 216 ~ let num = match self { [INFO] [stdout] 217 ~ Tile::Character(u) => { u } [INFO] [stdout] 218 ~ Tile::Circle(u) => { u } [INFO] [stdout] 219 ~ Tile::Bamboo(u) => { u } [INFO] [stdout] 220 | _ => unreachable!() [INFO] [stdout] 221 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parse.rs:32:12 [INFO] [stdout] | [INFO] [stdout] 32 | if nodes.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `nodes.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `writeln!` [INFO] [stdout] --> src/parse.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 67 | writeln!(f, "")?; [INFO] [stdout] | ^^^^^^^^^^----^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#writeln_empty_string [INFO] [stdout] = note: `#[warn(clippy::writeln_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `writeln!` [INFO] [stdout] --> src/parse.rs:70:13 [INFO] [stdout] | [INFO] [stdout] 70 | writeln!(f, "") [INFO] [stdout] | ^^^^^^^^^^----^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#writeln_empty_string [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/parse.rs:115:13 [INFO] [stdout] | [INFO] [stdout] 115 | / match leaf { [INFO] [stdout] 116 | | Ok(leaf_ok) => { [INFO] [stdout] 117 | | root.nodes.push(leaf_ok); [INFO] [stdout] ... | [INFO] [stdout] 120 | | } [INFO] [stdout] | |_____________^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 115 ~ if let Ok(leaf_ok) = leaf { [INFO] [stdout] 116 + root.nodes.push(leaf_ok); [INFO] [stdout] 117 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `heads.get(0)` [INFO] [stdout] --> src/parse.rs:125:33 [INFO] [stdout] | [INFO] [stdout] 125 | let (head, tiles) = heads.get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `heads.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/parse.rs:158:23 [INFO] [stdout] | [INFO] [stdout] 158 | fn pong(&self) -> &Box> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `&Option` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] = note: `#[warn(clippy::borrowed_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/parse.rs:218:9 [INFO] [stdout] | [INFO] [stdout] 218 | return Ok(Node { remaining, open_sets, sets, pong: Box::new(pong), chow: Box::new(chow) }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 218 - return Ok(Node { remaining, open_sets, sets, pong: Box::new(pong), chow: Box::new(chow) }); [INFO] [stdout] 218 + Ok(Node { remaining, open_sets, sets, pong: Box::new(pong), chow: Box::new(chow) }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/parse.rs:164:12 [INFO] [stdout] | [INFO] [stdout] 164 | if remaining.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `remaining.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [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/parse.rs:188:9 [INFO] [stdout] | [INFO] [stdout] 188 | / match first.next() { [INFO] [stdout] 189 | | Some(second) => match second.next() { [INFO] [stdout] 190 | | Some(third) => { [INFO] [stdout] 191 | | if remaining.contains(&second) & &remaining.contains(&third) { [INFO] [stdout] ... | [INFO] [stdout] 211 | | _ => {} [INFO] [stdout] 212 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 188 ~ if let Some(second) = first.next() { match second.next() { [INFO] [stdout] 189 + Some(third) => { [INFO] [stdout] 190 + if remaining.contains(&second) & &remaining.contains(&third) { [INFO] [stdout] 191 + [INFO] [stdout] 192 ~ // 刻子に使う牌を削除 [INFO] [stdout] 193 + let mut tiles = remaining.clone(); [INFO] [stdout] 194 + let head0 = tiles.iter().position(|t| t == &first).unwrap(); [INFO] [stdout] 195 + let head0 = tiles.remove(head0); [INFO] [stdout] 196 + let head1 = tiles.iter().position(|t| t == &second).unwrap(); [INFO] [stdout] 197 + let head1 = tiles.remove(head1); [INFO] [stdout] 198 + let head2 = tiles.iter().position(|t| t == &third).unwrap(); [INFO] [stdout] 199 + let head2 = tiles.remove(head2); [INFO] [stdout] 200 + [INFO] [stdout] 201 + let set = Set::new(vec![head0, head1, head2])?; [INFO] [stdout] 202 + let mut sets = sets.clone(); [INFO] [stdout] 203 + sets.push(set); [INFO] [stdout] 204 + [INFO] [stdout] 205 + chow = Node::new(tiles, open_sets.clone(), sets).ok(); [INFO] [stdout] 206 + } [INFO] [stdout] 207 + } [INFO] [stdout] 208 + _ => {} [INFO] [stdout] 209 + } } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/parse.rs:191:21 [INFO] [stdout] | [INFO] [stdout] 191 | / if remaining.contains(&second) & &remaining.contains(&third) { [INFO] [stdout] 192 | | [INFO] [stdout] 193 | | // 刻子に使う牌を削除 [INFO] [stdout] 194 | | let mut tiles = remaining.clone(); [INFO] [stdout] ... | [INFO] [stdout] 206 | | chow = Node::new(tiles, open_sets.clone(), sets).ok(); [INFO] [stdout] 207 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 190 ~ Some(third) [INFO] [stdout] 191 ~ if remaining.contains(&second) & &remaining.contains(&third) => { [INFO] [stdout] 192 | [INFO] [stdout] ... [INFO] [stdout] 206 | chow = Node::new(tiles, open_sets.clone(), sets).ok(); [INFO] [stdout] 207 ~ } [INFO] [stdout] | [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/parse.rs:189:29 [INFO] [stdout] | [INFO] [stdout] 189 | Some(second) => match second.next() { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 190 | | Some(third) => { [INFO] [stdout] 191 | | if remaining.contains(&second) & &remaining.contains(&third) { [INFO] [stdout] ... | [INFO] [stdout] 209 | | _ => {} [INFO] [stdout] 210 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 189 ~ Some(second) => if let Some(third) = second.next() { [INFO] [stdout] 190 + if remaining.contains(&second) & &remaining.contains(&third) { [INFO] [stdout] 191 + [INFO] [stdout] 192 ~ // 刻子に使う牌を削除 [INFO] [stdout] 193 + let mut tiles = remaining.clone(); [INFO] [stdout] 194 + let head0 = tiles.iter().position(|t| t == &first).unwrap(); [INFO] [stdout] 195 + let head0 = tiles.remove(head0); [INFO] [stdout] 196 + let head1 = tiles.iter().position(|t| t == &second).unwrap(); [INFO] [stdout] 197 + let head1 = tiles.remove(head1); [INFO] [stdout] 198 + let head2 = tiles.iter().position(|t| t == &third).unwrap(); [INFO] [stdout] 199 + let head2 = tiles.remove(head2); [INFO] [stdout] 200 + [INFO] [stdout] 201 + let set = Set::new(vec![head0, head1, head2])?; [INFO] [stdout] 202 + let mut sets = sets.clone(); [INFO] [stdout] 203 + sets.push(set); [INFO] [stdout] 204 + [INFO] [stdout] 205 + chow = Node::new(tiles, open_sets.clone(), sets).ok(); [INFO] [stdout] 206 + } [INFO] [stdout] 207 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/parse.rs:191:24 [INFO] [stdout] | [INFO] [stdout] 191 | if remaining.contains(&second) & &remaining.contains(&third) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^--------------------------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `remaining.contains(&third)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/parse.rs:221:12 [INFO] [stdout] | [INFO] [stdout] 221 | if self.pong.is_none() & &self.chow.is_none() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^-------------------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `self.chow.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary operation [INFO] [stdout] --> src/parse.rs:225:9 [INFO] [stdout] | [INFO] [stdout] 225 | &self.pong.clone().map(|ref node| vec.append(&mut node.search_leafs())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `self.pong.clone().map(|ref node| vec.append(&mut node.search_leafs()));` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation [INFO] [stdout] = note: `#[warn(clippy::unnecessary_operation)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary operation [INFO] [stdout] --> src/parse.rs:226:9 [INFO] [stdout] | [INFO] [stdout] 226 | &self.chow.clone().map(|ref node| vec.append(&mut node.search_leafs())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `self.chow.clone().map(|ref node| vec.append(&mut node.search_leafs()));` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_operation [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evaluate.rs:540:9 [INFO] [stdout] | [INFO] [stdout] 540 | scores.sort_by(|a, b| a.score.score(false).cmp(&b.score.score(false))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 540 - scores.sort_by(|a, b| a.score.score(false).cmp(&b.score.score(false))); [INFO] [stdout] 540 + scores.sort_by_key(|a| a.score.score(false)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/evaluate.rs:544:35 [INFO] [stdout] | [INFO] [stdout] 544 | fn evaluate_yaku(&self, yaku: &Box, yaku_list: &mut Vec, candidate: &Wait, han: &mut Han) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `&HandYaku` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/evaluate.rs:556:41 [INFO] [stdout] | [INFO] [stdout] 556 | fn evaluate_yakuman(&self, yakuman: &Box, yakuman_list: &mut Vec, candidate: &Wait, original_hand: &Vec)... [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `&Yakuman` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/groups.rs:71:9 [INFO] [stdout] | [INFO] [stdout] 71 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 71 - return true; [INFO] [stdout] 71 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/evaluate.rs:558:33 [INFO] [stdout] | [INFO] [stdout] 558 | if 0 != rule(candidate, &original_hand) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `original_hand` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/evaluate.rs:560:29 [INFO] [stdout] | [INFO] [stdout] 560 | rule(candidate, &original_hand) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `original_hand` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/evaluate.rs:573:32 [INFO] [stdout] | [INFO] [stdout] 573 | if 0 != rule(wait, &original_hand) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `original_hand` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/evaluate.rs:575:40 [INFO] [stdout] | [INFO] [stdout] 575 | multiple += rule(wait, &original_hand); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `original_hand` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/groups.rs:102:21 [INFO] [stdout] | [INFO] [stdout] 102 | / match tile { [INFO] [stdout] 103 | | Tile::Character(u) => u, [INFO] [stdout] 104 | | Tile::Circle(u) => u, [INFO] [stdout] 105 | | Tile::Bamboo(u) => u, [INFO] [stdout] 106 | | _ => unreachable!() [INFO] [stdout] 107 | | }.clone() [INFO] [stdout] | |_____________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 102 ~ *match tile { [INFO] [stdout] 103 + Tile::Character(u) => u, [INFO] [stdout] 104 + Tile::Circle(u) => u, [INFO] [stdout] 105 + Tile::Bamboo(u) => u, [INFO] [stdout] 106 + _ => unreachable!() [INFO] [stdout] 107 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.get(0)` [INFO] [stdout] --> src/groups.rs:110:15 [INFO] [stdout] | [INFO] [stdout] 110 | match self.get(0) { [INFO] [stdout] | ^^^^^^^^^^^ help: try: `self.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/groups.rs:161:45 [INFO] [stdout] | [INFO] [stdout] 161 | ... while let Some(c) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for c in iter.by_ref()` [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: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/groups.rs:165:93 [INFO] [stdout] | [INFO] [stdout] 165 | ... nums.iter().map(|u| Tile::Character(u.clone())).collect() [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/groups.rs:168:90 [INFO] [stdout] | [INFO] [stdout] 168 | ... nums.iter().map(|u| Tile::Circle(u.clone())).collect() [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/groups.rs:171:90 [INFO] [stdout] | [INFO] [stdout] 171 | ... nums.iter().map(|u| Tile::Bamboo(u.clone())).collect() [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/evaluate.rs:663:42 [INFO] [stdout] | [INFO] [stdout] 663 | waits.append(&mut Wait::from(&node, parsed_hand.winning.clone(), [INFO] [stdout] | ^^^^^ help: change this to: `node` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/evaluate.rs:691:49 [INFO] [stdout] | [INFO] [stdout] 691 | let mut fu = if draw { Fu(22) } else if node.open_sets.len() == 0 { Fu(30) } else { Fu(20) }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `node.open_sets.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `head.get(0)` [INFO] [stdout] --> src/evaluate.rs:697:35 [INFO] [stdout] | [INFO] [stdout] 697 | let (head1, head2) = (head.get(0), head.get(1)); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `head.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty string literal in `writeln!` [INFO] [stdout] --> src/groups.rs:247:13 [INFO] [stdout] | [INFO] [stdout] 247 | writeln!(f, "")?; [INFO] [stdout] | ^^^^^^^^^^----^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#writeln_empty_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/groups.rs:285:20 [INFO] [stdout] | [INFO] [stdout] 285 | if store_tmp.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!store_tmp.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/groups.rs:291:17 [INFO] [stdout] | [INFO] [stdout] 291 | while let Some(c) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for c in iter.by_ref()` [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] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/groups.rs:302:20 [INFO] [stdout] | [INFO] [stdout] 302 | if store_tmp.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!store_tmp.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/evaluate.rs:765:38 [INFO] [stdout] | [INFO] [stdout] 765 | }.open_sets.iter().all(|set| match set { [INFO] [stdout] | ______________________________________^ [INFO] [stdout] 766 | | OpenSet::ConcealedKong(_) => true, [INFO] [stdout] 767 | | _ => false, [INFO] [stdout] 768 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 765 - }.open_sets.iter().all(|set| match set { [INFO] [stdout] 766 - OpenSet::ConcealedKong(_) => true, [INFO] [stdout] 767 - _ => false, [INFO] [stdout] 768 - }) [INFO] [stdout] 765 + }.open_sets.iter().all(|set| matches!(set, OpenSet::ConcealedKong(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/groups.rs:308:17 [INFO] [stdout] | [INFO] [stdout] 308 | while let Some(c) = iter.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for c in iter.by_ref()` [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] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Fu` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:794:9 [INFO] [stdout] | [INFO] [stdout] 794 | / match &self { [INFO] [stdout] 795 | | Wait::Ryanmen(_, fu, _) => fu, [INFO] [stdout] 796 | | Wait::Kanchan(_, fu, _) => fu, [INFO] [stdout] 797 | | Wait::Penchan(_, fu, _) => fu, [INFO] [stdout] 798 | | Wait::Tanki(_, fu, _) => fu, [INFO] [stdout] 799 | | Wait::Shanpon(_, fu, _) => fu, [INFO] [stdout] 800 | | }.clone() [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 794 ~ *match &self { [INFO] [stdout] 795 + Wait::Ryanmen(_, fu, _) => fu, [INFO] [stdout] 796 + Wait::Kanchan(_, fu, _) => fu, [INFO] [stdout] 797 + Wait::Penchan(_, fu, _) => fu, [INFO] [stdout] 798 + Wait::Tanki(_, fu, _) => fu, [INFO] [stdout] 799 + Wait::Shanpon(_, fu, _) => fu, [INFO] [stdout] 800 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/groups.rs:322:12 [INFO] [stdout] | [INFO] [stdout] 322 | if store_tmp.len() != 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!store_tmp.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/groups.rs:366:34 [INFO] [stdout] | [INFO] [stdout] 366 | fn consists_of(&self, tiles: &Vec) -> bool { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 366 - fn consists_of(&self, tiles: &Vec) -> bool { [INFO] [stdout] 366 + fn consists_of(&self, tiles: &[Tile]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/score.rs:36:25 [INFO] [stdout] | [INFO] [stdout] 36 | if han_value >= 13 as u32 { [INFO] [stdout] | ^^^^^^^^^ help: try: `13_u32` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/groups.rs:393:60 [INFO] [stdout] | [INFO] [stdout] 393 | let TilesNewType(mut vec) = TilesNewType::from_str(&s)?; [INFO] [stdout] | ^^ help: change this to: `s` [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: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/groups.rs:410:17 [INFO] [stdout] | [INFO] [stdout] 410 | / if vec.is_flat() { [INFO] [stdout] 411 | | // 明槓 (暗槓はHand.parse()時に判断する) [INFO] [stdout] 412 | | Ok(OpenSet::Kong(vec)) [INFO] [stdout] 413 | | } else { [INFO] [stdout] 414 | | Err(format_err!("入力が不正です: [{}]", s)) [INFO] [stdout] 415 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 409 ~ 4 [INFO] [stdout] 410 ~ if vec.is_flat() => { [INFO] [stdout] 411 | // 明槓 (暗槓はHand.parse()時に判断する) [INFO] [stdout] 412 | Ok(OpenSet::Kong(vec)) [INFO] [stdout] 413 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u8` is unnecessary [INFO] [stdout] --> src/score.rs:69:32 [INFO] [stdout] | [INFO] [stdout] 69 | if multiple > &(3 as u8) { [INFO] [stdout] | ^^^^^^^^^ help: try: `3_u8` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u8` is unnecessary [INFO] [stdout] --> src/score.rs:92:32 [INFO] [stdout] | [INFO] [stdout] 92 | if multiple > &(3 as u8) { [INFO] [stdout] | ^^^^^^^^^ help: try: `3_u8` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> src/score.rs:138:17 [INFO] [stdout] | [INFO] [stdout] 133 | / let score = [INFO] [stdout] 134 | | if is_dealer { [INFO] [stdout] 135 | | 48000 [INFO] [stdout] 136 | | } else { 36000 } [INFO] [stdout] 137 | | * multiple.clone() as u32; [INFO] [stdout] | |__________________________________________________- unnecessary `let` binding [INFO] [stdout] 138 | score [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 133 ~ [INFO] [stdout] 134 ~ (if is_dealer { [INFO] [stdout] 135 + 48000 [INFO] [stdout] 136 + } else { 36000 } [INFO] [stdout] 137 + * multiple.clone() as u32) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/score.rs:137:27 [INFO] [stdout] | [INFO] [stdout] 137 | * multiple.clone() as u32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try dereferencing it: `*multiple` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/score.rs:148:17 [INFO] [stdout] | [INFO] [stdout] 145 | / let score = [INFO] [stdout] 146 | | if is_dealer { 6 as u32 } else { 4 as u32 } [INFO] [stdout] 147 | | * fu * u32::pow(2, han.clone() + 2); [INFO] [stdout] | |____________________________________________________________- unnecessary `let` binding [INFO] [stdout] 148 | score [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 145 ~ [INFO] [stdout] 146 ~ (if is_dealer { 6 as u32 } else { 4 as u32 } [INFO] [stdout] 147 + * fu * u32::pow(2, han.clone() + 2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/score.rs:142:26 [INFO] [stdout] | [INFO] [stdout] 142 | let fu = ((fu + (10 - 1)) / 10) * 10; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `fu.div_ceil(10)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/score.rs:146:36 [INFO] [stdout] | [INFO] [stdout] 146 | if is_dealer { 6 as u32 } else { 4 as u32 } [INFO] [stdout] | ^^^^^^^^ help: try: `6_u32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/score.rs:146:54 [INFO] [stdout] | [INFO] [stdout] 146 | if is_dealer { 6 as u32 } else { 4 as u32 } [INFO] [stdout] | ^^^^^^^^ help: try: `4_u32` [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: using `clone` on type `u32` which implements the `Copy` trait [INFO] [stdout] --> src/score.rs:147:44 [INFO] [stdout] | [INFO] [stdout] 147 | * fu * u32::pow(2, han.clone() + 2); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*han` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/groups.rs:480:31 [INFO] [stdout] | [INFO] [stdout] 480 | vec.iter().all(|tile| match tile { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 481 | | Tile::Character(_) => true, [INFO] [stdout] 482 | | _ => false, [INFO] [stdout] 483 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 480 - vec.iter().all(|tile| match tile { [INFO] [stdout] 481 - Tile::Character(_) => true, [INFO] [stdout] 482 - _ => false, [INFO] [stdout] 483 - }) [INFO] [stdout] 480 + vec.iter().all(|tile| matches!(tile, Tile::Character(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/score.rs:170:37 [INFO] [stdout] | [INFO] [stdout] 170 | let score_display = ((score + (100 - 1)) / 100) * 100; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `score.div_ceil(100)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/groups.rs:493:31 [INFO] [stdout] | [INFO] [stdout] 493 | vec.iter().all(|tile| match tile { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 494 | | Tile::Circle(_) => true, [INFO] [stdout] 495 | | _ => false, [INFO] [stdout] 496 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 493 - vec.iter().all(|tile| match tile { [INFO] [stdout] 494 - Tile::Circle(_) => true, [INFO] [stdout] 495 - _ => false, [INFO] [stdout] 496 - }) [INFO] [stdout] 493 + vec.iter().all(|tile| matches!(tile, Tile::Circle(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/score.rs:171:41 [INFO] [stdout] | [INFO] [stdout] 171 | let score_draw_dealer = ((score / 2 + (100 - 1)) / 100) * 100; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(score / 2).div_ceil(100)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/score.rs:172:34 [INFO] [stdout] | [INFO] [stdout] 172 | let score_draw = ((score / 4 + (100 - 1)) / 100) * 100; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(score / 4).div_ceil(100)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/groups.rs:506:31 [INFO] [stdout] | [INFO] [stdout] 506 | vec.iter().all(|tile| match tile { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 507 | | Tile::Bamboo(_) => true, [INFO] [stdout] 508 | | _ => false, [INFO] [stdout] 509 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 506 - vec.iter().all(|tile| match tile { [INFO] [stdout] 507 - Tile::Bamboo(_) => true, [INFO] [stdout] 508 - _ => false, [INFO] [stdout] 509 - }) [INFO] [stdout] 506 + vec.iter().all(|tile| matches!(tile, Tile::Bamboo(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/groups.rs:519:31 [INFO] [stdout] | [INFO] [stdout] 519 | vec.iter().all(|tile| match tile { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 520 | | Tile::Honour(_) => true, [INFO] [stdout] 521 | | _ => false, [INFO] [stdout] 522 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 519 - vec.iter().all(|tile| match tile { [INFO] [stdout] 520 - Tile::Honour(_) => true, [INFO] [stdout] 521 - _ => false, [INFO] [stdout] 522 - }) [INFO] [stdout] 519 + vec.iter().all(|tile| matches!(tile, Tile::Honour(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/score.rs:174:44 [INFO] [stdout] | [INFO] [stdout] 174 | let score_dealer_display = ((score_dealer + (100 - 1)) / 100) * 100; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `score_dealer.div_ceil(100)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/score.rs:175:41 [INFO] [stdout] | [INFO] [stdout] 175 | let score_dealer_draw = ((score_dealer / 3 + (100 - 1)) / 100) * 100; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(score_dealer / 3).div_ceil(100)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/groups.rs:663:31 [INFO] [stdout] | [INFO] [stdout] 663 | vec.iter().all(|tile| match tile { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 664 | | Tile::Character(_) => true, [INFO] [stdout] 665 | | _ => false, [INFO] [stdout] 666 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 663 - vec.iter().all(|tile| match tile { [INFO] [stdout] 664 - Tile::Character(_) => true, [INFO] [stdout] 665 - _ => false, [INFO] [stdout] 666 - }) [INFO] [stdout] 663 + vec.iter().all(|tile| matches!(tile, Tile::Character(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/groups.rs:675:31 [INFO] [stdout] | [INFO] [stdout] 675 | vec.iter().all(|tile| match tile { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 676 | | Tile::Circle(_) => true, [INFO] [stdout] 677 | | _ => false, [INFO] [stdout] 678 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 675 - vec.iter().all(|tile| match tile { [INFO] [stdout] 676 - Tile::Circle(_) => true, [INFO] [stdout] 677 - _ => false, [INFO] [stdout] 678 - }) [INFO] [stdout] 675 + vec.iter().all(|tile| matches!(tile, Tile::Circle(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/groups.rs:687:31 [INFO] [stdout] | [INFO] [stdout] 687 | vec.iter().all(|tile| match tile { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 688 | | Tile::Bamboo(_) => true, [INFO] [stdout] 689 | | _ => false, [INFO] [stdout] 690 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 687 - vec.iter().all(|tile| match tile { [INFO] [stdout] 688 - Tile::Bamboo(_) => true, [INFO] [stdout] 689 - _ => false, [INFO] [stdout] 690 - }) [INFO] [stdout] 687 + vec.iter().all(|tile| matches!(tile, Tile::Bamboo(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/groups.rs:699:31 [INFO] [stdout] | [INFO] [stdout] 699 | vec.iter().all(|tile| match tile { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 700 | | Tile::Honour(_) => true, [INFO] [stdout] 701 | | _ => false, [INFO] [stdout] 702 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 699 - vec.iter().all(|tile| match tile { [INFO] [stdout] 700 - Tile::Honour(_) => true, [INFO] [stdout] 701 - _ => false, [INFO] [stdout] 702 - }) [INFO] [stdout] 699 + vec.iter().all(|tile| matches!(tile, Tile::Honour(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/evaluate.rs:431:31 [INFO] [stdout] | [INFO] [stdout] 431 | let dragons = vec![Dragon::White.tile(), Dragon::Green.tile(), Dragon::Red.tile()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[Dragon::White.tile(), Dragon::Green.tile(), Dragon::Red.tile()]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/evaluate.rs:450:31 [INFO] [stdout] | [INFO] [stdout] 450 | let dragons = vec![Wind::East.tile(), Wind::South.tile(), Wind::West.tile(), Wind::North.tile()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[Wind::East.tile(), Wind::South.tile(), Wind::West.tile(), Wind::North.tile()]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/evaluate.rs:458:31 [INFO] [stdout] | [INFO] [stdout] 458 | let dragons = vec![Wind::East.tile(), Wind::South.tile(), Wind::West.tile(), Wind::North.tile()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[Wind::East.tile(), Wind::South.tile(), Wind::West.tile(), Wind::North.tile()]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused borrow that must be used [INFO] [stdout] --> src/parse.rs:225:9 [INFO] [stdout] | [INFO] [stdout] 225 | &self.pong.clone().map(|ref node| vec.append(&mut node.search_leafs())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the borrow produces a value [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 225 | let _ = &self.pong.clone().map(|ref node| vec.append(&mut node.search_leafs())); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused borrow that must be used [INFO] [stdout] --> src/parse.rs:226:9 [INFO] [stdout] | [INFO] [stdout] 226 | &self.chow.clone().map(|ref node| vec.append(&mut node.search_leafs())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the borrow produces a value [INFO] [stdout] | [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 226 | let _ = &self.chow.clone().map(|ref node| vec.append(&mut node.search_leafs())); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Han` which implements the `Copy` trait [INFO] [stdout] --> src/yaku.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | self.han_value.clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.han_value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/yaku.rs:83:19 [INFO] [stdout] | [INFO] [stdout] 83 | pub rule: Box 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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/yaku.rs:87:17 [INFO] [stdout] | [INFO] [stdout] 87 | pub fu: Option Fu>>, [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] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/yaku.rs:91:66 [INFO] [stdout] | [INFO] [stdout] 91 | ... pub fn new(name: &str, sub: Option>, rule: Box Option>, fu: Option Fu>>) -> S... [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] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/yaku.rs:91:101 [INFO] [stdout] | [INFO] [stdout] 91 | ... pub fn new(name: &str, sub: Option>, rule: Box Option>, fu: Option Fu>>) -> S... [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] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/yaku.rs:105:19 [INFO] [stdout] | [INFO] [stdout] 105 | pub rule: Box) -> u32>, [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] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/yaku.rs:111:38 [INFO] [stdout] | [INFO] [stdout] 111 | pub fn new(name: &str, rule: Box) -> u32>, sub: Option>) -> Self { [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] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/evaluate.rs:44:50 [INFO] [stdout] | [INFO] [stdout] 44 | / ... if node.sets.iter().all(|set| match set { [INFO] [stdout] 45 | | ... Set::Pung(_) => false, [INFO] [stdout] 46 | | ... _ => true, [INFO] [stdout] 47 | | ... }) { [INFO] [stdout] ... | [INFO] [stdout] 51 | | ... } [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] 47 ~ }) [INFO] [stdout] 48 ~ && (fu == &Fu(30) || fu == &Fu(22)) { [INFO] [stdout] 49 | return Some(Han(1)); [INFO] [stdout] 50 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/evaluate.rs:44:80 [INFO] [stdout] | [INFO] [stdout] 44 | ... if node.sets.iter().all(|set| match set { [INFO] [stdout] | _____________________________________________________^ [INFO] [stdout] 45 | | ... Set::Pung(_) => false, [INFO] [stdout] 46 | | ... _ => true, [INFO] [stdout] 47 | | ... }) { [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 44 - if node.sets.iter().all(|set| match set { [INFO] [stdout] 45 - Set::Pung(_) => false, [INFO] [stdout] 46 - _ => true, [INFO] [stdout] 47 - }) { [INFO] [stdout] 44 + if node.sets.iter().all(|set| !matches!(set, Set::Pung(_))) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `bool` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:58:45 [INFO] [stdout] | [INFO] [stdout] 58 | ... if draw.clone() { Fu(20) } else { Fu(30) } [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*draw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/evaluate.rs:68:35 [INFO] [stdout] | [INFO] [stdout] 68 | / ... match set { [INFO] [stdout] 69 | | ... Set::Chow(_) => chows.push(set.clone()), [INFO] [stdout] 70 | | ... _ => {} [INFO] [stdout] 71 | | ... }); [INFO] [stdout] | |_______________________^ help: try: `if let Set::Chow(_) = set { chows.push(set.clone()) }` [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/evaluate.rs:84:35 [INFO] [stdout] | [INFO] [stdout] 84 | / ... match set { [INFO] [stdout] 85 | | ... Set::Chow(_) => { [INFO] [stdout] 86 | | ... chows.push(set.clone()) [INFO] [stdout] ... | [INFO] [stdout] 89 | | ... }); [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 84 ~ if let Set::Chow(_) = set { [INFO] [stdout] 85 + chows.push(set.clone()) [INFO] [stdout] 86 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/evaluate.rs:105:57 [INFO] [stdout] | [INFO] [stdout] 105 | ... sets.iter().all(|set| match set { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 106 | | ... Set::Pair(_) => true, [INFO] [stdout] 107 | | ... _ => false [INFO] [stdout] 108 | | ... }) { Some(Han(2)) } else { None } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 105 - sets.iter().all(|set| match set { [INFO] [stdout] 106 - Set::Pair(_) => true, [INFO] [stdout] 107 - _ => false [INFO] [stdout] 108 - }) { Some(Han(2)) } else { None } [INFO] [stdout] 105 + sets.iter().all(|set| matches!(set, Set::Pair(_))) { Some(Han(2)) } else { None } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:141:45 [INFO] [stdout] | [INFO] [stdout] 141 | ... let sum = match chow { [INFO] [stdout] | _________________________________^ [INFO] [stdout] 142 | | ... Tile::Character(u) => { [INFO] [stdout] 143 | | ... u [INFO] [stdout] ... | [INFO] [stdout] 151 | | ... _ => unreachable!() [INFO] [stdout] 152 | | ... }.clone(); [INFO] [stdout] | |_______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 141 ~ let sum = *match chow { [INFO] [stdout] 142 + Tile::Character(u) => { [INFO] [stdout] 143 + u [INFO] [stdout] 144 + } [INFO] [stdout] 145 + Tile::Circle(u) => { [INFO] [stdout] 146 + u [INFO] [stdout] 147 + } [INFO] [stdout] 148 + Tile::Bamboo(u) => { [INFO] [stdout] 149 + u [INFO] [stdout] 150 + } [INFO] [stdout] 151 + _ => unreachable!() [INFO] [stdout] 152 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:155:42 [INFO] [stdout] | [INFO] [stdout] 155 | ... if match chow_sum { [INFO] [stdout] | __________________________^ [INFO] [stdout] 156 | | ... Tile::Character(u) => { [INFO] [stdout] 157 | | ... u [INFO] [stdout] ... | [INFO] [stdout] 165 | | ... _ => unreachable!() [INFO] [stdout] 166 | | ... }.clone() == sum { [INFO] [stdout] | |_______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 155 ~ if *match chow_sum { [INFO] [stdout] 156 + Tile::Character(u) => { [INFO] [stdout] 157 + u [INFO] [stdout] 158 + } [INFO] [stdout] 159 + Tile::Circle(u) => { [INFO] [stdout] 160 + u [INFO] [stdout] 161 + } [INFO] [stdout] 162 + Tile::Bamboo(u) => { [INFO] [stdout] 163 + u [INFO] [stdout] 164 + } [INFO] [stdout] 165 + _ => unreachable!() [INFO] [stdout] 166 ~ } == sum { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/evaluate.rs:204:34 [INFO] [stdout] | [INFO] [stdout] 204 | ... if false || [INFO] [stdout] | __________________________^ [INFO] [stdout] 205 | | ... chow_sums.contains(&Tile::Character(6)) [INFO] [stdout] 206 | | ... && chow_sums.contains(&Tile::Character(15)) [INFO] [stdout] 207 | | ... && chow_sums.contains(&Tile::Character(24)) || [INFO] [stdout] 208 | | ... chow_sums.contains(&Tile::Circle(6)) [INFO] [stdout] 209 | | ... && chow_sums.contains(&Tile::Circle(15)) [INFO] [stdout] 210 | | ... && chow_sums.contains(&Tile::Circle(24)) || [INFO] [stdout] | |______________________________________________________________________^ help: try: `chow_sums.contains(&Tile::Character(6)) && chow_sums.contains(&Tile::Character(15)) && chow_sums.contains(&Tile::Character(24)) || chow_sums.contains(&Tile::Circle(6)) && chow_sums.contains(&Tile::Circle(15)) && chow_sums.contains(&Tile::Circle(24))` [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/evaluate.rs:204:34 [INFO] [stdout] | [INFO] [stdout] 204 | ... if false || [INFO] [stdout] | __________________________^ [INFO] [stdout] 205 | | ... chow_sums.contains(&Tile::Character(6)) [INFO] [stdout] 206 | | ... && chow_sums.contains(&Tile::Character(15)) [INFO] [stdout] 207 | | ... && chow_sums.contains(&Tile::Character(24)) || [INFO] [stdout] | |_________________________________________________________________________^ help: try: `chow_sums.contains(&Tile::Character(6)) && chow_sums.contains(&Tile::Character(15)) && chow_sums.contains(&Tile::Character(24))` [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: match expression looks like `matches!` macro [INFO] [stdout] --> src/evaluate.rs:233:82 [INFO] [stdout] | [INFO] [stdout] 233 | ... candidate.node().open_sets.iter().filter(|set| match set { [INFO] [stdout] | ______________________________________________________________________^ [INFO] [stdout] 234 | | ... OpenSet::ConcealedKong(_) => true, [INFO] [stdout] 235 | | ... _ => false, [INFO] [stdout] 236 | | ... }).count() == 3 + 1 { [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 233 - candidate.node().open_sets.iter().filter(|set| match set { [INFO] [stdout] 234 - OpenSet::ConcealedKong(_) => true, [INFO] [stdout] 235 - _ => false, [INFO] [stdout] 236 - }).count() == 3 + 1 { [INFO] [stdout] 233 + candidate.node().open_sets.iter().filter(|set| matches!(set, OpenSet::ConcealedKong(_))).count() == 3 + 1 { [INFO] [stdout] | [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/evaluate.rs:245:35 [INFO] [stdout] | [INFO] [stdout] 245 | / ... match set { [INFO] [stdout] 246 | | ... Set::Pung(_) => { [INFO] [stdout] 247 | | ... if let Some(tile) = set.sum_tile() { [INFO] [stdout] 248 | | ... pong_sums.push(tile); [INFO] [stdout] ... | [INFO] [stdout] 251 | | ... _ => {} [INFO] [stdout] 252 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 245 ~ if let Set::Pung(_) = set { [INFO] [stdout] 246 + if let Some(tile) = set.sum_tile() { [INFO] [stdout] 247 + pong_sums.push(tile); [INFO] [stdout] 248 + } [INFO] [stdout] 249 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:270:72 [INFO] [stdout] | [INFO] [stdout] 270 | ... pong_sums.contains(&Tile::Circle(u.clone())) [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:271:79 [INFO] [stdout] | [INFO] [stdout] 271 | ... && pong_sums.contains(&Tile::Bamboo(u.clone())), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:273:75 [INFO] [stdout] | [INFO] [stdout] 273 | ... pong_sums.contains(&Tile::Character(u.clone())) [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:274:79 [INFO] [stdout] | [INFO] [stdout] 274 | ... && pong_sums.contains(&Tile::Bamboo(u.clone())), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:276:75 [INFO] [stdout] | [INFO] [stdout] 276 | ... pong_sums.contains(&Tile::Character(u.clone())) [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:277:79 [INFO] [stdout] | [INFO] [stdout] 277 | ... && pong_sums.contains(&Tile::Circle(u.clone())), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*u` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/evaluate.rs:333:57 [INFO] [stdout] | [INFO] [stdout] 333 | ... if candidate.closed() { [INFO] [stdout] | _____________________________________________^ [INFO] [stdout] 334 | | ... Some(Han(2)) [INFO] [stdout] 335 | | ... } else { Some(Han(2)) } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/evaluate.rs:335:42 [INFO] [stdout] | [INFO] [stdout] 335 | ... } else { Some(Han(2)) } [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: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/evaluate.rs:409:53 [INFO] [stdout] | [INFO] [stdout] 409 | ...l_tiles: Vec = _original_tiles.iter().filter(|tile| tile != &&winning).map(|t| t.clone()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `_original_tiles.iter().filter(|tile| tile != &&winning).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: match expression looks like `matches!` macro [INFO] [stdout] --> src/evaluate.rs:442:39 [INFO] [stdout] | [INFO] [stdout] 442 | .filter(|set| match set { [INFO] [stdout] | _______________________________________^ [INFO] [stdout] 443 | | OpenSet::ConcealedKong(_) => true, [INFO] [stdout] 444 | | _ => false, [INFO] [stdout] 445 | | }).count() == 4 + 1 [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 442 - .filter(|set| match set { [INFO] [stdout] 443 - OpenSet::ConcealedKong(_) => true, [INFO] [stdout] 444 - _ => false, [INFO] [stdout] 445 - }).count() == 4 + 1 [INFO] [stdout] 442 + .filter(|set| matches!(set, OpenSet::ConcealedKong(_))).count() == 4 + 1 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/evaluate.rs:540:9 [INFO] [stdout] | [INFO] [stdout] 540 | scores.sort_by(|a, b| a.score.score(false).cmp(&b.score.score(false))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 540 - scores.sort_by(|a, b| a.score.score(false).cmp(&b.score.score(false))); [INFO] [stdout] 540 + scores.sort_by_key(|a| a.score.score(false)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/evaluate.rs:544:35 [INFO] [stdout] | [INFO] [stdout] 544 | fn evaluate_yaku(&self, yaku: &Box, yaku_list: &mut Vec, candidate: &Wait, han: &mut Han) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `&HandYaku` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/evaluate.rs:556:41 [INFO] [stdout] | [INFO] [stdout] 556 | fn evaluate_yakuman(&self, yakuman: &Box, yakuman_list: &mut Vec, candidate: &Wait, original_hand: &Vec)... [INFO] [stdout] | ^^^^^^^^^^^^^ help: try: `&Yakuman` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/evaluate.rs:558:33 [INFO] [stdout] | [INFO] [stdout] 558 | if 0 != rule(candidate, &original_hand) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `original_hand` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/evaluate.rs:560:29 [INFO] [stdout] | [INFO] [stdout] 560 | rule(candidate, &original_hand) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `original_hand` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/evaluate.rs:573:32 [INFO] [stdout] | [INFO] [stdout] 573 | if 0 != rule(wait, &original_hand) { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `original_hand` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/evaluate.rs:575:40 [INFO] [stdout] | [INFO] [stdout] 575 | multiple += rule(wait, &original_hand); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `original_hand` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/evaluate.rs:663:42 [INFO] [stdout] | [INFO] [stdout] 663 | waits.append(&mut Wait::from(&node, parsed_hand.winning.clone(), [INFO] [stdout] | ^^^^^ help: change this to: `node` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/evaluate.rs:691:49 [INFO] [stdout] | [INFO] [stdout] 691 | let mut fu = if draw { Fu(22) } else if node.open_sets.len() == 0 { Fu(30) } else { Fu(20) }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `node.open_sets.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `head.get(0)` [INFO] [stdout] --> src/evaluate.rs:697:35 [INFO] [stdout] | [INFO] [stdout] 697 | let (head1, head2) = (head.get(0), head.get(1)); [INFO] [stdout] | ^^^^^^^^^^^ help: try: `head.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/evaluate.rs:765:38 [INFO] [stdout] | [INFO] [stdout] 765 | }.open_sets.iter().all(|set| match set { [INFO] [stdout] | ______________________________________^ [INFO] [stdout] 766 | | OpenSet::ConcealedKong(_) => true, [INFO] [stdout] 767 | | _ => false, [INFO] [stdout] 768 | | }) [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 765 - }.open_sets.iter().all(|set| match set { [INFO] [stdout] 766 - OpenSet::ConcealedKong(_) => true, [INFO] [stdout] 767 - _ => false, [INFO] [stdout] 768 - }) [INFO] [stdout] 765 + }.open_sets.iter().all(|set| matches!(set, OpenSet::ConcealedKong(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Fu` which implements the `Copy` trait [INFO] [stdout] --> src/evaluate.rs:794:9 [INFO] [stdout] | [INFO] [stdout] 794 | / match &self { [INFO] [stdout] 795 | | Wait::Ryanmen(_, fu, _) => fu, [INFO] [stdout] 796 | | Wait::Kanchan(_, fu, _) => fu, [INFO] [stdout] 797 | | Wait::Penchan(_, fu, _) => fu, [INFO] [stdout] 798 | | Wait::Tanki(_, fu, _) => fu, [INFO] [stdout] 799 | | Wait::Shanpon(_, fu, _) => fu, [INFO] [stdout] 800 | | }.clone() [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] help: try dereferencing it [INFO] [stdout] | [INFO] [stdout] 794 ~ *match &self { [INFO] [stdout] 795 + Wait::Ryanmen(_, fu, _) => fu, [INFO] [stdout] 796 + Wait::Kanchan(_, fu, _) => fu, [INFO] [stdout] 797 + Wait::Penchan(_, fu, _) => fu, [INFO] [stdout] 798 + Wait::Tanki(_, fu, _) => fu, [INFO] [stdout] 799 + Wait::Shanpon(_, fu, _) => fu, [INFO] [stdout] 800 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/score.rs:36:25 [INFO] [stdout] | [INFO] [stdout] 36 | if han_value >= 13 as u32 { [INFO] [stdout] | ^^^^^^^^^ help: try: `13_u32` [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 integer literal to `u8` is unnecessary [INFO] [stdout] --> src/score.rs:69:32 [INFO] [stdout] | [INFO] [stdout] 69 | if multiple > &(3 as u8) { [INFO] [stdout] | ^^^^^^^^^ help: try: `3_u8` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u8` is unnecessary [INFO] [stdout] --> src/score.rs:92:32 [INFO] [stdout] | [INFO] [stdout] 92 | if multiple > &(3 as u8) { [INFO] [stdout] | ^^^^^^^^^ help: try: `3_u8` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> src/score.rs:138:17 [INFO] [stdout] | [INFO] [stdout] 133 | / let score = [INFO] [stdout] 134 | | if is_dealer { [INFO] [stdout] 135 | | 48000 [INFO] [stdout] 136 | | } else { 36000 } [INFO] [stdout] 137 | | * multiple.clone() as u32; [INFO] [stdout] | |__________________________________________________- unnecessary `let` binding [INFO] [stdout] 138 | score [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 133 ~ [INFO] [stdout] 134 ~ (if is_dealer { [INFO] [stdout] 135 + 48000 [INFO] [stdout] 136 + } else { 36000 } [INFO] [stdout] 137 + * multiple.clone() as u32) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u8` which implements the `Copy` trait [INFO] [stdout] --> src/score.rs:137:27 [INFO] [stdout] | [INFO] [stdout] 137 | * multiple.clone() as u32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try dereferencing it: `*multiple` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/score.rs:148:17 [INFO] [stdout] | [INFO] [stdout] 145 | / let score = [INFO] [stdout] 146 | | if is_dealer { 6 as u32 } else { 4 as u32 } [INFO] [stdout] 147 | | * fu * u32::pow(2, han.clone() + 2); [INFO] [stdout] | |____________________________________________________________- unnecessary `let` binding [INFO] [stdout] 148 | score [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 145 ~ [INFO] [stdout] 146 ~ (if is_dealer { 6 as u32 } else { 4 as u32 } [INFO] [stdout] 147 + * fu * u32::pow(2, han.clone() + 2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/score.rs:142:26 [INFO] [stdout] | [INFO] [stdout] 142 | let fu = ((fu + (10 - 1)) / 10) * 10; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `fu.div_ceil(10)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/score.rs:146:36 [INFO] [stdout] | [INFO] [stdout] 146 | if is_dealer { 6 as u32 } else { 4 as u32 } [INFO] [stdout] | ^^^^^^^^ help: try: `6_u32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> src/score.rs:146:54 [INFO] [stdout] | [INFO] [stdout] 146 | if is_dealer { 6 as u32 } else { 4 as u32 } [INFO] [stdout] | ^^^^^^^^ help: try: `4_u32` [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: using `clone` on type `u32` which implements the `Copy` trait [INFO] [stdout] --> src/score.rs:147:44 [INFO] [stdout] | [INFO] [stdout] 147 | * fu * u32::pow(2, han.clone() + 2); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*han` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/score.rs:170:37 [INFO] [stdout] | [INFO] [stdout] 170 | let score_display = ((score + (100 - 1)) / 100) * 100; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `score.div_ceil(100)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/score.rs:171:41 [INFO] [stdout] | [INFO] [stdout] 171 | let score_draw_dealer = ((score / 2 + (100 - 1)) / 100) * 100; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(score / 2).div_ceil(100)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/score.rs:172:34 [INFO] [stdout] | [INFO] [stdout] 172 | let score_draw = ((score / 4 + (100 - 1)) / 100) * 100; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(score / 4).div_ceil(100)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/score.rs:174:44 [INFO] [stdout] | [INFO] [stdout] 174 | let score_dealer_display = ((score_dealer + (100 - 1)) / 100) * 100; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `score_dealer.div_ceil(100)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/score.rs:175:41 [INFO] [stdout] | [INFO] [stdout] 175 | let score_dealer_draw = ((score_dealer / 3 + (100 - 1)) / 100) * 100; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `(score_dealer / 3).div_ceil(100)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/evaluate.rs:431:31 [INFO] [stdout] | [INFO] [stdout] 431 | let dragons = vec![Dragon::White.tile(), Dragon::Green.tile(), Dragon::Red.tile()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[Dragon::White.tile(), Dragon::Green.tile(), Dragon::Red.tile()]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/evaluate.rs:450:31 [INFO] [stdout] | [INFO] [stdout] 450 | let dragons = vec![Wind::East.tile(), Wind::South.tile(), Wind::West.tile(), Wind::North.tile()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[Wind::East.tile(), Wind::South.tile(), Wind::West.tile(), Wind::North.tile()]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/evaluate.rs:458:31 [INFO] [stdout] | [INFO] [stdout] 458 | let dragons = vec![Wind::East.tile(), Wind::South.tile(), Wind::West.tile(), Wind::North.tile()]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[Wind::East.tile(), Wind::South.tile(), Wind::West.tile(), Wind::North.tile()]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused borrow that must be used [INFO] [stdout] --> src/parse.rs:225:9 [INFO] [stdout] | [INFO] [stdout] 225 | &self.pong.clone().map(|ref node| vec.append(&mut node.search_leafs())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the borrow produces a value [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 225 | let _ = &self.pong.clone().map(|ref node| vec.append(&mut node.search_leafs())); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused borrow that must be used [INFO] [stdout] --> src/parse.rs:226:9 [INFO] [stdout] | [INFO] [stdout] 226 | &self.chow.clone().map(|ref node| vec.append(&mut node.search_leafs())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the borrow produces a value [INFO] [stdout] | [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 226 | let _ = &self.chow.clone().map(|ref node| vec.append(&mut node.search_leafs())); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 7.26s [INFO] running `Command { std: "docker" "inspect" "657a96ab739cf70307e9d8d7e598ee292ba66be99f0b2cb6b9d9f386bcb4df7c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "657a96ab739cf70307e9d8d7e598ee292ba66be99f0b2cb6b9d9f386bcb4df7c", kill_on_drop: false }` [INFO] [stdout] 657a96ab739cf70307e9d8d7e598ee292ba66be99f0b2cb6b9d9f386bcb4df7c