[INFO] cloning repository https://github.com/jacopograndi/tage [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/jacopograndi/tage" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjacopograndi%2Ftage", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjacopograndi%2Ftage'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] aea105e1b8373a070e36c5c639f3198fd403c4c7 [INFO] linting jacopograndi/tage against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjacopograndi%2Ftage" "/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/jacopograndi/tage [INFO] finished tweaking git repo https://github.com/jacopograndi/tage [INFO] tweaked toml for git repo https://github.com/jacopograndi/tage written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/jacopograndi/tage 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/jacopograndi/tage already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded renet v0.0.15 [INFO] [stderr] Downloaded bincode v2.0.0-rc.3 [INFO] [stderr] Downloaded octets v0.2.0 [INFO] [stderr] Downloaded clap_derive v4.5.5 [INFO] [stderr] Downloaded virtue v0.0.13 [INFO] [stderr] Downloaded bincode_derive v2.0.0-rc.3 [INFO] [stderr] Downloaded renetcode v0.0.11 [INFO] [stderr] Downloaded clap v4.5.7 [INFO] [stderr] Downloaded ron v0.9.0-alpha.0 [INFO] [stderr] Downloaded clap_builder v4.5.7 [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] f85d748ceacfcea08cb1b7a047272517d5a0960e36853956d7bde0c32faee9a0 [INFO] running `Command { std: "docker" "start" "-a" "f85d748ceacfcea08cb1b7a047272517d5a0960e36853956d7bde0c32faee9a0", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "f85d748ceacfcea08cb1b7a047272517d5a0960e36853956d7bde0c32faee9a0", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "f85d748ceacfcea08cb1b7a047272517d5a0960e36853956d7bde0c32faee9a0", kill_on_drop: false }` [INFO] [stdout] f85d748ceacfcea08cb1b7a047272517d5a0960e36853956d7bde0c32faee9a0 [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] 3b9fb82b86a043a142a5cf5168a150f7286c9c42841b97ee309bfe6cf8835734 [INFO] running `Command { std: "docker" "start" "-a" "3b9fb82b86a043a142a5cf5168a150f7286c9c42841b97ee309bfe6cf8835734", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.155 [INFO] [stderr] Compiling serde v1.0.203 [INFO] [stderr] Compiling rustversion v1.0.17 [INFO] [stderr] Compiling virtue v0.0.13 [INFO] [stderr] Checking tracing-core v0.1.32 [INFO] [stderr] Compiling ahash v0.8.11 [INFO] [stderr] Checking zeroize v1.8.1 [INFO] [stderr] Compiling signal-hook v0.3.17 [INFO] [stderr] Checking zerocopy v0.7.34 [INFO] [stderr] Checking clap_lex v0.7.1 [INFO] [stderr] Compiling quote v1.0.36 [INFO] [stderr] Checking inout v0.1.3 [INFO] [stderr] Checking either v1.12.0 [INFO] [stderr] Checking option-ext v0.2.0 [INFO] [stderr] Checking unicode-width v0.1.13 [INFO] [stderr] Checking thread_local v1.1.8 [INFO] [stderr] Checking octets v0.2.0 [INFO] [stderr] Checking cassowary v0.3.0 [INFO] [stderr] Checking bytes v1.6.0 [INFO] [stderr] Compiling syn v2.0.68 [INFO] [stderr] Checking clap_builder v4.5.7 [INFO] [stderr] Checking itertools v0.12.1 [INFO] [stderr] Checking tracing v0.1.40 [INFO] [stderr] Checking tracing-subscriber v0.3.18 [INFO] [stderr] Compiling bincode_derive v2.0.0-rc.3 [INFO] [stderr] Checking hashbrown v0.14.5 [INFO] [stderr] Checking castaway v0.2.2 [INFO] [stderr] Checking compact_str v0.7.1 [INFO] [stderr] Checking getrandom v0.2.15 [INFO] [stderr] Checking signal-hook-registry v1.4.2 [INFO] [stderr] Checking parking_lot_core v0.9.10 [INFO] [stderr] Checking mio v0.8.11 [INFO] [stderr] Checking dirs-sys v0.4.1 [INFO] [stderr] Checking bincode v2.0.0-rc.3 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking parking_lot v0.12.3 [INFO] [stderr] Checking crypto-common v0.1.6 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking dirs v5.0.1 [INFO] [stderr] Checking universal-hash v0.5.1 [INFO] [stderr] Checking cipher v0.4.4 [INFO] [stderr] Checking aead v0.5.2 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking poly1305 v0.8.0 [INFO] [stderr] Checking unicode-truncate v1.0.0 [INFO] [stderr] Checking signal-hook-mio v0.2.3 [INFO] [stderr] Checking chacha20 v0.9.1 [INFO] [stderr] Checking lru v0.12.3 [INFO] [stderr] Checking chacha20poly1305 v0.10.1 [INFO] [stderr] Checking renetcode v0.0.11 [INFO] [stderr] Checking renet v0.0.15 [INFO] [stderr] Compiling serde_derive v1.0.203 [INFO] [stderr] Compiling clap_derive v4.5.5 [INFO] [stderr] Compiling strum_macros v0.26.4 [INFO] [stderr] Compiling stability v0.2.0 [INFO] [stderr] Checking clap v4.5.7 [INFO] [stderr] Checking strum v0.26.3 [INFO] [stderr] Checking bitflags v2.5.0 [INFO] [stderr] Checking ron v0.9.0-alpha.0 [INFO] [stderr] Checking crossterm v0.27.0 [INFO] [stderr] Checking tage_core v0.1.0 (/opt/rustwide/workdir/crates/tage_core) [INFO] [stderr] Checking ratatui v0.26.3 [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> crates/tage_core/src/game.rs:979:24 [INFO] [stdout] | [INFO] [stdout] 979 | const GRID_SEPARATOR: &'static str = " "; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> crates/tage_core/src/machine/distance_travel_map.rs:162:20 [INFO] [stdout] | [INFO] [stdout] 162 | if distance_tile >= oth + cost + 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change it to: `distance_tile > oth + cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] = note: `#[warn(clippy::int_plus_one)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> crates/tage_core/src/game.rs:979:24 [INFO] [stdout] | [INFO] [stdout] 979 | const GRID_SEPARATOR: &'static str = " "; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `>= y + 1` or `x - 1 >=` [INFO] [stdout] --> crates/tage_core/src/machine/distance_travel_map.rs:162:20 [INFO] [stdout] | [INFO] [stdout] 162 | if distance_tile >= oth + cost + 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change it to: `distance_tile > oth + cost` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#int_plus_one [INFO] [stdout] = note: `#[warn(clippy::int_plus_one)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/test.rs:267:17 [INFO] [stdout] | [INFO] [stdout] 267 | &unit_bp, [INFO] [stdout] | ^^^^^^^^ help: change this to: `unit_bp` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/test.rs:279:17 [INFO] [stdout] | [INFO] [stdout] 279 | &unit_bp, [INFO] [stdout] | ^^^^^^^^ help: change this to: `unit_bp` [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] --> crates/tage_core/src/actions/test.rs:361:39 [INFO] [stdout] | [INFO] [stdout] 361 | board.grid.get_at_mut(&build_spot).set_unit( [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `build_spot` [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] --> crates/tage_core/src/actions/test.rs:369:21 [INFO] [stdout] | [INFO] [stdout] 369 | &castle_bp, [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `castle_bp` [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] --> crates/tage_core/src/actions/test.rs:381:17 [INFO] [stdout] | [INFO] [stdout] 381 | &villager_bp, [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `villager_bp` [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] --> crates/tage_core/src/actions/test.rs:392:17 [INFO] [stdout] | [INFO] [stdout] 392 | &unit_bp, [INFO] [stdout] | ^^^^^^^^ help: change this to: `unit_bp` [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] --> crates/tage_core/src/actions/test.rs:400:17 [INFO] [stdout] | [INFO] [stdout] 400 | &unit_bp, [INFO] [stdout] | ^^^^^^^^ help: change this to: `unit_bp` [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: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:48:39 [INFO] [stdout] | [INFO] [stdout] 48 | top.into_iter().chain(bot.into_iter()).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 48 - top.into_iter().chain(bot.into_iter()).collect() [INFO] [stdout] 48 + top.into_iter().chain(bot).collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:61:31 [INFO] [stdout] | [INFO] [stdout] 61 | .contains(&self) [INFO] [stdout] | ^^^^^ help: change this to: `self` [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] --> crates/tage_core/src/actions/player_action.rs:65:31 [INFO] [stdout] | [INFO] [stdout] 65 | .contains(&self) [INFO] [stdout] | ^^^^^ help: change this to: `self` [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 `IVec2` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:86:34 [INFO] [stdout] | [INFO] [stdout] 86 | destination: destination.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `destination` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `IVec2` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:241:34 [INFO] [stdout] | [INFO] [stdout] 241 | destination: destination.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `destination` [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: unneeded unit return type [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:273:47 [INFO] [stdout] | [INFO] [stdout] 273 | fn wrap_check_invariants ()>(&self, board: &mut Board, f: F) { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:330:61 [INFO] [stdout] | [INFO] [stdout] 330 | let linked_tile = board.grid.get_at(&pos); [INFO] [stdout] | ^^^^ help: change this to: `pos` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:352:14 [INFO] [stdout] | [INFO] [stdout] 352 | .map(|act_travel| { [INFO] [stdout] | ______________^ [INFO] [stdout] 353 | | act_travel.apply(board); [INFO] [stdout] 354 | | let to = &UnitTarget::new( [INFO] [stdout] 355 | | board [INFO] [stdout] ... | [INFO] [stdout] 374 | | }) [INFO] [stdout] 375 | | .flatten() [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 352 ~ .flat_map(|act_travel| { [INFO] [stdout] 353 + act_travel.apply(board); [INFO] [stdout] 354 + let to = &UnitTarget::new( [INFO] [stdout] 355 + board [INFO] [stdout] 356 + .get_unit(&UnitPos::top(act_travel.destination)) [INFO] [stdout] 357 + .unwrap() [INFO] [stdout] 358 + .clone(), [INFO] [stdout] 359 + act_travel.destination, [INFO] [stdout] 360 + ); [INFO] [stdout] 361 + let p = &act_travel.path; [INFO] [stdout] 362 + let mut acts = vec![]; [INFO] [stdout] 363 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 364 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 365 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 366 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 367 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 368 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 369 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 370 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 371 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 372 + act_travel.undo(board); [INFO] [stdout] 373 + acts [INFO] [stdout] 374 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:383:15 [INFO] [stdout] | [INFO] [stdout] 383 | path: &Vec, [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] 383 ~ path: &[IVec2], [INFO] [stdout] 384 | ) -> impl Iterator [INFO] [stdout] ... [INFO] [stdout] 405 | action: act.clone().into(), [INFO] [stdout] 406 ~ path: path.to_owned(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:391:14 [INFO] [stdout] | [INFO] [stdout] 391 | .map(|act| { [INFO] [stdout] | ______________^ [INFO] [stdout] 392 | | act.apply(board); [INFO] [stdout] 393 | | let results: Vec = ActPickup::generate(moved, board) [INFO] [stdout] 394 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 419 | | }) [INFO] [stdout] 420 | | .flatten() [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 391 ~ .flat_map(|act| { [INFO] [stdout] 392 + act.apply(board); [INFO] [stdout] 393 + let results: Vec = ActPickup::generate(moved, board) [INFO] [stdout] 394 + .iter() [INFO] [stdout] 395 + .map(|act_pickup| { [INFO] [stdout] 396 + act_pickup.apply(board); [INFO] [stdout] 397 + let results: Vec = ActDone::generate(moved, board) [INFO] [stdout] 398 + .iter() [INFO] [stdout] 399 + .map(|act_done| { [INFO] [stdout] 400 + act_done.apply(board); [INFO] [stdout] 401 + let result = PlayerAction::Unit { [INFO] [stdout] 402 + target: pre.clone(), [INFO] [stdout] 403 + destination: moved.at.clone(), [INFO] [stdout] 404 + pickup: act_pickup.pickup.clone(), [INFO] [stdout] 405 + action: act.clone().into(), [INFO] [stdout] 406 + path: path.clone(), [INFO] [stdout] 407 + }; [INFO] [stdout] 408 + act_done.undo(board); [INFO] [stdout] 409 + result [INFO] [stdout] 410 + }) [INFO] [stdout] 411 + .collect(); [INFO] [stdout] 412 + act_pickup.undo(board); [INFO] [stdout] 413 + results [INFO] [stdout] 414 + }) [INFO] [stdout] 415 + .flatten() [INFO] [stdout] 416 + .collect(); [INFO] [stdout] 417 + act.undo(board); [INFO] [stdout] 418 + results [INFO] [stdout] 419 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:395:22 [INFO] [stdout] | [INFO] [stdout] 395 | .map(|act_pickup| { [INFO] [stdout] | ______________________^ [INFO] [stdout] 396 | | act_pickup.apply(board); [INFO] [stdout] 397 | | let results: Vec = ActDone::generate(moved, board) [INFO] [stdout] 398 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 414 | | }) [INFO] [stdout] 415 | | .flatten() [INFO] [stdout] | |______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 395 ~ .flat_map(|act_pickup| { [INFO] [stdout] 396 + act_pickup.apply(board); [INFO] [stdout] 397 + let results: Vec = ActDone::generate(moved, board) [INFO] [stdout] 398 + .iter() [INFO] [stdout] 399 + .map(|act_done| { [INFO] [stdout] 400 + act_done.apply(board); [INFO] [stdout] 401 + let result = PlayerAction::Unit { [INFO] [stdout] 402 + target: pre.clone(), [INFO] [stdout] 403 + destination: moved.at.clone(), [INFO] [stdout] 404 + pickup: act_pickup.pickup.clone(), [INFO] [stdout] 405 + action: act.clone().into(), [INFO] [stdout] 406 + path: path.clone(), [INFO] [stdout] 407 + }; [INFO] [stdout] 408 + act_done.undo(board); [INFO] [stdout] 409 + result [INFO] [stdout] 410 + }) [INFO] [stdout] 411 + .collect(); [INFO] [stdout] 412 + act_pickup.undo(board); [INFO] [stdout] 413 + results [INFO] [stdout] 414 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `IVec2` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:403:50 [INFO] [stdout] | [INFO] [stdout] 403 | ... destination: moved.at.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `moved.at` [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: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:452:20 [INFO] [stdout] | [INFO] [stdout] 452 | .chain(trains.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 452 - .chain(trains.into_iter()) [INFO] [stdout] 452 + .chain(trains) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:453:20 [INFO] [stdout] | [INFO] [stdout] 453 | .chain(ageups.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 453 - .chain(ageups.into_iter()) [INFO] [stdout] 453 + .chain(ageups) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:454:20 [INFO] [stdout] | [INFO] [stdout] 454 | .chain(dones.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 454 - .chain(dones.into_iter()) [INFO] [stdout] 454 + .chain(dones) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:491:42 [INFO] [stdout] | [INFO] [stdout] 491 | UnitAction::Relic => format!("uses relic action"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"uses relic action".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:503:41 [INFO] [stdout] | [INFO] [stdout] 503 | UnitAction::Done => format!("does nothing"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"does nothing".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:507:26 [INFO] [stdout] | [INFO] [stdout] 507 | _ => format!(""), [INFO] [stdout] | ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:517:46 [INFO] [stdout] | [INFO] [stdout] 517 | BuildingAction::AgeUp => format!("ages up"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"ages up".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:518:45 [INFO] [stdout] | [INFO] [stdout] 518 | BuildingAction::Done => format!("does nothing"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"does nothing".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:522:39 [INFO] [stdout] | [INFO] [stdout] 522 | PlayerAction::PassTurn => format!("Pass Turn"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Pass Turn".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> crates/tage_core/src/actions/attack.rs:22:12 [INFO] [stdout] | [INFO] [stdout] 22 | if !bonus.forbid_attack && !(bonus.forbid_attack_after_move && unit.moved) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(bonus.forbid_attack || bonus.forbid_attack_after_move && unit.moved)` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/attack.rs:23:53 [INFO] [stdout] | [INFO] [stdout] 23 | let range = ActAttack::get_range(board, &pre); [INFO] [stdout] | ^^^^ help: change this to: `pre` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/actions/attack.rs:259:14 [INFO] [stdout] | [INFO] [stdout] 259 | .map(|id| bp.get_tech(id).battle_bonuses.iter()) [INFO] [stdout] | ______________^ [INFO] [stdout] 260 | | .flatten(); [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|id| bp.get_tech(id).battle_bonuses.iter())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/actions/attack.rs:264:14 [INFO] [stdout] | [INFO] [stdout] 264 | .map(|ability_id| { [INFO] [stdout] | ______________^ [INFO] [stdout] 265 | | let ability_bp = bp.get_ability(ability_id.ability()); [INFO] [stdout] 266 | | ability_bp.battle_bonuses.iter() [INFO] [stdout] 267 | | }) [INFO] [stdout] 268 | | .flatten(); [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 264 ~ .flat_map(|ability_id| { [INFO] [stdout] 265 + let ability_bp = bp.get_ability(ability_id.ability()); [INFO] [stdout] 266 + ability_bp.battle_bonuses.iter() [INFO] [stdout] 267 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> crates/tage_core/src/actions/attack.rs:280:5 [INFO] [stdout] | [INFO] [stdout] 280 | / pub fn battle( [INFO] [stdout] 281 | | bp: &Blueprints, [INFO] [stdout] 282 | | atk_unit: &Unit, [INFO] [stdout] 283 | | def_unit: &Unit, [INFO] [stdout] ... | [INFO] [stdout] 289 | | _trace_steps: bool, [INFO] [stdout] 290 | | ) -> BattleOutcome { [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/attack.rs:308:13 [INFO] [stdout] | [INFO] [stdout] 308 | &atk_unit, [INFO] [stdout] | ^^^^^^^^^ help: change this to: `atk_unit` [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: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> crates/tage_core/src/actions/build.rs:20:16 [INFO] [stdout] | [INFO] [stdout] 20 | if let Some(_) = tile.building { [INFO] [stdout] | -------^^^^^^^---------------- help: try: `if tile.building.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/actions/build.rs:28:14 [INFO] [stdout] | [INFO] [stdout] 28 | .map(|id| { [INFO] [stdout] | ______________^ [INFO] [stdout] 29 | | ActBuild::get_build_placements(board.bp(), board, id, pre.at) [INFO] [stdout] 30 | | .map(move |area| (id, area)) [INFO] [stdout] 31 | | }) [INFO] [stdout] 32 | | .flatten() [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 28 ~ .flat_map(|id| { [INFO] [stdout] 29 + ActBuild::get_build_placements(board.bp(), board, id, pre.at) [INFO] [stdout] 30 + .map(move |area| (id, area)) [INFO] [stdout] 31 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/build.rs:85:43 [INFO] [stdout] | [INFO] [stdout] 85 | let player = board.get_player_mut(&owner); [INFO] [stdout] | ^^^^^^ help: change this to: `owner` [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 boolean expression can be simplified [INFO] [stdout] --> crates/tage_core/src/actions/convert.rs:20:12 [INFO] [stdout] | [INFO] [stdout] 20 | if !bonus.forbid_attack && !(bonus.forbid_attack_after_move && unit.moved) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(bonus.forbid_attack || bonus.forbid_attack_after_move && unit.moved)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/convert.rs:68:17 [INFO] [stdout] | [INFO] [stdout] 68 | &this_unit, [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `this_unit` [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] --> crates/tage_core/src/actions/convert.rs:69:17 [INFO] [stdout] | [INFO] [stdout] 69 | &target_unit, [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `target_unit` [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: binary comparison to literal `Option::None` [INFO] [stdout] --> crates/tage_core/src/actions/end_turn.rs:69:38 [INFO] [stdout] | [INFO] [stdout] 69 | ... (t.get_top_unit() == None && terrain_bp.stats.move_cost < 5) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `t.get_top_unit().is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> crates/tage_core/src/actions/end_turn.rs:145:21 [INFO] [stdout] | [INFO] [stdout] 145 | / if building.in_construction { [INFO] [stdout] 146 | | if unit_build_list [INFO] [stdout] 147 | | .contains(&IdName::Id(Id::Unit(building.blueprint_id.clone()))) [INFO] [stdout] ... | [INFO] [stdout] 153 | | } [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] 145 ~ if building.in_construction [INFO] [stdout] 146 ~ && unit_build_list [INFO] [stdout] 147 | .contains(&IdName::Id(Id::Unit(building.blueprint_id.clone()))) [INFO] [stdout] ... [INFO] [stdout] 151 | check_capture = true; [INFO] [stdout] 152 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/tage_core/src/actions/end_turn.rs:205:5 [INFO] [stdout] | [INFO] [stdout] 205 | list.sort_by(|a, b| a.0.cmp(&b.0)); [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] 205 - list.sort_by(|a, b| a.0.cmp(&b.0)); [INFO] [stdout] 205 + list.sort_by_key(|a| a.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> crates/tage_core/src/actions/end_turn.rs:251:13 [INFO] [stdout] | [INFO] [stdout] 251 | / if board.unit_loc(unit) == UnitLocation::Bot { [INFO] [stdout] 252 | | if !ActBuild::is_building_active(board, UnitPos::bot(xy)) { [INFO] [stdout] 253 | | continue; [INFO] [stdout] 254 | | } [INFO] [stdout] 255 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 251 ~ if board.unit_loc(unit) == UnitLocation::Bot [INFO] [stdout] 252 ~ && !ActBuild::is_building_active(board, UnitPos::bot(xy)) { [INFO] [stdout] 253 | continue; [INFO] [stdout] 254 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> crates/tage_core/src/actions/heal.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | / tile.unit.as_ref().and_then(|target_unit| { [INFO] [stdout] 19 | | Some(ActHeal { [INFO] [stdout] 20 | | this: pre.clone(), [INFO] [stdout] 21 | | target: UnitTarget { [INFO] [stdout] ... | [INFO] [stdout] 25 | | }) [INFO] [stdout] 26 | | }) [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 18 ~ tile.unit.as_ref().map(|target_unit| ActHeal { [INFO] [stdout] 19 + this: pre.clone(), [INFO] [stdout] 20 + target: UnitTarget { [INFO] [stdout] 21 + unit: target_unit.clone(), [INFO] [stdout] 22 + at: pre.at + **dir, [INFO] [stdout] 23 + }, [INFO] [stdout] 24 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> crates/tage_core/src/actions/merge.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | / tile.unit.as_ref().and_then(|target_unit| { [INFO] [stdout] 23 | | Some(ActMerge { [INFO] [stdout] 24 | | this: UnitTarget::new(unit.clone(), pre.at), [INFO] [stdout] 25 | | target: UnitTarget::new(target_unit.clone(), pre.at + **dir), [INFO] [stdout] 26 | | }) [INFO] [stdout] 27 | | }) [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 22 ~ tile.unit.as_ref().map(|target_unit| ActMerge { [INFO] [stdout] 23 + this: UnitTarget::new(unit.clone(), pre.at), [INFO] [stdout] 24 + target: UnitTarget::new(target_unit.clone(), pre.at + **dir), [INFO] [stdout] 25 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> crates/tage_core/src/actions/merge.rs:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | / board [INFO] [stdout] 41 | | .grid [INFO] [stdout] 42 | | .get_at_mut(&self.this.at) [INFO] [stdout] 43 | | .unit [INFO] [stdout] ... | [INFO] [stdout] 48 | | board.set_unit_at(&board.get_target_pos(&self.target), Some(unit)); [INFO] [stdout] 49 | | }); [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] = note: `#[warn(clippy::option_map_unit_fn)]` on by default [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 40 ~ if let Some(mut unit) = board [INFO] [stdout] 41 + .grid [INFO] [stdout] 42 + .get_at_mut(&self.this.at) [INFO] [stdout] 43 + .unit [INFO] [stdout] 44 + .take() { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> crates/tage_core/src/actions/pickup.rs:21:16 [INFO] [stdout] | [INFO] [stdout] 21 | && self.this.unit.holding_collectable == None [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `self.this.unit.holding_collectable.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> crates/tage_core/src/actions/pickup.rs:25:12 [INFO] [stdout] | [INFO] [stdout] 25 | if self.pickup != None { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `self.pickup.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> crates/tage_core/src/actions/pickup.rs:33:25 [INFO] [stdout] | [INFO] [stdout] 33 | / tile.unit [INFO] [stdout] 34 | | .as_mut() [INFO] [stdout] 35 | | .map(|u| u.holding_collectable = Some(collectible)); [INFO] [stdout] | |_______________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 33 ~ if let Some(u) = tile.unit [INFO] [stdout] 34 + .as_mut() { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> crates/tage_core/src/actions/pickup.rs:48:9 [INFO] [stdout] | [INFO] [stdout] 48 | / tile.unit.as_mut().map(|unit| { [INFO] [stdout] 49 | | if let Some(collectible) = unit.holding_collectable.take().or(self.pickup.clone()) { [INFO] [stdout] 50 | | match collectible { [INFO] [stdout] 51 | | Collectable::BonusFood => production.food += 100, [INFO] [stdout] ... | [INFO] [stdout] 57 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 48 - tile.unit.as_mut().map(|unit| { [INFO] [stdout] 49 - if let Some(collectible) = unit.holding_collectable.take().or(self.pickup.clone()) { [INFO] [stdout] 50 - match collectible { [INFO] [stdout] 51 - Collectable::BonusFood => production.food += 100, [INFO] [stdout] 52 - Collectable::BonusGold => production.gold += 100, [INFO] [stdout] 53 - _ => {} [INFO] [stdout] 54 - } [INFO] [stdout] 55 - tile.terrain.collectable = Some(collectible); [INFO] [stdout] 56 - } [INFO] [stdout] 57 - }); [INFO] [stdout] 48 + if let Some(unit) = tile.unit.as_mut() { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> crates/tage_core/src/actions/power.rs:36:9 [INFO] [stdout] | [INFO] [stdout] 36 | / if power.require_on_building != UnitConstraint::NoConstraint { [INFO] [stdout] 37 | | if !board [INFO] [stdout] 38 | | .get_unit(&UnitPos::bot(self.this.at)) [INFO] [stdout] 39 | | .map(|building| { [INFO] [stdout] ... | [INFO] [stdout] 49 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 36 ~ if power.require_on_building != UnitConstraint::NoConstraint [INFO] [stdout] 37 ~ && !board [INFO] [stdout] 38 | .get_unit(&UnitPos::bot(self.this.at)) [INFO] [stdout] ... [INFO] [stdout] 47 | return false; [INFO] [stdout] 48 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/power.rs:43:48 [INFO] [stdout] | [INFO] [stdout] 43 | .satisfied(board.bp(), &building_bp) [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `building_bp` [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: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_core/src/actions/power.rs:54:47 [INFO] [stdout] | [INFO] [stdout] 54 | if power.effects.iter().all(|eff| match eff { [INFO] [stdout] | _______________________________________________^ [INFO] [stdout] 55 | | PowerEffect::Heal(_) => true, [INFO] [stdout] 56 | | _ => false, [INFO] [stdout] 57 | | }) { [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] 54 - if power.effects.iter().all(|eff| match eff { [INFO] [stdout] 55 - PowerEffect::Heal(_) => true, [INFO] [stdout] 56 - _ => false, [INFO] [stdout] 57 - }) { [INFO] [stdout] 54 + if power.effects.iter().all(|eff| matches!(eff, PowerEffect::Heal(_))) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> crates/tage_core/src/actions/power.rs:73:25 [INFO] [stdout] | [INFO] [stdout] 73 | / board [INFO] [stdout] 74 | | .grid [INFO] [stdout] 75 | | .get_at_mut(&target.at) [INFO] [stdout] 76 | | .unit [INFO] [stdout] 77 | | .as_mut() [INFO] [stdout] 78 | | .map(|unit| unit.health = (unit.health + heal).min(100)); [INFO] [stdout] | |____________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 73 ~ if let Some(unit) = board [INFO] [stdout] 74 + .grid [INFO] [stdout] 75 + .get_at_mut(&target.at) [INFO] [stdout] 76 + .unit [INFO] [stdout] 77 + .as_mut() { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/actions/power.rs:143:14 [INFO] [stdout] | [INFO] [stdout] 143 | .map(|location| match location { [INFO] [stdout] | ______________^ [INFO] [stdout] 144 | | PowerTargetLocation::This => vec![*from], [INFO] [stdout] 145 | | PowerTargetLocation::Adjacent => board [INFO] [stdout] 146 | | .grid [INFO] [stdout] ... | [INFO] [stdout] 163 | | }) [INFO] [stdout] 164 | | .flatten() [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 143 ~ .flat_map(|location| match location { [INFO] [stdout] 144 + PowerTargetLocation::This => vec![*from], [INFO] [stdout] 145 + PowerTargetLocation::Adjacent => board [INFO] [stdout] 146 + .grid [INFO] [stdout] 147 + .get_adjacent(from) [INFO] [stdout] 148 + .iter() [INFO] [stdout] 149 + .map(|(dir, _)| **dir + *from) [INFO] [stdout] 150 + .collect(), [INFO] [stdout] 151 + PowerTargetLocation::Diagonal => board [INFO] [stdout] 152 + .grid [INFO] [stdout] 153 + .get_diagonal(from) [INFO] [stdout] 154 + .iter() [INFO] [stdout] 155 + .map(|(dir, _)| **dir + *from) [INFO] [stdout] 156 + .collect(), [INFO] [stdout] 157 + PowerTargetLocation::InSight => { [INFO] [stdout] 158 + board.get_visible_from(&UnitPos::new(*from, UnitLocation::Top)) [INFO] [stdout] 159 + } [INFO] [stdout] 160 + PowerTargetLocation::All => iter_area(board.grid.size) [INFO] [stdout] 161 + .filter_map(|xy| (!board.grid.get_at(&xy).get_units().is_empty()).then(|| xy)) [INFO] [stdout] 162 + .collect(), [INFO] [stdout] 163 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `bool::then` in `filter_map` [INFO] [stdout] --> crates/tage_core/src/actions/power.rs:161:22 [INFO] [stdout] | [INFO] [stdout] 161 | .filter_map(|xy| (!board.grid.get_at(&xy).get_units().is_empty()).then(|| xy)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&xy| (!board.grid.get_at(&xy).get_units().is_empty())).map(|xy| xy)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_bool_then [INFO] [stdout] = note: `#[warn(clippy::filter_map_bool_then)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> crates/tage_core/src/actions/power.rs:161:38 [INFO] [stdout] | [INFO] [stdout] 161 | .filter_map(|xy| (!board.grid.get_at(&xy).get_units().is_empty()).then(|| xy)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 161 - .filter_map(|xy| (!board.grid.get_at(&xy).get_units().is_empty()).then(|| xy)) [INFO] [stdout] 161 + .filter_map(|xy| (!board.grid.get_at(&xy).get_units().is_empty()).then_some(xy)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> crates/tage_core/src/actions/power.rs:166:17 [INFO] [stdout] | [INFO] [stdout] 166 | / board [INFO] [stdout] 167 | | .grid [INFO] [stdout] 168 | | .get_at(&xy) [INFO] [stdout] 169 | | .unit [INFO] [stdout] 170 | | .as_ref() [INFO] [stdout] 171 | | .and_then(|u| Some(UnitTarget::new(u.clone(), xy))) [INFO] [stdout] | |_______________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 166 ~ board [INFO] [stdout] 167 + .grid [INFO] [stdout] 168 + .get_at(&xy) [INFO] [stdout] 169 + .unit [INFO] [stdout] 170 + .as_ref().map(|u| UnitTarget::new(u.clone(), xy)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> crates/tage_core/src/actions/relic.rs:54:17 [INFO] [stdout] | [INFO] [stdout] 54 | / tile.unit [INFO] [stdout] 55 | | .as_mut() [INFO] [stdout] 56 | | .map(|unit| unit.holding_collectable = tile.terrain.collectable.take()); [INFO] [stdout] | |___________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 54 ~ if let Some(unit) = tile.unit [INFO] [stdout] 55 + .as_mut() { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> crates/tage_core/src/actions/relic.rs:77:14 [INFO] [stdout] | [INFO] [stdout] 77 | .map(|b| b.holding_collectable.clone()) [INFO] [stdout] | ______________^ [INFO] [stdout] 78 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|b| b.holding_collectable.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> crates/tage_core/src/actions/relic.rs:96:22 [INFO] [stdout] | [INFO] [stdout] 96 | .map(|unit| unit.holding_collectable.take()) [INFO] [stdout] | ______________________^ [INFO] [stdout] 97 | | .flatten(); [INFO] [stdout] | |______________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|unit| unit.holding_collectable.take())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> crates/tage_core/src/actions/research.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | / board [INFO] [stdout] 13 | | .bp() [INFO] [stdout] 14 | | .techs [INFO] [stdout] 15 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 20 | | .filter(|act| act.is_valid(board)) [INFO] [stdout] 21 | | }) [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 12 ~ board [INFO] [stdout] 13 + .bp() [INFO] [stdout] 14 + .techs.keys().filter_map(|tech_id| { [INFO] [stdout] 15 + Some(ActResearch { [INFO] [stdout] 16 + tech_id: tech_id.clone(), [INFO] [stdout] 17 + }) [INFO] [stdout] 18 + .filter(|act| act.is_valid(board)) [INFO] [stdout] 19 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/research.rs:98:39 [INFO] [stdout] | [INFO] [stdout] 98 | if !board.bp.unit_has_ability(&building_id, "Age Up") { [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `building_id` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> crates/tage_core/src/actions/trade.rs:59:9 [INFO] [stdout] | [INFO] [stdout] 58 | let rate = (250 - trade * 25).max(100); [INFO] [stdout] | --------------------------------------- unnecessary `let` binding [INFO] [stdout] 59 | rate [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] 58 ~ [INFO] [stdout] 59 ~ (250 - trade * 25).max(100) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/trade.rs:57:44 [INFO] [stdout] | [INFO] [stdout] 57 | let trade = board.get_player_bonus(&owner, None).trade; [INFO] [stdout] | ^^^^^^ help: change this to: `owner` [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: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> crates/tage_core/src/actions/train.rs:19:16 [INFO] [stdout] | [INFO] [stdout] 19 | if let Some(_) = tile.unit { [INFO] [stdout] | -------^^^^^^^------------ help: try: `if tile.unit.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> crates/tage_core/src/actions/train.rs:24:52 [INFO] [stdout] | [INFO] [stdout] 24 | let potential_train_list: Vec = if building.train_list_override.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!building.train_list_override.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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/train.rs:92:49 [INFO] [stdout] | [INFO] [stdout] 92 | let tech_bonus = board.get_player_bonus(&owner, Some(train_id)); [INFO] [stdout] | ^^^^^^ help: change this to: `owner` [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] --> crates/tage_core/src/actions/train.rs:94:39 [INFO] [stdout] | [INFO] [stdout] 94 | let player = board.get_player(&owner); [INFO] [stdout] | ^^^^^^ help: change this to: `owner` [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] --> crates/tage_core/src/actions/train.rs:102:54 [INFO] [stdout] | [INFO] [stdout] 102 | let building_bp = board.bp.as_ref().get_unit(&building_id); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `building_id` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> crates/tage_core/src/actions/train.rs:149:9 [INFO] [stdout] | [INFO] [stdout] 145 | / let affordable = player.resources.contains(&unit.resources.cost.apply_cost( [INFO] [stdout] 146 | | bonus + power_discount + trained_from_bonus + building_bp.train_cost_bonus.clone(), [INFO] [stdout] 147 | | )); [INFO] [stdout] | |___________- unnecessary `let` binding [INFO] [stdout] 148 | [INFO] [stdout] 149 | affordable [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 | [INFO] [stdout] 147 ~ player.resources.contains(&unit.resources.cost.apply_cost( [INFO] [stdout] 148 + bonus + power_discount + trained_from_bonus + building_bp.train_cost_bonus.clone(), [INFO] [stdout] 149 + )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> crates/tage_core/src/actions/travel.rs:103:22 [INFO] [stdout] | [INFO] [stdout] 103 | let points = unit_bp.stats.apply(bonus.clone()).movement as i32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unit_bp.stats.apply(bonus.clone()).movement` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> crates/tage_core/src/actions/travel.rs:242:9 [INFO] [stdout] | [INFO] [stdout] 229 | / let board = Board { [INFO] [stdout] 230 | | bp: Arc::new(blueprints.clone()), [INFO] [stdout] 231 | | grid: parse_map(&blueprints, &map).unwrap().grid, [INFO] [stdout] 232 | | players: vec![Player { [INFO] [stdout] ... | [INFO] [stdout] 240 | | fog_base: FogTile::Visible, [INFO] [stdout] 241 | | }; [INFO] [stdout] | |__________- unnecessary `let` binding [INFO] [stdout] 242 | board [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] 229 ~ [INFO] [stdout] 230 ~ Board { [INFO] [stdout] 231 + bp: Arc::new(blueprints.clone()), [INFO] [stdout] 232 + grid: parse_map(&blueprints, &map).unwrap().grid, [INFO] [stdout] 233 + players: vec![Player { [INFO] [stdout] 234 + id: PlayerId::new(0), [INFO] [stdout] 235 + ..Default::default() [INFO] [stdout] 236 + }], [INFO] [stdout] 237 + day: 0, [INFO] [stdout] 238 + current_player_turn: PlayerId::new(0), [INFO] [stdout] 239 + player_turn_order: vec![PlayerId::new(0)], [INFO] [stdout] 240 + fog: HashMap::new(), [INFO] [stdout] 241 + fog_base: FogTile::Visible, [INFO] [stdout] 242 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/travel.rs:231:42 [INFO] [stdout] | [INFO] [stdout] 231 | grid: parse_map(&blueprints, &map).unwrap().grid, [INFO] [stdout] | ^^^^ help: change this to: `map` [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: calls to `push` immediately after creation [INFO] [stdout] --> crates/tage_core/src/actions/travel.rs:306:9 [INFO] [stdout] | [INFO] [stdout] 306 | / let mut expected = Vec::new(); [INFO] [stdout] ... | [INFO] [stdout] 323 | | vec![v!(0, 1), v!(0, 2), v!(1, 2), v!(2, 2), v!(2, 1)], [INFO] [stdout] 324 | | )); [INFO] [stdout] | |___________^ help: consider using the `vec![]` macro: `let expected = vec![..];` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#vec_init_then_push [INFO] [stdout] = note: `#[warn(clippy::vec_init_then_push)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> crates/tage_core/src/blueprints/mod.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | pub mod blueprints; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:150:49 [INFO] [stdout] | [INFO] [stdout] 150 | .map(|t| (t.0, t.1.resolve(res, &self))) [INFO] [stdout] | ^^^^^ help: change this to: `self` [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] --> crates/tage_core/src/blueprints/blueprints.rs:156:49 [INFO] [stdout] | [INFO] [stdout] 156 | .map(|t| (t.0, t.1.resolve(res, &self))) [INFO] [stdout] | ^^^^^ help: change this to: `self` [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] --> crates/tage_core/src/blueprints/blueprints.rs:162:49 [INFO] [stdout] | [INFO] [stdout] 162 | .map(|t| (t.0, t.1.resolve(res, &self))) [INFO] [stdout] | ^^^^^ help: change this to: `self` [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] --> crates/tage_core/src/blueprints/blueprints.rs:168:49 [INFO] [stdout] | [INFO] [stdout] 168 | .map(|t| (t.0, t.1.resolve(res, &self))) [INFO] [stdout] | ^^^^^ help: change this to: `self` [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] --> crates/tage_core/src/blueprints/blueprints.rs:174:41 [INFO] [stdout] | [INFO] [stdout] 174 | .map(|b| b.resolve(res, &self)) [INFO] [stdout] | ^^^^^ help: change this to: `self` [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] --> crates/tage_core/src/blueprints/blueprints.rs:180:49 [INFO] [stdout] | [INFO] [stdout] 180 | .map(|t| (t.0, t.1.resolve(res, &self))) [INFO] [stdout] | ^^^^^ help: change this to: `self` [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: iterating on a map's values [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:186:13 [INFO] [stdout] | [INFO] [stdout] 186 | bp.terrain.iter().map(|(_, u)| u.clone().into()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.terrain.values().map(|u| u.clone().into())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `blueprints::terrain_bp::TerrainBlueprint` [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:186:44 [INFO] [stdout] | [INFO] [stdout] 186 | bp.terrain.iter().map(|(_, u)| u.clone().into()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `u.clone()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:187:9 [INFO] [stdout] | [INFO] [stdout] 187 | terrains.sort_by(|a, b| a.header.id.0.cmp(&b.header.id.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 187 - terrains.sort_by(|a, b| a.header.id.0.cmp(&b.header.id.0)); [INFO] [stdout] 187 + terrains.sort_by_key(|a| a.header.id.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:195:45 [INFO] [stdout] | [INFO] [stdout] 195 | let mut units: Vec = bp.units.iter().map(|(_, t)| t.clone()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.units.values().map(|t| t.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:196:9 [INFO] [stdout] | [INFO] [stdout] 196 | units.sort_by(|a, b| a.header.id.0.cmp(&b.header.id.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 196 - units.sort_by(|a, b| a.header.id.0.cmp(&b.header.id.0)); [INFO] [stdout] 196 + units.sort_by_key(|a| a.header.id.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:200:45 [INFO] [stdout] | [INFO] [stdout] 200 | let mut techs: Vec = bp.techs.iter().map(|(_, t)| t.clone()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.techs.values().map(|t| t.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:201:9 [INFO] [stdout] | [INFO] [stdout] 201 | techs.sort_by(|a, b| a.id.0.cmp(&b.id.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 201 - techs.sort_by(|a, b| a.id.0.cmp(&b.id.0)); [INFO] [stdout] 201 + techs.sort_by_key(|a| a.id.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:209:13 [INFO] [stdout] | [INFO] [stdout] 209 | bp.abilities.iter().map(|(_, t)| t.clone()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.abilities.values().map(|t| t.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:210:9 [INFO] [stdout] | [INFO] [stdout] 210 | abilities.sort_by(|a, b| a.id.0.cmp(&b.id.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 210 - abilities.sort_by(|a, b| a.id.0.cmp(&b.id.0)); [INFO] [stdout] 210 + abilities.sort_by_key(|a| a.id.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:227:47 [INFO] [stdout] | [INFO] [stdout] 227 | let mut powers: Vec = bp.powers.iter().map(|(_, t)| t.clone()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.powers.values().map(|t| t.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:228:9 [INFO] [stdout] | [INFO] [stdout] 228 | powers.sort_by(|a, b| a.id.0.cmp(&b.id.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 228 - powers.sort_by(|a, b| a.id.0.cmp(&b.id.0)); [INFO] [stdout] 228 + powers.sort_by_key(|a| a.id.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:234:16 [INFO] [stdout] | [INFO] [stdout] 234 | pub fn get<'a>(&'a self, gen_id: &Id) -> Blueprint { [INFO] [stdout] | ^^ ^^ ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 234 - pub fn get<'a>(&'a self, gen_id: &Id) -> Blueprint { [INFO] [stdout] 234 + pub fn get(&self, gen_id: &Id) -> Blueprint { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:245:39 [INFO] [stdout] | [INFO] [stdout] 245 | pub fn get_from_name(&self, name: &String) -> Option { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 245 - pub fn get_from_name(&self, name: &String) -> Option { [INFO] [stdout] 245 + pub fn get_from_name(&self, name: &str) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:247:18 [INFO] [stdout] | [INFO] [stdout] 247 | .map(|id| Id::Tech(id)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Id::Tech` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:248:51 [INFO] [stdout] | [INFO] [stdout] 248 | .or(self.get_unit_from_name(name).map(|id| Id::Unit(id))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Id::Unit` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:249:54 [INFO] [stdout] | [INFO] [stdout] 249 | .or(self.get_ability_from_name(name).map(|id| Id::Ability(id))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Id::Ability` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:250:54 [INFO] [stdout] | [INFO] [stdout] 250 | .or(self.get_terrain_from_name(name).map(|id| Id::Terrain(id))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Id::Terrain` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:251:52 [INFO] [stdout] | [INFO] [stdout] 251 | .or(self.get_power_from_name(name).map(|id| Id::Power(id))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Id::Power` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:254:22 [INFO] [stdout] | [INFO] [stdout] 254 | .map(|id| Id::Civilization(id))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Id::Civilization` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:259:25 [INFO] [stdout] | [INFO] [stdout] 259 | Some(bp) => &bp, [INFO] [stdout] | ^^^ help: change this to: `bp` [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] --> crates/tage_core/src/blueprints/blueprints.rs:266:25 [INFO] [stdout] | [INFO] [stdout] 266 | Some(bp) => &bp, [INFO] [stdout] | ^^^ help: change this to: `bp` [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] --> crates/tage_core/src/blueprints/blueprints.rs:273:25 [INFO] [stdout] | [INFO] [stdout] 273 | Some(bp) => &bp, [INFO] [stdout] | ^^^ help: change this to: `bp` [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] --> crates/tage_core/src/blueprints/blueprints.rs:280:25 [INFO] [stdout] | [INFO] [stdout] 280 | Some(bp) => &bp, [INFO] [stdout] | ^^^ help: change this to: `bp` [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] --> crates/tage_core/src/blueprints/blueprints.rs:287:25 [INFO] [stdout] | [INFO] [stdout] 287 | Some(bp) => &bp, [INFO] [stdout] | ^^^ help: change this to: `bp` [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] --> crates/tage_core/src/blueprints/blueprints.rs:294:25 [INFO] [stdout] | [INFO] [stdout] 294 | Some(bp) => &bp, [INFO] [stdout] | ^^^ help: change this to: `bp` [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: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:121:24 [INFO] [stdout] | [INFO] [stdout] 121 | .chain(rhs.terrain_movement_cost_override.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 121 - .chain(rhs.terrain_movement_cost_override.into_iter()) [INFO] [stdout] 121 + .chain(rhs.terrain_movement_cost_override) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:177:23 [INFO] [stdout] | [INFO] [stdout] 177 | s += &format!( [INFO] [stdout] | _______________________^ [INFO] [stdout] 178 | | "{} {}\n", [INFO] [stdout] 179 | | stat.view(), [INFO] [stdout] 180 | | format!("{}{}", if val.is_positive() { "+" } else { "" }, val) [INFO] [stdout] 181 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] = note: `#[warn(clippy::format_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:187:23 [INFO] [stdout] | [INFO] [stdout] 187 | s += &format!( [INFO] [stdout] | _______________________^ [INFO] [stdout] 188 | | "{} {}\n", [INFO] [stdout] 189 | | stat.view(), [INFO] [stdout] 190 | | format!("{}{}%", if val.is_positive() { "+" } else { "" }, val) [INFO] [stdout] 191 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:197:23 [INFO] [stdout] | [INFO] [stdout] 197 | s += &format!( [INFO] [stdout] | _______________________^ [INFO] [stdout] 198 | | "Costs {} {}\n", [INFO] [stdout] 199 | | format!("{}{}", if val.is_positive() { "+" } else { "" }, val), [INFO] [stdout] 200 | | res.view(), [INFO] [stdout] 201 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:207:23 [INFO] [stdout] | [INFO] [stdout] 207 | s += &format!( [INFO] [stdout] | _______________________^ [INFO] [stdout] 208 | | "Production {} {}\n", [INFO] [stdout] 209 | | format!("{}{}", if val.is_positive() { "+" } else { "" }, val), [INFO] [stdout] 210 | | res.view(), [INFO] [stdout] 211 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:217:23 [INFO] [stdout] | [INFO] [stdout] 217 | s += &format!( [INFO] [stdout] | _______________________^ [INFO] [stdout] 218 | | "Costs {} {}\n", [INFO] [stdout] 219 | | format!("{}{}%", if val.is_positive() { "+" } else { "" }, val), [INFO] [stdout] 220 | | res.view(), [INFO] [stdout] 221 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:227:23 [INFO] [stdout] | [INFO] [stdout] 227 | s += &format!( [INFO] [stdout] | _______________________^ [INFO] [stdout] 228 | | "Production {} {}\n", [INFO] [stdout] 229 | | format!("{}{}%", if val.is_positive() { "+" } else { "" }, val), [INFO] [stdout] 230 | | res.view(), [INFO] [stdout] 231 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:241:19 [INFO] [stdout] | [INFO] [stdout] 241 | s += &format!("Improved conversion chance\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Improved conversion chance\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:244:19 [INFO] [stdout] | [INFO] [stdout] 244 | s += &format!("Alwaya attacks first\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Alwaya attacks first\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:247:19 [INFO] [stdout] | [INFO] [stdout] 247 | s += &format!("Cannot attack\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Cannot attack\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:250:19 [INFO] [stdout] | [INFO] [stdout] 250 | s += &format!("Cannot attack after moving\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Cannot attack after moving\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:253:19 [INFO] [stdout] | [INFO] [stdout] 253 | s += &format!("Cannot counterattack\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Cannot counterattack\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:256:19 [INFO] [stdout] | [INFO] [stdout] 256 | s += &format!("Double attack\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Double attack\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:288:19 [INFO] [stdout] | [INFO] [stdout] 288 | s += &format!("During a battle:\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"During a battle:\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:314:40 [INFO] [stdout] | [INFO] [stdout] 314 | BattleBonusTarget::This => format!(""), [INFO] [stdout] | ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:315:44 [INFO] [stdout] | [INFO] [stdout] 315 | BattleBonusTarget::Opponent => format!("Affects the opponent\n"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Affects the opponent\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:100:85 [INFO] [stdout] | [INFO] [stdout] 100 | UnitConstraint::Civilization(id) => unit.required_civilization.contains(&id), [INFO] [stdout] | ^^^ help: change this to: `id` [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] --> crates/tage_core/src/blueprints/constraints.rs:102:85 [INFO] [stdout] | [INFO] [stdout] 102 | UnitConstraint::Stat(stat, cmp, val) => cmp.compare(unit.stats.get_stat(&stat), *val), [INFO] [stdout] | ^^^^^ help: change this to: `stat` [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 `.fold` can be written more succinctly using another method [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:105:18 [INFO] [stdout] | [INFO] [stdout] 105 | .fold(false, |acc, c| acc || c.satisfied(bp, unit)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|c| c.satisfied(bp, unit))` [INFO] [stdout] | [INFO] [stdout] = note: the `any` method is short circuiting and may change the program semantics if the iterator has side effects [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:108:18 [INFO] [stdout] | [INFO] [stdout] 108 | .fold(true, |acc, c| acc && c.satisfied(bp, unit)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `all(|c| c.satisfied(bp, unit))` [INFO] [stdout] | [INFO] [stdout] = note: the `all` method is short circuiting and may change the program semantics if the iterator has side effects [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:94:29 [INFO] [stdout] | [INFO] [stdout] 94 | pub fn satisfied(&self, bp: &Blueprints, unit: &UnitBlueprint) -> bool { [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_bp` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:105:58 [INFO] [stdout] | [INFO] [stdout] 105 | .fold(false, |acc, c| acc || c.satisfied(bp, unit)), [INFO] [stdout] | ^^ [INFO] [stdout] ... [INFO] [stdout] 108 | .fold(true, |acc, c| acc && c.satisfied(bp, unit)), [INFO] [stdout] | ^^ [INFO] [stdout] 109 | UnitConstraint::Not(constr) => !constr.satisfied(bp, unit), [INFO] [stdout] | ^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:130:45 [INFO] [stdout] | [INFO] [stdout] 130 | UnitConstraint::NoConstraint => format!("No requirements"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"No requirements".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:132:17 [INFO] [stdout] | [INFO] [stdout] 132 | format!("{}", bp.get_unit(id.unit()).header.name) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `bp.get_unit(id.unit()).header.name.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:135:17 [INFO] [stdout] | [INFO] [stdout] 135 | format!("{}", class.view()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `class.view().to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:147:17 [INFO] [stdout] | [INFO] [stdout] 147 | format!("civilization specific unit") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"civilization specific unit".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:204:52 [INFO] [stdout] | [INFO] [stdout] 204 | BuildConstraint::OnlyOnFoodResource => format!("Must be on a food resource"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Must be on a food resource".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:205:52 [INFO] [stdout] | [INFO] [stdout] 205 | BuildConstraint::OnlyOnGoldResource => format!("Must be on a gold resource"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Must be on a gold resource".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:206:51 [INFO] [stdout] | [INFO] [stdout] 206 | BuildConstraint::NotOnFoodResource => format!("Must not be on a food resource"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Must not be on a food resource".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:207:51 [INFO] [stdout] | [INFO] [stdout] 207 | BuildConstraint::NotOnGoldResource => format!("Must not be on a food resource"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Must not be on a food resource".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference [INFO] [stdout] --> crates/tage_core/src/blueprints/id.rs:266:14 [INFO] [stdout] | [INFO] [stdout] 266 | fn to_id(self, bp: &Blueprints) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference [INFO] [stdout] --> crates/tage_core/src/blueprints/id.rs:276:16 [INFO] [stdout] | [INFO] [stdout] 276 | fn to_name(self, bp: &Blueprints) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:48:39 [INFO] [stdout] | [INFO] [stdout] 48 | top.into_iter().chain(bot.into_iter()).collect() [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 48 - top.into_iter().chain(bot.into_iter()).collect() [INFO] [stdout] 48 + top.into_iter().chain(bot).collect() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:61:31 [INFO] [stdout] | [INFO] [stdout] 61 | .contains(&self) [INFO] [stdout] | ^^^^^ help: change this to: `self` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:65:31 [INFO] [stdout] | [INFO] [stdout] 65 | .contains(&self) [INFO] [stdout] | ^^^^^ help: change this to: `self` [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 `IVec2` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:86:34 [INFO] [stdout] | [INFO] [stdout] 86 | destination: destination.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `destination` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `IVec2` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:241:34 [INFO] [stdout] | [INFO] [stdout] 241 | destination: destination.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `destination` [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: unneeded unit return type [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:273:47 [INFO] [stdout] | [INFO] [stdout] 273 | fn wrap_check_invariants ()>(&self, board: &mut Board, f: F) { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:330:61 [INFO] [stdout] | [INFO] [stdout] 330 | let linked_tile = board.grid.get_at(&pos); [INFO] [stdout] | ^^^^ help: change this to: `pos` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:352:14 [INFO] [stdout] | [INFO] [stdout] 352 | .map(|act_travel| { [INFO] [stdout] | ______________^ [INFO] [stdout] 353 | | act_travel.apply(board); [INFO] [stdout] 354 | | let to = &UnitTarget::new( [INFO] [stdout] 355 | | board [INFO] [stdout] ... | [INFO] [stdout] 374 | | }) [INFO] [stdout] 375 | | .flatten() [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 352 ~ .flat_map(|act_travel| { [INFO] [stdout] 353 + act_travel.apply(board); [INFO] [stdout] 354 + let to = &UnitTarget::new( [INFO] [stdout] 355 + board [INFO] [stdout] 356 + .get_unit(&UnitPos::top(act_travel.destination)) [INFO] [stdout] 357 + .unwrap() [INFO] [stdout] 358 + .clone(), [INFO] [stdout] 359 + act_travel.destination, [INFO] [stdout] 360 + ); [INFO] [stdout] 361 + let p = &act_travel.path; [INFO] [stdout] 362 + let mut acts = vec![]; [INFO] [stdout] 363 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 364 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 365 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 366 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 367 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 368 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 369 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 370 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 371 + acts.extend(Self::gen_unit_moved::(pre, to, board, p)); [INFO] [stdout] 372 + act_travel.undo(board); [INFO] [stdout] 373 + acts [INFO] [stdout] 374 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/power_bp.rs:92:48 [INFO] [stdout] | [INFO] [stdout] 92 | PowerTargetStatus::Friendly => format!(" friendly "), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `" friendly ".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/power_bp.rs:93:45 [INFO] [stdout] | [INFO] [stdout] 93 | PowerTargetStatus::Enemy => format!(" hostile "), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `" hostile ".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/power_bp.rs:94:43 [INFO] [stdout] | [INFO] [stdout] 94 | PowerTargetStatus::Any => format!(" "), [INFO] [stdout] | ^^^^^^^^^^^^ help: consider using `.to_string()`: `" ".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:383:15 [INFO] [stdout] | [INFO] [stdout] 383 | path: &Vec, [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] 383 ~ path: &[IVec2], [INFO] [stdout] 384 | ) -> impl Iterator [INFO] [stdout] ... [INFO] [stdout] 405 | action: act.clone().into(), [INFO] [stdout] 406 ~ path: path.to_owned(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:391:14 [INFO] [stdout] | [INFO] [stdout] 391 | .map(|act| { [INFO] [stdout] | ______________^ [INFO] [stdout] 392 | | act.apply(board); [INFO] [stdout] 393 | | let results: Vec = ActPickup::generate(moved, board) [INFO] [stdout] 394 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 419 | | }) [INFO] [stdout] 420 | | .flatten() [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 391 ~ .flat_map(|act| { [INFO] [stdout] 392 + act.apply(board); [INFO] [stdout] 393 + let results: Vec = ActPickup::generate(moved, board) [INFO] [stdout] 394 + .iter() [INFO] [stdout] 395 + .map(|act_pickup| { [INFO] [stdout] 396 + act_pickup.apply(board); [INFO] [stdout] 397 + let results: Vec = ActDone::generate(moved, board) [INFO] [stdout] 398 + .iter() [INFO] [stdout] 399 + .map(|act_done| { [INFO] [stdout] 400 + act_done.apply(board); [INFO] [stdout] 401 + let result = PlayerAction::Unit { [INFO] [stdout] 402 + target: pre.clone(), [INFO] [stdout] 403 + destination: moved.at.clone(), [INFO] [stdout] 404 + pickup: act_pickup.pickup.clone(), [INFO] [stdout] 405 + action: act.clone().into(), [INFO] [stdout] 406 + path: path.clone(), [INFO] [stdout] 407 + }; [INFO] [stdout] 408 + act_done.undo(board); [INFO] [stdout] 409 + result [INFO] [stdout] 410 + }) [INFO] [stdout] 411 + .collect(); [INFO] [stdout] 412 + act_pickup.undo(board); [INFO] [stdout] 413 + results [INFO] [stdout] 414 + }) [INFO] [stdout] 415 + .flatten() [INFO] [stdout] 416 + .collect(); [INFO] [stdout] 417 + act.undo(board); [INFO] [stdout] 418 + results [INFO] [stdout] 419 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:395:22 [INFO] [stdout] | [INFO] [stdout] 395 | .map(|act_pickup| { [INFO] [stdout] | ______________________^ [INFO] [stdout] 396 | | act_pickup.apply(board); [INFO] [stdout] 397 | | let results: Vec = ActDone::generate(moved, board) [INFO] [stdout] 398 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 414 | | }) [INFO] [stdout] 415 | | .flatten() [INFO] [stdout] | |______________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 395 ~ .flat_map(|act_pickup| { [INFO] [stdout] 396 + act_pickup.apply(board); [INFO] [stdout] 397 + let results: Vec = ActDone::generate(moved, board) [INFO] [stdout] 398 + .iter() [INFO] [stdout] 399 + .map(|act_done| { [INFO] [stdout] 400 + act_done.apply(board); [INFO] [stdout] 401 + let result = PlayerAction::Unit { [INFO] [stdout] 402 + target: pre.clone(), [INFO] [stdout] 403 + destination: moved.at.clone(), [INFO] [stdout] 404 + pickup: act_pickup.pickup.clone(), [INFO] [stdout] 405 + action: act.clone().into(), [INFO] [stdout] 406 + path: path.clone(), [INFO] [stdout] 407 + }; [INFO] [stdout] 408 + act_done.undo(board); [INFO] [stdout] 409 + result [INFO] [stdout] 410 + }) [INFO] [stdout] 411 + .collect(); [INFO] [stdout] 412 + act_pickup.undo(board); [INFO] [stdout] 413 + results [INFO] [stdout] 414 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `IVec2` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:403:50 [INFO] [stdout] | [INFO] [stdout] 403 | ... destination: moved.at.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `moved.at` [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: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:452:20 [INFO] [stdout] | [INFO] [stdout] 452 | .chain(trains.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 452 - .chain(trains.into_iter()) [INFO] [stdout] 452 + .chain(trains) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:453:20 [INFO] [stdout] | [INFO] [stdout] 453 | .chain(ageups.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 453 - .chain(ageups.into_iter()) [INFO] [stdout] 453 + .chain(ageups) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:454:20 [INFO] [stdout] | [INFO] [stdout] 454 | .chain(dones.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 454 - .chain(dones.into_iter()) [INFO] [stdout] 454 + .chain(dones) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:491:42 [INFO] [stdout] | [INFO] [stdout] 491 | UnitAction::Relic => format!("uses relic action"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"uses relic action".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:503:41 [INFO] [stdout] | [INFO] [stdout] 503 | UnitAction::Done => format!("does nothing"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"does nothing".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> crates/tage_core/src/blueprints/resources.rs:23:1 [INFO] [stdout] | [INFO] [stdout] 23 | / impl ToString for Resource { [INFO] [stdout] 24 | | fn to_string(&self) -> String { [INFO] [stdout] 25 | | match self { [INFO] [stdout] 26 | | Resource::Food => "f", [INFO] [stdout] ... | [INFO] [stdout] 31 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] = note: `#[warn(clippy::to_string_trait_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:507:26 [INFO] [stdout] | [INFO] [stdout] 507 | _ => format!(""), [INFO] [stdout] | ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:517:46 [INFO] [stdout] | [INFO] [stdout] 517 | BuildingAction::AgeUp => format!("ages up"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"ages up".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:518:45 [INFO] [stdout] | [INFO] [stdout] 518 | BuildingAction::Done => format!("does nothing"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"does nothing".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/actions/player_action.rs:522:39 [INFO] [stdout] | [INFO] [stdout] 522 | PlayerAction::PassTurn => format!("Pass Turn"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Pass Turn".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> crates/tage_core/src/actions/attack.rs:22:12 [INFO] [stdout] | [INFO] [stdout] 22 | if !bonus.forbid_attack && !(bonus.forbid_attack_after_move && unit.moved) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(bonus.forbid_attack || bonus.forbid_attack_after_move && unit.moved)` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/attack.rs:23:53 [INFO] [stdout] | [INFO] [stdout] 23 | let range = ActAttack::get_range(board, &pre); [INFO] [stdout] | ^^^^ help: change this to: `pre` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/actions/attack.rs:259:14 [INFO] [stdout] | [INFO] [stdout] 259 | .map(|id| bp.get_tech(id).battle_bonuses.iter()) [INFO] [stdout] | ______________^ [INFO] [stdout] 260 | | .flatten(); [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|id| bp.get_tech(id).battle_bonuses.iter())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/actions/attack.rs:264:14 [INFO] [stdout] | [INFO] [stdout] 264 | .map(|ability_id| { [INFO] [stdout] | ______________^ [INFO] [stdout] 265 | | let ability_bp = bp.get_ability(ability_id.ability()); [INFO] [stdout] 266 | | ability_bp.battle_bonuses.iter() [INFO] [stdout] 267 | | }) [INFO] [stdout] 268 | | .flatten(); [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 264 ~ .flat_map(|ability_id| { [INFO] [stdout] 265 + let ability_bp = bp.get_ability(ability_id.ability()); [INFO] [stdout] 266 + ability_bp.battle_bonuses.iter() [INFO] [stdout] 267 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (9/7) [INFO] [stdout] --> crates/tage_core/src/actions/attack.rs:280:5 [INFO] [stdout] | [INFO] [stdout] 280 | / pub fn battle( [INFO] [stdout] 281 | | bp: &Blueprints, [INFO] [stdout] 282 | | atk_unit: &Unit, [INFO] [stdout] 283 | | def_unit: &Unit, [INFO] [stdout] ... | [INFO] [stdout] 289 | | _trace_steps: bool, [INFO] [stdout] 290 | | ) -> BattleOutcome { [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/attack.rs:308:13 [INFO] [stdout] | [INFO] [stdout] 308 | &atk_unit, [INFO] [stdout] | ^^^^^^^^^ help: change this to: `atk_unit` [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: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> crates/tage_core/src/actions/build.rs:20:16 [INFO] [stdout] | [INFO] [stdout] 20 | if let Some(_) = tile.building { [INFO] [stdout] | -------^^^^^^^---------------- help: try: `if tile.building.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/actions/build.rs:28:14 [INFO] [stdout] | [INFO] [stdout] 28 | .map(|id| { [INFO] [stdout] | ______________^ [INFO] [stdout] 29 | | ActBuild::get_build_placements(board.bp(), board, id, pre.at) [INFO] [stdout] 30 | | .map(move |area| (id, area)) [INFO] [stdout] 31 | | }) [INFO] [stdout] 32 | | .flatten() [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 28 ~ .flat_map(|id| { [INFO] [stdout] 29 + ActBuild::get_build_placements(board.bp(), board, id, pre.at) [INFO] [stdout] 30 + .map(move |area| (id, area)) [INFO] [stdout] 31 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/build.rs:85:43 [INFO] [stdout] | [INFO] [stdout] 85 | let player = board.get_player_mut(&owner); [INFO] [stdout] | ^^^^^^ help: change this to: `owner` [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 boolean expression can be simplified [INFO] [stdout] --> crates/tage_core/src/actions/convert.rs:20:12 [INFO] [stdout] | [INFO] [stdout] 20 | if !bonus.forbid_attack && !(bonus.forbid_attack_after_move && unit.moved) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(bonus.forbid_attack || bonus.forbid_attack_after_move && unit.moved)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/convert.rs:68:17 [INFO] [stdout] | [INFO] [stdout] 68 | &this_unit, [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `this_unit` [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] --> crates/tage_core/src/actions/convert.rs:69:17 [INFO] [stdout] | [INFO] [stdout] 69 | &target_unit, [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `target_unit` [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: binary comparison to literal `Option::None` [INFO] [stdout] --> crates/tage_core/src/actions/end_turn.rs:69:38 [INFO] [stdout] | [INFO] [stdout] 69 | ... (t.get_top_unit() == None && terrain_bp.stats.move_cost < 5) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `t.get_top_unit().is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> crates/tage_core/src/actions/end_turn.rs:145:21 [INFO] [stdout] | [INFO] [stdout] 145 | / if building.in_construction { [INFO] [stdout] 146 | | if unit_build_list [INFO] [stdout] 147 | | .contains(&IdName::Id(Id::Unit(building.blueprint_id.clone()))) [INFO] [stdout] ... | [INFO] [stdout] 153 | | } [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] 145 ~ if building.in_construction [INFO] [stdout] 146 ~ && unit_build_list [INFO] [stdout] 147 | .contains(&IdName::Id(Id::Unit(building.blueprint_id.clone()))) [INFO] [stdout] ... [INFO] [stdout] 151 | check_capture = true; [INFO] [stdout] 152 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/tage_core/src/actions/end_turn.rs:205:5 [INFO] [stdout] | [INFO] [stdout] 205 | list.sort_by(|a, b| a.0.cmp(&b.0)); [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] 205 - list.sort_by(|a, b| a.0.cmp(&b.0)); [INFO] [stdout] 205 + list.sort_by_key(|a| a.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> crates/tage_core/src/actions/end_turn.rs:251:13 [INFO] [stdout] | [INFO] [stdout] 251 | / if board.unit_loc(unit) == UnitLocation::Bot { [INFO] [stdout] 252 | | if !ActBuild::is_building_active(board, UnitPos::bot(xy)) { [INFO] [stdout] 253 | | continue; [INFO] [stdout] 254 | | } [INFO] [stdout] 255 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 251 ~ if board.unit_loc(unit) == UnitLocation::Bot [INFO] [stdout] 252 ~ && !ActBuild::is_building_active(board, UnitPos::bot(xy)) { [INFO] [stdout] 253 | continue; [INFO] [stdout] 254 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> crates/tage_core/src/actions/heal.rs:18:17 [INFO] [stdout] | [INFO] [stdout] 18 | / tile.unit.as_ref().and_then(|target_unit| { [INFO] [stdout] 19 | | Some(ActHeal { [INFO] [stdout] 20 | | this: pre.clone(), [INFO] [stdout] 21 | | target: UnitTarget { [INFO] [stdout] ... | [INFO] [stdout] 25 | | }) [INFO] [stdout] 26 | | }) [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] = note: `#[warn(clippy::bind_instead_of_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 18 ~ tile.unit.as_ref().map(|target_unit| ActHeal { [INFO] [stdout] 19 + this: pre.clone(), [INFO] [stdout] 20 + target: UnitTarget { [INFO] [stdout] 21 + unit: target_unit.clone(), [INFO] [stdout] 22 + at: pre.at + **dir, [INFO] [stdout] 23 + }, [INFO] [stdout] 24 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> crates/tage_core/src/actions/merge.rs:22:17 [INFO] [stdout] | [INFO] [stdout] 22 | / tile.unit.as_ref().and_then(|target_unit| { [INFO] [stdout] 23 | | Some(ActMerge { [INFO] [stdout] 24 | | this: UnitTarget::new(unit.clone(), pre.at), [INFO] [stdout] 25 | | target: UnitTarget::new(target_unit.clone(), pre.at + **dir), [INFO] [stdout] 26 | | }) [INFO] [stdout] 27 | | }) [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 22 ~ tile.unit.as_ref().map(|target_unit| ActMerge { [INFO] [stdout] 23 + this: UnitTarget::new(unit.clone(), pre.at), [INFO] [stdout] 24 + target: UnitTarget::new(target_unit.clone(), pre.at + **dir), [INFO] [stdout] 25 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> crates/tage_core/src/actions/merge.rs:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | / board [INFO] [stdout] 41 | | .grid [INFO] [stdout] 42 | | .get_at_mut(&self.this.at) [INFO] [stdout] 43 | | .unit [INFO] [stdout] ... | [INFO] [stdout] 48 | | board.set_unit_at(&board.get_target_pos(&self.target), Some(unit)); [INFO] [stdout] 49 | | }); [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] = note: `#[warn(clippy::option_map_unit_fn)]` on by default [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 40 ~ if let Some(mut unit) = board [INFO] [stdout] 41 + .grid [INFO] [stdout] 42 + .get_at_mut(&self.this.at) [INFO] [stdout] 43 + .unit [INFO] [stdout] 44 + .take() { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> crates/tage_core/src/actions/pickup.rs:21:16 [INFO] [stdout] | [INFO] [stdout] 21 | && self.this.unit.holding_collectable == None [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `self.this.unit.holding_collectable.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> crates/tage_core/src/actions/pickup.rs:25:12 [INFO] [stdout] | [INFO] [stdout] 25 | if self.pickup != None { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: use `Option::is_some()` instead: `self.pickup.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> crates/tage_core/src/actions/pickup.rs:33:25 [INFO] [stdout] | [INFO] [stdout] 33 | / tile.unit [INFO] [stdout] 34 | | .as_mut() [INFO] [stdout] 35 | | .map(|u| u.holding_collectable = Some(collectible)); [INFO] [stdout] | |_______________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 33 ~ if let Some(u) = tile.unit [INFO] [stdout] 34 + .as_mut() { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> crates/tage_core/src/actions/pickup.rs:48:9 [INFO] [stdout] | [INFO] [stdout] 48 | / tile.unit.as_mut().map(|unit| { [INFO] [stdout] 49 | | if let Some(collectible) = unit.holding_collectable.take().or(self.pickup.clone()) { [INFO] [stdout] 50 | | match collectible { [INFO] [stdout] 51 | | Collectable::BonusFood => production.food += 100, [INFO] [stdout] ... | [INFO] [stdout] 57 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 48 - tile.unit.as_mut().map(|unit| { [INFO] [stdout] 49 - if let Some(collectible) = unit.holding_collectable.take().or(self.pickup.clone()) { [INFO] [stdout] 50 - match collectible { [INFO] [stdout] 51 - Collectable::BonusFood => production.food += 100, [INFO] [stdout] 52 - Collectable::BonusGold => production.gold += 100, [INFO] [stdout] 53 - _ => {} [INFO] [stdout] 54 - } [INFO] [stdout] 55 - tile.terrain.collectable = Some(collectible); [INFO] [stdout] 56 - } [INFO] [stdout] 57 - }); [INFO] [stdout] 48 + if let Some(unit) = tile.unit.as_mut() { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> crates/tage_core/src/actions/power.rs:36:9 [INFO] [stdout] | [INFO] [stdout] 36 | / if power.require_on_building != UnitConstraint::NoConstraint { [INFO] [stdout] 37 | | if !board [INFO] [stdout] 38 | | .get_unit(&UnitPos::bot(self.this.at)) [INFO] [stdout] 39 | | .map(|building| { [INFO] [stdout] ... | [INFO] [stdout] 49 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 36 ~ if power.require_on_building != UnitConstraint::NoConstraint [INFO] [stdout] 37 ~ && !board [INFO] [stdout] 38 | .get_unit(&UnitPos::bot(self.this.at)) [INFO] [stdout] ... [INFO] [stdout] 47 | return false; [INFO] [stdout] 48 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/power.rs:43:48 [INFO] [stdout] | [INFO] [stdout] 43 | .satisfied(board.bp(), &building_bp) [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `building_bp` [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: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_core/src/actions/power.rs:54:47 [INFO] [stdout] | [INFO] [stdout] 54 | if power.effects.iter().all(|eff| match eff { [INFO] [stdout] | _______________________________________________^ [INFO] [stdout] 55 | | PowerEffect::Heal(_) => true, [INFO] [stdout] 56 | | _ => false, [INFO] [stdout] 57 | | }) { [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] 54 - if power.effects.iter().all(|eff| match eff { [INFO] [stdout] 55 - PowerEffect::Heal(_) => true, [INFO] [stdout] 56 - _ => false, [INFO] [stdout] 57 - }) { [INFO] [stdout] 54 + if power.effects.iter().all(|eff| matches!(eff, PowerEffect::Heal(_))) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> crates/tage_core/src/actions/power.rs:73:25 [INFO] [stdout] | [INFO] [stdout] 73 | / board [INFO] [stdout] 74 | | .grid [INFO] [stdout] 75 | | .get_at_mut(&target.at) [INFO] [stdout] 76 | | .unit [INFO] [stdout] 77 | | .as_mut() [INFO] [stdout] 78 | | .map(|unit| unit.health = (unit.health + heal).min(100)); [INFO] [stdout] | |____________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 73 ~ if let Some(unit) = board [INFO] [stdout] 74 + .grid [INFO] [stdout] 75 + .get_at_mut(&target.at) [INFO] [stdout] 76 + .unit [INFO] [stdout] 77 + .as_mut() { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/actions/power.rs:143:14 [INFO] [stdout] | [INFO] [stdout] 143 | .map(|location| match location { [INFO] [stdout] | ______________^ [INFO] [stdout] 144 | | PowerTargetLocation::This => vec![*from], [INFO] [stdout] 145 | | PowerTargetLocation::Adjacent => board [INFO] [stdout] 146 | | .grid [INFO] [stdout] ... | [INFO] [stdout] 163 | | }) [INFO] [stdout] 164 | | .flatten() [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 143 ~ .flat_map(|location| match location { [INFO] [stdout] 144 + PowerTargetLocation::This => vec![*from], [INFO] [stdout] 145 + PowerTargetLocation::Adjacent => board [INFO] [stdout] 146 + .grid [INFO] [stdout] 147 + .get_adjacent(from) [INFO] [stdout] 148 + .iter() [INFO] [stdout] 149 + .map(|(dir, _)| **dir + *from) [INFO] [stdout] 150 + .collect(), [INFO] [stdout] 151 + PowerTargetLocation::Diagonal => board [INFO] [stdout] 152 + .grid [INFO] [stdout] 153 + .get_diagonal(from) [INFO] [stdout] 154 + .iter() [INFO] [stdout] 155 + .map(|(dir, _)| **dir + *from) [INFO] [stdout] 156 + .collect(), [INFO] [stdout] 157 + PowerTargetLocation::InSight => { [INFO] [stdout] 158 + board.get_visible_from(&UnitPos::new(*from, UnitLocation::Top)) [INFO] [stdout] 159 + } [INFO] [stdout] 160 + PowerTargetLocation::All => iter_area(board.grid.size) [INFO] [stdout] 161 + .filter_map(|xy| (!board.grid.get_at(&xy).get_units().is_empty()).then(|| xy)) [INFO] [stdout] 162 + .collect(), [INFO] [stdout] 163 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `bool::then` in `filter_map` [INFO] [stdout] --> crates/tage_core/src/actions/power.rs:161:22 [INFO] [stdout] | [INFO] [stdout] 161 | .filter_map(|xy| (!board.grid.get_at(&xy).get_units().is_empty()).then(|| xy)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `filter` then `map` instead: `filter(|&xy| (!board.grid.get_at(&xy).get_units().is_empty())).map(|xy| xy)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#filter_map_bool_then [INFO] [stdout] = note: `#[warn(clippy::filter_map_bool_then)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used with `bool::then` [INFO] [stdout] --> crates/tage_core/src/actions/power.rs:161:38 [INFO] [stdout] | [INFO] [stdout] 161 | .filter_map(|xy| (!board.grid.get_at(&xy).get_units().is_empty()).then(|| xy)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `then_some` instead [INFO] [stdout] | [INFO] [stdout] 161 - .filter_map(|xy| (!board.grid.get_at(&xy).get_units().is_empty()).then(|| xy)) [INFO] [stdout] 161 + .filter_map(|xy| (!board.grid.get_at(&xy).get_units().is_empty()).then_some(xy)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)` [INFO] [stdout] --> crates/tage_core/src/actions/power.rs:166:17 [INFO] [stdout] | [INFO] [stdout] 166 | / board [INFO] [stdout] 167 | | .grid [INFO] [stdout] 168 | | .get_at(&xy) [INFO] [stdout] 169 | | .unit [INFO] [stdout] 170 | | .as_ref() [INFO] [stdout] 171 | | .and_then(|u| Some(UnitTarget::new(u.clone(), xy))) [INFO] [stdout] | |_______________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bind_instead_of_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 166 ~ board [INFO] [stdout] 167 + .grid [INFO] [stdout] 168 + .get_at(&xy) [INFO] [stdout] 169 + .unit [INFO] [stdout] 170 + .as_ref().map(|u| UnitTarget::new(u.clone(), xy)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> crates/tage_core/src/actions/relic.rs:54:17 [INFO] [stdout] | [INFO] [stdout] 54 | / tile.unit [INFO] [stdout] 55 | | .as_mut() [INFO] [stdout] 56 | | .map(|unit| unit.holding_collectable = tile.terrain.collectable.take()); [INFO] [stdout] | |___________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_map_unit_fn [INFO] [stdout] help: use `if let` instead [INFO] [stdout] | [INFO] [stdout] 54 ~ if let Some(unit) = tile.unit [INFO] [stdout] 55 + .as_mut() { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> crates/tage_core/src/actions/relic.rs:77:14 [INFO] [stdout] | [INFO] [stdout] 77 | .map(|b| b.holding_collectable.clone()) [INFO] [stdout] | ______________^ [INFO] [stdout] 78 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|b| b.holding_collectable.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> crates/tage_core/src/actions/relic.rs:96:22 [INFO] [stdout] | [INFO] [stdout] 96 | .map(|unit| unit.holding_collectable.take()) [INFO] [stdout] | ______________________^ [INFO] [stdout] 97 | | .flatten(); [INFO] [stdout] | |______________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|unit| unit.holding_collectable.take())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> crates/tage_core/src/actions/research.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | / board [INFO] [stdout] 13 | | .bp() [INFO] [stdout] 14 | | .techs [INFO] [stdout] 15 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 20 | | .filter(|act| act.is_valid(board)) [INFO] [stdout] 21 | | }) [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 12 ~ board [INFO] [stdout] 13 + .bp() [INFO] [stdout] 14 + .techs.keys().filter_map(|tech_id| { [INFO] [stdout] 15 + Some(ActResearch { [INFO] [stdout] 16 + tech_id: tech_id.clone(), [INFO] [stdout] 17 + }) [INFO] [stdout] 18 + .filter(|act| act.is_valid(board)) [INFO] [stdout] 19 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/research.rs:98:39 [INFO] [stdout] | [INFO] [stdout] 98 | if !board.bp.unit_has_ability(&building_id, "Age Up") { [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `building_id` [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] --> crates/tage_core/src/game.rs:57:27 [INFO] [stdout] | [INFO] [stdout] 57 | self.get_unit_mut(&pos).map(f); [INFO] [stdout] | ^^^^ help: change this to: `pos` [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] --> crates/tage_core/src/game.rs:58:46 [INFO] [stdout] | [INFO] [stdout] 58 | self.sync_linked_units(self.get_unit(&pos).cloned(), pos); [INFO] [stdout] | ^^^^ help: change this to: `pos` [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] --> crates/tage_core/src/game.rs:69:29 [INFO] [stdout] | [INFO] [stdout] 69 | .get_at_mut(&linked) [INFO] [stdout] | ^^^^^^^ help: change this to: `linked` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> crates/tage_core/src/actions/trade.rs:59:9 [INFO] [stdout] | [INFO] [stdout] 58 | let rate = (250 - trade * 25).max(100); [INFO] [stdout] | --------------------------------------- unnecessary `let` binding [INFO] [stdout] 59 | rate [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] 58 ~ [INFO] [stdout] 59 ~ (250 - trade * 25).max(100) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/actions/trade.rs:57:44 [INFO] [stdout] | [INFO] [stdout] 57 | let trade = board.get_player_bonus(&owner, None).trade; [INFO] [stdout] | ^^^^^^ help: change this to: `owner` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/game.rs:122:14 [INFO] [stdout] | [INFO] [stdout] 122 | .map(|tech_id| bp.get_tech(tech_id).unit_bonuses.iter()) [INFO] [stdout] | ______________^ [INFO] [stdout] 123 | | .flatten(); [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|tech_id| bp.get_tech(tech_id).unit_bonuses.iter())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> crates/tage_core/src/actions/train.rs:19:16 [INFO] [stdout] | [INFO] [stdout] 19 | if let Some(_) = tile.unit { [INFO] [stdout] | -------^^^^^^^------------ help: try: `if tile.unit.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> crates/tage_core/src/actions/train.rs:24:52 [INFO] [stdout] | [INFO] [stdout] 24 | let potential_train_list: Vec = if building.train_list_override.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!building.train_list_override.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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/game.rs:219:39 [INFO] [stdout] | [INFO] [stdout] 219 | + self.get_building_bonus(&target) [INFO] [stdout] | ^^^^^^^ help: change this to: `target` [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] --> crates/tage_core/src/actions/train.rs:92:49 [INFO] [stdout] | [INFO] [stdout] 92 | let tech_bonus = board.get_player_bonus(&owner, Some(train_id)); [INFO] [stdout] | ^^^^^^ help: change this to: `owner` [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] --> crates/tage_core/src/actions/train.rs:94:39 [INFO] [stdout] | [INFO] [stdout] 94 | let player = board.get_player(&owner); [INFO] [stdout] | ^^^^^^ help: change this to: `owner` [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] --> crates/tage_core/src/actions/train.rs:102:54 [INFO] [stdout] | [INFO] [stdout] 102 | let building_bp = board.bp.as_ref().get_unit(&building_id); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `building_id` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> crates/tage_core/src/actions/train.rs:149:9 [INFO] [stdout] | [INFO] [stdout] 145 | / let affordable = player.resources.contains(&unit.resources.cost.apply_cost( [INFO] [stdout] 146 | | bonus + power_discount + trained_from_bonus + building_bp.train_cost_bonus.clone(), [INFO] [stdout] 147 | | )); [INFO] [stdout] | |___________- unnecessary `let` binding [INFO] [stdout] 148 | [INFO] [stdout] 149 | affordable [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 | [INFO] [stdout] 147 ~ player.resources.contains(&unit.resources.cost.apply_cost( [INFO] [stdout] 148 + bonus + power_discount + trained_from_bonus + building_bp.train_cost_bonus.clone(), [INFO] [stdout] 149 + )) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> crates/tage_core/src/game.rs:346:22 [INFO] [stdout] | [INFO] [stdout] 346 | pub fn get_units<'a>(&'a self) -> impl Iterator { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 346 - pub fn get_units<'a>(&'a self) -> impl Iterator { [INFO] [stdout] 346 + pub fn get_units(&self) -> impl Iterator { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/game.rs:348:14 [INFO] [stdout] | [INFO] [stdout] 348 | .map(|xy| self.grid.get_at(&xy).get_units()) [INFO] [stdout] | ______________^ [INFO] [stdout] 349 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|xy| self.grid.get_at(&xy).get_units())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> crates/tage_core/src/game.rs:352:26 [INFO] [stdout] | [INFO] [stdout] 352 | pub fn get_units_pos<'a>(&'a self) -> impl Iterator { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 352 - pub fn get_units_pos<'a>(&'a self) -> impl Iterator { [INFO] [stdout] 352 + pub fn get_units_pos(&self) -> impl Iterator { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/game.rs:354:14 [INFO] [stdout] | [INFO] [stdout] 354 | .map(|xy| { [INFO] [stdout] | ______________^ [INFO] [stdout] 355 | | self.grid [INFO] [stdout] 356 | | .get_at(&xy) [INFO] [stdout] 357 | | .get_units() [INFO] [stdout] ... | [INFO] [stdout] 360 | | }) [INFO] [stdout] 361 | | .flatten() [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 354 ~ .flat_map(|xy| { [INFO] [stdout] 355 + self.grid [INFO] [stdout] 356 + .get_at(&xy) [INFO] [stdout] 357 + .get_units() [INFO] [stdout] 358 + .into_iter() [INFO] [stdout] 359 + .map(move |u| (u, xy)) [INFO] [stdout] 360 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> crates/tage_core/src/game.rs:381:31 [INFO] [stdout] | [INFO] [stdout] 381 | pub fn get_units_in_range<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] 382 | &'a self, [INFO] [stdout] | ^^ [INFO] [stdout] ... [INFO] [stdout] 385 | ) -> impl Iterator { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 381 ~ pub fn get_units_in_range( [INFO] [stdout] 382 ~ &self, [INFO] [stdout] 383 | from: IVec2, [INFO] [stdout] 384 | range: i32, [INFO] [stdout] 385 ~ ) -> impl Iterator { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `IVec2` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_core/src/game.rs:395:43 [INFO] [stdout] | [INFO] [stdout] 395 | .map(move |unit| (target.clone(), unit)) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `target` [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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> crates/tage_core/src/game.rs:409:22 [INFO] [stdout] | [INFO] [stdout] 409 | let points = (unit_bp.stats.apply(bonus).sight as i32).max(0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unit_bp.stats.apply(bonus).sight` [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: binary comparison to literal `Option::None` [INFO] [stdout] --> crates/tage_core/src/game.rs:462:16 [INFO] [stdout] | [INFO] [stdout] 462 | if team == None && winners.is_empty() { [INFO] [stdout] | ^^^^^^^^^^^^ help: use `Option::is_none()` instead: `team.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> crates/tage_core/src/game.rs:468:29 [INFO] [stdout] | [INFO] [stdout] 468 | && team != None [INFO] [stdout] | ^^^^^^^^^^^^ help: use `Option::is_some()` instead: `team.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> crates/tage_core/src/game.rs:483:5 [INFO] [stdout] | [INFO] [stdout] 483 | pub fn load(bp: &Blueprints, path: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] = note: `#[warn(clippy::result_unit_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> crates/tage_core/src/actions/travel.rs:103:22 [INFO] [stdout] | [INFO] [stdout] 103 | let points = unit_bp.stats.apply(bonus.clone()).movement as i32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unit_bp.stats.apply(bonus.clone()).movement` [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] --> crates/tage_core/src/game.rs:543:46 [INFO] [stdout] | [INFO] [stdout] 543 | let new_player_fog = new_fog.get(&id).unwrap(); [INFO] [stdout] | ^^^ help: change this to: `id` [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 `IVec2` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_core/src/game.rs:605:34 [INFO] [stdout] | [INFO] [stdout] 605 | destination: destination.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*destination` [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: direct implementation of `ToString` [INFO] [stdout] --> crates/tage_core/src/game.rs:794:1 [INFO] [stdout] | [INFO] [stdout] 794 | / impl ToString for Collectable { [INFO] [stdout] 795 | | fn to_string(&self) -> String { [INFO] [stdout] 796 | | match self { [INFO] [stdout] 797 | | Collectable::BonusFood => "|", [INFO] [stdout] ... | [INFO] [stdout] 804 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> crates/tage_core/src/blueprints/mod.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | pub mod blueprints; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:150:49 [INFO] [stdout] | [INFO] [stdout] 150 | .map(|t| (t.0, t.1.resolve(res, &self))) [INFO] [stdout] | ^^^^^ help: change this to: `self` [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] --> crates/tage_core/src/blueprints/blueprints.rs:156:49 [INFO] [stdout] | [INFO] [stdout] 156 | .map(|t| (t.0, t.1.resolve(res, &self))) [INFO] [stdout] | ^^^^^ help: change this to: `self` [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] --> crates/tage_core/src/blueprints/blueprints.rs:162:49 [INFO] [stdout] | [INFO] [stdout] 162 | .map(|t| (t.0, t.1.resolve(res, &self))) [INFO] [stdout] | ^^^^^ help: change this to: `self` [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] --> crates/tage_core/src/blueprints/blueprints.rs:168:49 [INFO] [stdout] | [INFO] [stdout] 168 | .map(|t| (t.0, t.1.resolve(res, &self))) [INFO] [stdout] | ^^^^^ help: change this to: `self` [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] --> crates/tage_core/src/blueprints/blueprints.rs:174:41 [INFO] [stdout] | [INFO] [stdout] 174 | .map(|b| b.resolve(res, &self)) [INFO] [stdout] | ^^^^^ help: change this to: `self` [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] --> crates/tage_core/src/blueprints/blueprints.rs:180:49 [INFO] [stdout] | [INFO] [stdout] 180 | .map(|t| (t.0, t.1.resolve(res, &self))) [INFO] [stdout] | ^^^^^ help: change this to: `self` [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: iterating on a map's values [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:186:13 [INFO] [stdout] | [INFO] [stdout] 186 | bp.terrain.iter().map(|(_, u)| u.clone().into()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.terrain.values().map(|u| u.clone().into())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `blueprints::terrain_bp::TerrainBlueprint` [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:186:44 [INFO] [stdout] | [INFO] [stdout] 186 | bp.terrain.iter().map(|(_, u)| u.clone().into()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `u.clone()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:187:9 [INFO] [stdout] | [INFO] [stdout] 187 | terrains.sort_by(|a, b| a.header.id.0.cmp(&b.header.id.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 187 - terrains.sort_by(|a, b| a.header.id.0.cmp(&b.header.id.0)); [INFO] [stdout] 187 + terrains.sort_by_key(|a| a.header.id.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:195:45 [INFO] [stdout] | [INFO] [stdout] 195 | let mut units: Vec = bp.units.iter().map(|(_, t)| t.clone()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.units.values().map(|t| t.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:196:9 [INFO] [stdout] | [INFO] [stdout] 196 | units.sort_by(|a, b| a.header.id.0.cmp(&b.header.id.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 196 - units.sort_by(|a, b| a.header.id.0.cmp(&b.header.id.0)); [INFO] [stdout] 196 + units.sort_by_key(|a| a.header.id.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:200:45 [INFO] [stdout] | [INFO] [stdout] 200 | let mut techs: Vec = bp.techs.iter().map(|(_, t)| t.clone()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.techs.values().map(|t| t.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:201:9 [INFO] [stdout] | [INFO] [stdout] 201 | techs.sort_by(|a, b| a.id.0.cmp(&b.id.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 201 - techs.sort_by(|a, b| a.id.0.cmp(&b.id.0)); [INFO] [stdout] 201 + techs.sort_by_key(|a| a.id.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:209:13 [INFO] [stdout] | [INFO] [stdout] 209 | bp.abilities.iter().map(|(_, t)| t.clone()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.abilities.values().map(|t| t.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:210:9 [INFO] [stdout] | [INFO] [stdout] 210 | abilities.sort_by(|a, b| a.id.0.cmp(&b.id.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 210 - abilities.sort_by(|a, b| a.id.0.cmp(&b.id.0)); [INFO] [stdout] 210 + abilities.sort_by_key(|a| a.id.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:227:47 [INFO] [stdout] | [INFO] [stdout] 227 | let mut powers: Vec = bp.powers.iter().map(|(_, t)| t.clone()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.powers.values().map(|t| t.clone())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:228:9 [INFO] [stdout] | [INFO] [stdout] 228 | powers.sort_by(|a, b| a.id.0.cmp(&b.id.0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 228 - powers.sort_by(|a, b| a.id.0.cmp(&b.id.0)); [INFO] [stdout] 228 + powers.sort_by_key(|a| a.id.0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:234:16 [INFO] [stdout] | [INFO] [stdout] 234 | pub fn get<'a>(&'a self, gen_id: &Id) -> Blueprint { [INFO] [stdout] | ^^ ^^ ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 234 - pub fn get<'a>(&'a self, gen_id: &Id) -> Blueprint { [INFO] [stdout] 234 + pub fn get(&self, gen_id: &Id) -> Blueprint { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:245:39 [INFO] [stdout] | [INFO] [stdout] 245 | pub fn get_from_name(&self, name: &String) -> Option { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 245 - pub fn get_from_name(&self, name: &String) -> Option { [INFO] [stdout] 245 + pub fn get_from_name(&self, name: &str) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:247:18 [INFO] [stdout] | [INFO] [stdout] 247 | .map(|id| Id::Tech(id)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Id::Tech` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:248:51 [INFO] [stdout] | [INFO] [stdout] 248 | .or(self.get_unit_from_name(name).map(|id| Id::Unit(id))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Id::Unit` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:249:54 [INFO] [stdout] | [INFO] [stdout] 249 | .or(self.get_ability_from_name(name).map(|id| Id::Ability(id))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Id::Ability` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:250:54 [INFO] [stdout] | [INFO] [stdout] 250 | .or(self.get_terrain_from_name(name).map(|id| Id::Terrain(id))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Id::Terrain` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:251:52 [INFO] [stdout] | [INFO] [stdout] 251 | .or(self.get_power_from_name(name).map(|id| Id::Power(id))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Id::Power` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:254:22 [INFO] [stdout] | [INFO] [stdout] 254 | .map(|id| Id::Civilization(id))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Id::Civilization` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:259:25 [INFO] [stdout] | [INFO] [stdout] 259 | Some(bp) => &bp, [INFO] [stdout] | ^^^ help: change this to: `bp` [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] --> crates/tage_core/src/blueprints/blueprints.rs:266:25 [INFO] [stdout] | [INFO] [stdout] 266 | Some(bp) => &bp, [INFO] [stdout] | ^^^ help: change this to: `bp` [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] --> crates/tage_core/src/blueprints/blueprints.rs:273:25 [INFO] [stdout] | [INFO] [stdout] 273 | Some(bp) => &bp, [INFO] [stdout] | ^^^ help: change this to: `bp` [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] --> crates/tage_core/src/blueprints/blueprints.rs:280:25 [INFO] [stdout] | [INFO] [stdout] 280 | Some(bp) => &bp, [INFO] [stdout] | ^^^ help: change this to: `bp` [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] --> crates/tage_core/src/blueprints/blueprints.rs:287:25 [INFO] [stdout] | [INFO] [stdout] 287 | Some(bp) => &bp, [INFO] [stdout] | ^^^ help: change this to: `bp` [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] --> crates/tage_core/src/blueprints/blueprints.rs:294:25 [INFO] [stdout] | [INFO] [stdout] 294 | Some(bp) => &bp, [INFO] [stdout] | ^^^ help: change this to: `bp` [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: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> crates/tage_core/src/game.rs:998:46 [INFO] [stdout] | [INFO] [stdout] 998 | let (resource, has_road) = match tile.chars().nth(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `tile.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 16 [INFO] [stdout] --> crates/tage_core/src/game.rs:1009:31 [INFO] [stdout] | [INFO] [stdout] 1009 | Some(char) if char.is_digit(16) => (None, char.to_digit(16)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `char.is_ascii_hexdigit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] = note: `#[warn(clippy::is_digit_ascii_radix)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_core/src/game.rs:1034:50 [INFO] [stdout] | [INFO] [stdout] 1034 | spawn_point: spawn_point_num.map(|num| PlayerId::new(num)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `PlayerId::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/game.rs:1043:17 [INFO] [stdout] | [INFO] [stdout] 1043 | let mut s = format!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider using `.to_string()`: `"\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/game.rs:1047:28 [INFO] [stdout] | [INFO] [stdout] 1047 | let mut tile_str = format!("{}", terrain_bp.header.glyph); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `terrain_bp.header.glyph.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/game.rs:1143:17 [INFO] [stdout] | [INFO] [stdout] 1143 | let mut s = format!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider using `.to_string()`: `"\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/grid.rs:91:10 [INFO] [stdout] | [INFO] [stdout] 91 | .map(move |y| (0..size.x).map(move |x| IVec2::new(x, y))) [INFO] [stdout] | __________^ [INFO] [stdout] 92 | | .flatten() [INFO] [stdout] | |__________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(move |y| (0..size.x).map(move |x| IVec2::new(x, y)))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> crates/tage_core/src/machine/distance_travel_map.rs:86:20 [INFO] [stdout] | [INFO] [stdout] 86 | if let Some(_) = &tile.terrain.resource { [INFO] [stdout] | -------^^^^^^^------------------------- help: try: `if tile.terrain.resource.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> crates/tage_core/src/machine/distance_travel_map.rs:150:8 [INFO] [stdout] | [INFO] [stdout] 150 | if sources.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `sources.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: importing legacy numeric constants [INFO] [stdout] --> crates/tage_core/src/machine/distance_travel_map.rs:179:37 [INFO] [stdout] | [INFO] [stdout] 179 | use std::{collections::HashMap, i32}; [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = help: remove this import [INFO] [stdout] = note: then `i32::` will resolve to the respective associated constant [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> crates/tage_core/src/machine/distance_travel_map.rs:183:56 [INFO] [stdout] | [INFO] [stdout] 183 | fn generate_uniform_expected(size: IVec2, sources: &Vec) -> Grid { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 183 - fn generate_uniform_expected(size: IVec2, sources: &Vec) -> Grid { [INFO] [stdout] 183 + fn generate_uniform_expected(size: IVec2, sources: &[IVec2]) -> Grid { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/machine/distance_travel_map.rs:205:25 [INFO] [stdout] | [INFO] [stdout] 205 | grid.set_at(&xy, 0); [INFO] [stdout] | ^^^ help: change this to: `xy` [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] --> crates/tage_core/src/machine/distance_travel_map.rs:240:25 [INFO] [stdout] | [INFO] [stdout] 240 | grid.set_at(&xy, 0); [INFO] [stdout] | ^^^ help: change this to: `xy` [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] --> crates/tage_core/src/machine/distance_travel_map.rs:271:25 [INFO] [stdout] | [INFO] [stdout] 271 | grid.set_at(&xy, 0); [INFO] [stdout] | ^^^ help: change this to: `xy` [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: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:121:24 [INFO] [stdout] | [INFO] [stdout] 121 | .chain(rhs.terrain_movement_cost_override.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:510:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 121 - .chain(rhs.terrain_movement_cost_override.into_iter()) [INFO] [stdout] 121 + .chain(rhs.terrain_movement_cost_override) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:177:23 [INFO] [stdout] | [INFO] [stdout] 177 | s += &format!( [INFO] [stdout] | _______________________^ [INFO] [stdout] 178 | | "{} {}\n", [INFO] [stdout] 179 | | stat.view(), [INFO] [stdout] 180 | | format!("{}{}", if val.is_positive() { "+" } else { "" }, val) [INFO] [stdout] 181 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] = note: `#[warn(clippy::format_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:187:23 [INFO] [stdout] | [INFO] [stdout] 187 | s += &format!( [INFO] [stdout] | _______________________^ [INFO] [stdout] 188 | | "{} {}\n", [INFO] [stdout] 189 | | stat.view(), [INFO] [stdout] 190 | | format!("{}{}%", if val.is_positive() { "+" } else { "" }, val) [INFO] [stdout] 191 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:197:23 [INFO] [stdout] | [INFO] [stdout] 197 | s += &format!( [INFO] [stdout] | _______________________^ [INFO] [stdout] 198 | | "Costs {} {}\n", [INFO] [stdout] 199 | | format!("{}{}", if val.is_positive() { "+" } else { "" }, val), [INFO] [stdout] 200 | | res.view(), [INFO] [stdout] 201 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:207:23 [INFO] [stdout] | [INFO] [stdout] 207 | s += &format!( [INFO] [stdout] | _______________________^ [INFO] [stdout] 208 | | "Production {} {}\n", [INFO] [stdout] 209 | | format!("{}{}", if val.is_positive() { "+" } else { "" }, val), [INFO] [stdout] 210 | | res.view(), [INFO] [stdout] 211 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:217:23 [INFO] [stdout] | [INFO] [stdout] 217 | s += &format!( [INFO] [stdout] | _______________________^ [INFO] [stdout] 218 | | "Costs {} {}\n", [INFO] [stdout] 219 | | format!("{}{}%", if val.is_positive() { "+" } else { "" }, val), [INFO] [stdout] 220 | | res.view(), [INFO] [stdout] 221 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `format!` in `format!` args [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:227:23 [INFO] [stdout] | [INFO] [stdout] 227 | s += &format!( [INFO] [stdout] | _______________________^ [INFO] [stdout] 228 | | "Production {} {}\n", [INFO] [stdout] 229 | | format!("{}{}%", if val.is_positive() { "+" } else { "" }, val), [INFO] [stdout] 230 | | res.view(), [INFO] [stdout] 231 | | ); [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: combine the `format!(..)` arguments with the outer `format!(..)` call [INFO] [stdout] = help: or consider changing `format!` to `format_args!` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#format_in_format_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:241:19 [INFO] [stdout] | [INFO] [stdout] 241 | s += &format!("Improved conversion chance\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Improved conversion chance\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:244:19 [INFO] [stdout] | [INFO] [stdout] 244 | s += &format!("Alwaya attacks first\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Alwaya attacks first\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:247:19 [INFO] [stdout] | [INFO] [stdout] 247 | s += &format!("Cannot attack\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Cannot attack\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:250:19 [INFO] [stdout] | [INFO] [stdout] 250 | s += &format!("Cannot attack after moving\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Cannot attack after moving\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:253:19 [INFO] [stdout] | [INFO] [stdout] 253 | s += &format!("Cannot counterattack\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Cannot counterattack\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:256:19 [INFO] [stdout] | [INFO] [stdout] 256 | s += &format!("Double attack\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Double attack\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_core/src/machine/eval.rs:30:25 [INFO] [stdout] | [INFO] [stdout] 30 | scores.push(map.get(player_id).unwrap().clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*map.get(player_id).unwrap()` [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: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:288:19 [INFO] [stdout] | [INFO] [stdout] 288 | s += &format!("During a battle:\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"During a battle:\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:314:40 [INFO] [stdout] | [INFO] [stdout] 314 | BattleBonusTarget::This => format!(""), [INFO] [stdout] | ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/bonus.rs:315:44 [INFO] [stdout] | [INFO] [stdout] 315 | BattleBonusTarget::Opponent => format!("Affects the opponent\n"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Affects the opponent\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/machine/heuristics.rs:103:38 [INFO] [stdout] | [INFO] [stdout] 103 | unit_value_table.get(&id) + (produces.food + produces.gold) * 2 [INFO] [stdout] | ^^^ help: change this to: `id` [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] --> crates/tage_core/src/machine/heuristics.rs:108:30 [INFO] [stdout] | [INFO] [stdout] 108 | (res.get_res(&resource) - res.get_res(&resource.other())) / 100 - 40 [INFO] [stdout] | ^^^^^^^^^ help: change this to: `resource` [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 `impl` can be derived [INFO] [stdout] --> crates/tage_core/src/machine/boulder.rs:31:1 [INFO] [stdout] | [INFO] [stdout] 31 | / impl Default for Boulder { [INFO] [stdout] 32 | | fn default() -> Self { [INFO] [stdout] 33 | | Boulder { variance: 0 } [INFO] [stdout] 34 | | } [INFO] [stdout] 35 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 27 + #[derive(Default)] [INFO] [stdout] 28 | pub struct Boulder { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/machine/boulder.rs:101:41 [INFO] [stdout] | [INFO] [stdout] 101 | ... &destination, [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `destination` [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 `if` has identical blocks [INFO] [stdout] --> crates/tage_core/src/machine/boulder.rs:118:81 [INFO] [stdout] | [INFO] [stdout] 118 | ... let cost_penalty = if after.food < saving_goal.food { [INFO] [stdout] | ___________________________________________________________________________^ [INFO] [stdout] 119 | | ... -100 [INFO] [stdout] 120 | | ... } else if after.gold < saving_goal.gold { [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> crates/tage_core/src/machine/boulder.rs:120:69 [INFO] [stdout] | [INFO] [stdout] 120 | ... } else if after.gold < saving_goal.gold { [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 121 | | ... -100 [INFO] [stdout] 122 | | ... } else { [INFO] [stdout] | |_______________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> crates/tage_core/src/machine/boulder.rs:267:46 [INFO] [stdout] | [INFO] [stdout] 267 | PlayerAction::Unit { action, .. } => match action { [INFO] [stdout] | ______________________________________________^ [INFO] [stdout] 268 | | UnitAction::Build(_, _) => true, [INFO] [stdout] 269 | | _ => false, [INFO] [stdout] 270 | | }, [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> crates/tage_core/src/machine/boulder.rs:267:30 [INFO] [stdout] | [INFO] [stdout] 267 | PlayerAction::Unit { action, .. } => match action { [INFO] [stdout] | ^^^^^^ replace this binding [INFO] [stdout] 268 | UnitAction::Build(_, _) => true, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `action: ` [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] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_core/src/machine/boulder.rs:267:46 [INFO] [stdout] | [INFO] [stdout] 267 | PlayerAction::Unit { action, .. } => match action { [INFO] [stdout] | ______________________________________________^ [INFO] [stdout] 268 | | UnitAction::Build(_, _) => true, [INFO] [stdout] 269 | | _ => false, [INFO] [stdout] 270 | | }, [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] 267 - PlayerAction::Unit { action, .. } => match action { [INFO] [stdout] 268 - UnitAction::Build(_, _) => true, [INFO] [stdout] 269 - _ => false, [INFO] [stdout] 270 - }, [INFO] [stdout] 267 + PlayerAction::Unit { action, .. } => matches!(action, UnitAction::Build(_, _)), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_core/src/machine/boulder.rs:271:50 [INFO] [stdout] | [INFO] [stdout] 271 | PlayerAction::Building { action, .. } => match action { [INFO] [stdout] | __________________________________________________^ [INFO] [stdout] 272 | | BuildingAction::Train(_) => true, [INFO] [stdout] 273 | | BuildingAction::Trade(_) => true, [INFO] [stdout] 274 | | _ => false, [INFO] [stdout] 275 | | }, [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] 271 - PlayerAction::Building { action, .. } => match action { [INFO] [stdout] 272 - BuildingAction::Train(_) => true, [INFO] [stdout] 273 - BuildingAction::Trade(_) => true, [INFO] [stdout] 274 - _ => false, [INFO] [stdout] 275 - }, [INFO] [stdout] 271 + PlayerAction::Building { action, .. } => matches!(action, BuildingAction::Train(_) | BuildingAction::Trade(_)), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:100:85 [INFO] [stdout] | [INFO] [stdout] 100 | UnitConstraint::Civilization(id) => unit.required_civilization.contains(&id), [INFO] [stdout] | ^^^ help: change this to: `id` [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] --> crates/tage_core/src/blueprints/constraints.rs:102:85 [INFO] [stdout] | [INFO] [stdout] 102 | UnitConstraint::Stat(stat, cmp, val) => cmp.compare(unit.stats.get_stat(&stat), *val), [INFO] [stdout] | ^^^^^ help: change this to: `stat` [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 `.fold` can be written more succinctly using another method [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:105:18 [INFO] [stdout] | [INFO] [stdout] 105 | .fold(false, |acc, c| acc || c.satisfied(bp, unit)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `any(|c| c.satisfied(bp, unit))` [INFO] [stdout] | [INFO] [stdout] = note: the `any` method is short circuiting and may change the program semantics if the iterator has side effects [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fold)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `.fold` can be written more succinctly using another method [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:108:18 [INFO] [stdout] | [INFO] [stdout] 108 | .fold(true, |acc, c| acc && c.satisfied(bp, unit)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `all(|c| c.satisfied(bp, unit))` [INFO] [stdout] | [INFO] [stdout] = note: the `all` method is short circuiting and may change the program semantics if the iterator has side effects [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fold [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: parameter is only used in recursion [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:94:29 [INFO] [stdout] | [INFO] [stdout] 94 | pub fn satisfied(&self, bp: &Blueprints, unit: &UnitBlueprint) -> bool { [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_bp` [INFO] [stdout] | [INFO] [stdout] note: parameter used here [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:105:58 [INFO] [stdout] | [INFO] [stdout] 105 | .fold(false, |acc, c| acc || c.satisfied(bp, unit)), [INFO] [stdout] | ^^ [INFO] [stdout] ... [INFO] [stdout] 108 | .fold(true, |acc, c| acc && c.satisfied(bp, unit)), [INFO] [stdout] | ^^ [INFO] [stdout] 109 | UnitConstraint::Not(constr) => !constr.satisfied(bp, unit), [INFO] [stdout] | ^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#only_used_in_recursion [INFO] [stdout] = note: `#[warn(clippy::only_used_in_recursion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:130:45 [INFO] [stdout] | [INFO] [stdout] 130 | UnitConstraint::NoConstraint => format!("No requirements"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"No requirements".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:132:17 [INFO] [stdout] | [INFO] [stdout] 132 | format!("{}", bp.get_unit(id.unit()).header.name) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `bp.get_unit(id.unit()).header.name.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:135:17 [INFO] [stdout] | [INFO] [stdout] 135 | format!("{}", class.view()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `class.view().to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:147:17 [INFO] [stdout] | [INFO] [stdout] 147 | format!("civilization specific unit") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"civilization specific unit".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:204:52 [INFO] [stdout] | [INFO] [stdout] 204 | BuildConstraint::OnlyOnFoodResource => format!("Must be on a food resource"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Must be on a food resource".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:205:52 [INFO] [stdout] | [INFO] [stdout] 205 | BuildConstraint::OnlyOnGoldResource => format!("Must be on a gold resource"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Must be on a gold resource".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:206:51 [INFO] [stdout] | [INFO] [stdout] 206 | BuildConstraint::NotOnFoodResource => format!("Must not be on a food resource"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Must not be on a food resource".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/constraints.rs:207:51 [INFO] [stdout] | [INFO] [stdout] 207 | BuildConstraint::NotOnGoldResource => format!("Must not be on a food resource"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Must not be on a food resource".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference [INFO] [stdout] --> crates/tage_core/src/blueprints/id.rs:266:14 [INFO] [stdout] | [INFO] [stdout] 266 | fn to_id(self, bp: &Blueprints) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is not `Copy`) usually take `self` by reference [INFO] [stdout] --> crates/tage_core/src/blueprints/id.rs:276:16 [INFO] [stdout] | [INFO] [stdout] 276 | fn to_name(self, bp: &Blueprints) -> Self { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/power_bp.rs:92:48 [INFO] [stdout] | [INFO] [stdout] 92 | PowerTargetStatus::Friendly => format!(" friendly "), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `" friendly ".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/power_bp.rs:93:45 [INFO] [stdout] | [INFO] [stdout] 93 | PowerTargetStatus::Enemy => format!(" hostile "), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `" hostile ".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/blueprints/power_bp.rs:94:43 [INFO] [stdout] | [INFO] [stdout] 94 | PowerTargetStatus::Any => format!(" "), [INFO] [stdout] | ^^^^^^^^^^^^ help: consider using `.to_string()`: `" ".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> crates/tage_core/src/blueprints/resources.rs:23:1 [INFO] [stdout] | [INFO] [stdout] 23 | / impl ToString for Resource { [INFO] [stdout] 24 | | fn to_string(&self) -> String { [INFO] [stdout] 25 | | match self { [INFO] [stdout] 26 | | Resource::Food => "f", [INFO] [stdout] ... | [INFO] [stdout] 31 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] = note: `#[warn(clippy::to_string_trait_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `UnitLocation` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_core/src/unit.rs:157:18 [INFO] [stdout] | [INFO] [stdout] 157 | loc: self.loc.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.loc` [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: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/lib.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | format!("assets") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"assets".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:234:46 [INFO] [stdout] | [INFO] [stdout] 234 | pub fn get<'a>(&'a self, gen_id: &Id) -> Blueprint { [INFO] [stdout] | -- ^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is named here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: consistently use `'a` [INFO] [stdout] | [INFO] [stdout] 234 | pub fn get<'a>(&'a self, gen_id: &Id) -> Blueprint<'a> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/game.rs:57:27 [INFO] [stdout] | [INFO] [stdout] 57 | self.get_unit_mut(&pos).map(f); [INFO] [stdout] | ^^^^ help: change this to: `pos` [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] --> crates/tage_core/src/game.rs:58:46 [INFO] [stdout] | [INFO] [stdout] 58 | self.sync_linked_units(self.get_unit(&pos).cloned(), pos); [INFO] [stdout] | ^^^^ help: change this to: `pos` [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] --> crates/tage_core/src/game.rs:69:29 [INFO] [stdout] | [INFO] [stdout] 69 | .get_at_mut(&linked) [INFO] [stdout] | ^^^^^^^ help: change this to: `linked` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/game.rs:122:14 [INFO] [stdout] | [INFO] [stdout] 122 | .map(|tech_id| bp.get_tech(tech_id).unit_bonuses.iter()) [INFO] [stdout] | ______________^ [INFO] [stdout] 123 | | .flatten(); [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|tech_id| bp.get_tech(tech_id).unit_bonuses.iter())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/game.rs:219:39 [INFO] [stdout] | [INFO] [stdout] 219 | + self.get_building_bonus(&target) [INFO] [stdout] | ^^^^^^^ help: change this to: `target` [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: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> crates/tage_core/src/game.rs:346:22 [INFO] [stdout] | [INFO] [stdout] 346 | pub fn get_units<'a>(&'a self) -> impl Iterator { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 346 - pub fn get_units<'a>(&'a self) -> impl Iterator { [INFO] [stdout] 346 + pub fn get_units(&self) -> impl Iterator { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/game.rs:348:14 [INFO] [stdout] | [INFO] [stdout] 348 | .map(|xy| self.grid.get_at(&xy).get_units()) [INFO] [stdout] | ______________^ [INFO] [stdout] 349 | | .flatten() [INFO] [stdout] | |______________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(|xy| self.grid.get_at(&xy).get_units())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> crates/tage_core/src/game.rs:352:26 [INFO] [stdout] | [INFO] [stdout] 352 | pub fn get_units_pos<'a>(&'a self) -> impl Iterator { [INFO] [stdout] | ^^ ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 352 - pub fn get_units_pos<'a>(&'a self) -> impl Iterator { [INFO] [stdout] 352 + pub fn get_units_pos(&self) -> impl Iterator { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/game.rs:354:14 [INFO] [stdout] | [INFO] [stdout] 354 | .map(|xy| { [INFO] [stdout] | ______________^ [INFO] [stdout] 355 | | self.grid [INFO] [stdout] 356 | | .get_at(&xy) [INFO] [stdout] 357 | | .get_units() [INFO] [stdout] ... | [INFO] [stdout] 360 | | }) [INFO] [stdout] 361 | | .flatten() [INFO] [stdout] | |______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `flat_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 354 ~ .flat_map(|xy| { [INFO] [stdout] 355 + self.grid [INFO] [stdout] 356 + .get_at(&xy) [INFO] [stdout] 357 + .get_units() [INFO] [stdout] 358 + .into_iter() [INFO] [stdout] 359 + .map(move |u| (u, xy)) [INFO] [stdout] 360 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> crates/tage_core/src/game.rs:381:31 [INFO] [stdout] | [INFO] [stdout] 381 | pub fn get_units_in_range<'a>( [INFO] [stdout] | ^^ [INFO] [stdout] 382 | &'a self, [INFO] [stdout] | ^^ [INFO] [stdout] ... [INFO] [stdout] 385 | ) -> impl Iterator { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 381 ~ pub fn get_units_in_range( [INFO] [stdout] 382 ~ &self, [INFO] [stdout] 383 | from: IVec2, [INFO] [stdout] 384 | range: i32, [INFO] [stdout] 385 ~ ) -> impl Iterator { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `IVec2` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_core/src/game.rs:395:43 [INFO] [stdout] | [INFO] [stdout] 395 | .map(move |unit| (target.clone(), unit)) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try removing the `clone` call: `target` [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: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> crates/tage_core/src/game.rs:409:22 [INFO] [stdout] | [INFO] [stdout] 409 | let points = (unit_bp.stats.apply(bonus).sight as i32).max(0); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unit_bp.stats.apply(bonus).sight` [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: binary comparison to literal `Option::None` [INFO] [stdout] --> crates/tage_core/src/game.rs:462:16 [INFO] [stdout] | [INFO] [stdout] 462 | if team == None && winners.is_empty() { [INFO] [stdout] | ^^^^^^^^^^^^ help: use `Option::is_none()` instead: `team.is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> crates/tage_core/src/game.rs:468:29 [INFO] [stdout] | [INFO] [stdout] 468 | && team != None [INFO] [stdout] | ^^^^^^^^^^^^ help: use `Option::is_some()` instead: `team.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> crates/tage_core/src/game.rs:483:5 [INFO] [stdout] | [INFO] [stdout] 483 | pub fn load(bp: &Blueprints, path: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] = note: `#[warn(clippy::result_unit_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/game.rs:543:46 [INFO] [stdout] | [INFO] [stdout] 543 | let new_player_fog = new_fog.get(&id).unwrap(); [INFO] [stdout] | ^^^ help: change this to: `id` [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 `IVec2` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_core/src/game.rs:605:34 [INFO] [stdout] | [INFO] [stdout] 605 | destination: destination.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*destination` [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: direct implementation of `ToString` [INFO] [stdout] --> crates/tage_core/src/game.rs:794:1 [INFO] [stdout] | [INFO] [stdout] 794 | / impl ToString for Collectable { [INFO] [stdout] 795 | | fn to_string(&self) -> String { [INFO] [stdout] 796 | | match self { [INFO] [stdout] 797 | | Collectable::BonusFood => "|", [INFO] [stdout] ... | [INFO] [stdout] 804 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> crates/tage_core/src/game.rs:998:46 [INFO] [stdout] | [INFO] [stdout] 998 | let (resource, has_road) = match tile.chars().nth(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `tile.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 16 [INFO] [stdout] --> crates/tage_core/src/game.rs:1009:31 [INFO] [stdout] | [INFO] [stdout] 1009 | Some(char) if char.is_digit(16) => (None, char.to_digit(16)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `char.is_ascii_hexdigit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] = note: `#[warn(clippy::is_digit_ascii_radix)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_core/src/game.rs:1034:50 [INFO] [stdout] | [INFO] [stdout] 1034 | spawn_point: spawn_point_num.map(|num| PlayerId::new(num)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `PlayerId::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/game.rs:1043:17 [INFO] [stdout] | [INFO] [stdout] 1043 | let mut s = format!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider using `.to_string()`: `"\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/game.rs:1047:28 [INFO] [stdout] | [INFO] [stdout] 1047 | let mut tile_str = format!("{}", terrain_bp.header.glyph); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `terrain_bp.header.glyph.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/game.rs:1143:17 [INFO] [stdout] | [INFO] [stdout] 1143 | let mut s = format!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider using `.to_string()`: `"\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> crates/tage_core/src/grid.rs:91:10 [INFO] [stdout] | [INFO] [stdout] 91 | .map(move |y| (0..size.x).map(move |x| IVec2::new(x, y))) [INFO] [stdout] | __________^ [INFO] [stdout] 92 | | .flatten() [INFO] [stdout] | |__________________^ help: try replacing `map` with `flat_map` and remove the `.flatten()`: `flat_map(move |y| (0..size.x).map(move |x| IVec2::new(x, y)))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> crates/tage_core/src/machine/distance_travel_map.rs:86:20 [INFO] [stdout] | [INFO] [stdout] 86 | if let Some(_) = &tile.terrain.resource { [INFO] [stdout] | -------^^^^^^^------------------------- help: try: `if tile.terrain.resource.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> crates/tage_core/src/machine/distance_travel_map.rs:150:8 [INFO] [stdout] | [INFO] [stdout] 150 | if sources.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `sources.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: using `clone` on type `i32` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_core/src/machine/eval.rs:30:25 [INFO] [stdout] | [INFO] [stdout] 30 | scores.push(map.get(player_id).unwrap().clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*map.get(player_id).unwrap()` [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] --> crates/tage_core/src/machine/heuristics.rs:103:38 [INFO] [stdout] | [INFO] [stdout] 103 | unit_value_table.get(&id) + (produces.food + produces.gold) * 2 [INFO] [stdout] | ^^^ help: change this to: `id` [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] --> crates/tage_core/src/machine/heuristics.rs:108:30 [INFO] [stdout] | [INFO] [stdout] 108 | (res.get_res(&resource) - res.get_res(&resource.other())) / 100 - 40 [INFO] [stdout] | ^^^^^^^^^ help: change this to: `resource` [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 `impl` can be derived [INFO] [stdout] --> crates/tage_core/src/machine/boulder.rs:31:1 [INFO] [stdout] | [INFO] [stdout] 31 | / impl Default for Boulder { [INFO] [stdout] 32 | | fn default() -> Self { [INFO] [stdout] 33 | | Boulder { variance: 0 } [INFO] [stdout] 34 | | } [INFO] [stdout] 35 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 27 + #[derive(Default)] [INFO] [stdout] 28 | pub struct Boulder { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_core/src/machine/boulder.rs:101:41 [INFO] [stdout] | [INFO] [stdout] 101 | ... &destination, [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `destination` [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 `if` has identical blocks [INFO] [stdout] --> crates/tage_core/src/machine/boulder.rs:118:81 [INFO] [stdout] | [INFO] [stdout] 118 | ... let cost_penalty = if after.food < saving_goal.food { [INFO] [stdout] | ___________________________________________________________________________^ [INFO] [stdout] 119 | | ... -100 [INFO] [stdout] 120 | | ... } else if after.gold < saving_goal.gold { [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> crates/tage_core/src/machine/boulder.rs:120:69 [INFO] [stdout] | [INFO] [stdout] 120 | ... } else if after.gold < saving_goal.gold { [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 121 | | ... -100 [INFO] [stdout] 122 | | ... } else { [INFO] [stdout] | |_______________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> crates/tage_core/src/machine/boulder.rs:267:46 [INFO] [stdout] | [INFO] [stdout] 267 | PlayerAction::Unit { action, .. } => match action { [INFO] [stdout] | ______________________________________________^ [INFO] [stdout] 268 | | UnitAction::Build(_, _) => true, [INFO] [stdout] 269 | | _ => false, [INFO] [stdout] 270 | | }, [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> crates/tage_core/src/machine/boulder.rs:267:30 [INFO] [stdout] | [INFO] [stdout] 267 | PlayerAction::Unit { action, .. } => match action { [INFO] [stdout] | ^^^^^^ replace this binding [INFO] [stdout] 268 | UnitAction::Build(_, _) => true, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ with this pattern, prefixed by `action: ` [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] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_core/src/machine/boulder.rs:267:46 [INFO] [stdout] | [INFO] [stdout] 267 | PlayerAction::Unit { action, .. } => match action { [INFO] [stdout] | ______________________________________________^ [INFO] [stdout] 268 | | UnitAction::Build(_, _) => true, [INFO] [stdout] 269 | | _ => false, [INFO] [stdout] 270 | | }, [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] 267 - PlayerAction::Unit { action, .. } => match action { [INFO] [stdout] 268 - UnitAction::Build(_, _) => true, [INFO] [stdout] 269 - _ => false, [INFO] [stdout] 270 - }, [INFO] [stdout] 267 + PlayerAction::Unit { action, .. } => matches!(action, UnitAction::Build(_, _)), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_core/src/machine/boulder.rs:271:50 [INFO] [stdout] | [INFO] [stdout] 271 | PlayerAction::Building { action, .. } => match action { [INFO] [stdout] | __________________________________________________^ [INFO] [stdout] 272 | | BuildingAction::Train(_) => true, [INFO] [stdout] 273 | | BuildingAction::Trade(_) => true, [INFO] [stdout] 274 | | _ => false, [INFO] [stdout] 275 | | }, [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] 271 - PlayerAction::Building { action, .. } => match action { [INFO] [stdout] 272 - BuildingAction::Train(_) => true, [INFO] [stdout] 273 - BuildingAction::Trade(_) => true, [INFO] [stdout] 274 - _ => false, [INFO] [stdout] 275 - }, [INFO] [stdout] 271 + PlayerAction::Building { action, .. } => matches!(action, BuildingAction::Train(_) | BuildingAction::Trade(_)), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `UnitLocation` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_core/src/unit.rs:157:18 [INFO] [stdout] | [INFO] [stdout] 157 | loc: self.loc.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.loc` [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: useless use of `format!` [INFO] [stdout] --> crates/tage_core/src/lib.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | format!("assets") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"assets".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: hiding a lifetime that's named elsewhere is confusing [INFO] [stdout] --> crates/tage_core/src/blueprints/blueprints.rs:234:46 [INFO] [stdout] | [INFO] [stdout] 234 | pub fn get<'a>(&'a self, gen_id: &Id) -> Blueprint { [INFO] [stdout] | -- ^^^^^^^^^ the same lifetime is hidden here [INFO] [stdout] | | [INFO] [stdout] | the lifetime is named here [INFO] [stdout] | [INFO] [stdout] = help: the same lifetime is referred to in inconsistent ways, making the signature confusing [INFO] [stdout] = note: `#[warn(mismatched_lifetime_syntaxes)]` on by default [INFO] [stdout] help: consistently use `'a` [INFO] [stdout] | [INFO] [stdout] 234 | pub fn get<'a>(&'a self, gen_id: &Id) -> Blueprint<'a> { [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking tage_flow v0.1.0 (/opt/rustwide/workdir/crates/tage_flow) [INFO] [stderr] Checking tage_tui v0.1.0 (/opt/rustwide/workdir/crates/tage_tui) [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> crates/tage_tui/src/widgets/panel_widget.rs:3:21 [INFO] [stdout] | [INFO] [stdout] 3 | pub const DECOR_0: &'static str = r"* "; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> crates/tage_tui/src/widgets/panel_widget.rs:4:21 [INFO] [stdout] | [INFO] [stdout] 4 | pub const DECOR_1: &'static str = r"WM"; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> crates/tage_tui/src/widgets/panel_widget.rs:5:21 [INFO] [stdout] | [INFO] [stdout] 5 | pub const DECOR_2: &'static str = r"."; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> crates/tage_tui/src/widgets/panel_widget.rs:6:21 [INFO] [stdout] | [INFO] [stdout] 6 | pub const DECOR_3: &'static str = r" ` "; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> crates/tage_tui/src/widgets/panel_widget.rs:3:21 [INFO] [stdout] | [INFO] [stdout] 3 | pub const DECOR_0: &'static str = r"* "; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> crates/tage_tui/src/widgets/panel_widget.rs:4:21 [INFO] [stdout] | [INFO] [stdout] 4 | pub const DECOR_1: &'static str = r"WM"; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> crates/tage_tui/src/widgets/panel_widget.rs:5:21 [INFO] [stdout] | [INFO] [stdout] 5 | pub const DECOR_2: &'static str = r"."; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> crates/tage_tui/src/widgets/panel_widget.rs:6:21 [INFO] [stdout] | [INFO] [stdout] 6 | pub const DECOR_3: &'static str = r" ` "; [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: statics have by default a `'static` lifetime [INFO] [stdout] --> crates/tage_tui/src/menu_main.rs:3:20 [INFO] [stdout] | [INFO] [stdout] 3 | pub static TITLE: &'static str = r#" [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: statics have by default a `'static` lifetime [INFO] [stdout] --> crates/tage_tui/src/menu_main.rs:3:20 [INFO] [stdout] | [INFO] [stdout] 3 | pub static TITLE: &'static str = r#" [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/widgets/battle_widget.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | Clear::default().render(area, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] = note: `#[warn(clippy::default_constructed_unit_structs)]` on by default [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 23 - Clear::default().render(area, buf); [INFO] [stdout] 23 + Clear.render(area, buf); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/widgets/battle_widget.rs:99:56 [INFO] [stdout] | [INFO] [stdout] 99 | if let Some(unit) = self.board.grid.get_at(&pos).get_top_unit() { [INFO] [stdout] | ^^^^ help: change this to: `pos` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/widgets/battle_widget.rs:114:29 [INFO] [stdout] | [INFO] [stdout] 114 | .get_at(&pos) [INFO] [stdout] | ^^^^ help: change this to: `pos` [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: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/battle_widget.rs:119:21 [INFO] [stdout] | [INFO] [stdout] 119 | format!("Dead") [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Dead".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/widgets/board_tile_widget.rs:32:47 [INFO] [stdout] | [INFO] [stdout] 32 | if let Some(fog) = self.board.fog.get(&self.fog_player) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `self.fog_player` [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: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> crates/tage_tui/src/widgets/board_tile_widget.rs:56:57 [INFO] [stdout] | [INFO] [stdout] 56 | let (mut overall_color, text_color_fg) = if let Some(_) = self.travel_direction { [INFO] [stdout] | -------^^^^^^^------------------------ help: try: `if self.travel_direction.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/widgets/bp_unit_widget.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | Clear::default().render(area, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 22 - Clear::default().render(area, buf); [INFO] [stdout] 22 + Clear.render(area, buf); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/bp_unit_widget.rs:54:18 [INFO] [stdout] | [INFO] [stdout] 54 | line(format!("Trains:")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Trains:".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/bp_unit_widget.rs:63:18 [INFO] [stdout] | [INFO] [stdout] 63 | line(format!("Builds:")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Builds:".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/bp_unit_widget.rs:84:18 [INFO] [stdout] | [INFO] [stdout] 84 | line(format!("Abilities:")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Abilities:".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/bp_unit_widget.rs:93:18 [INFO] [stdout] | [INFO] [stdout] 93 | line(format!("Building constraints:")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Building constraints:".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/bp_unit_widget.rs:100:18 [INFO] [stdout] | [INFO] [stdout] 100 | line(format!("Requires to have researched:")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Requires to have researched:".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/bp_unit_widget.rs:106:18 [INFO] [stdout] | [INFO] [stdout] 106 | line(format!("Powers:")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Powers:".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/bp_unit_widget.rs:115:14 [INFO] [stdout] | [INFO] [stdout] 115 | line(format!("Stats:")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Stats:".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/widgets/member_widget.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | Clear::default().render(area, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 11 - Clear::default().render(area, buf); [INFO] [stdout] 11 + Clear.render(area, buf); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/widgets/panel_widget.rs:43:13 [INFO] [stdout] | [INFO] [stdout] 43 | Clear::default().render(area, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 43 - Clear::default().render(area, buf); [INFO] [stdout] 43 + Clear.render(area, buf); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/widgets/research_widget.rs:17:9 [INFO] [stdout] | [INFO] [stdout] 17 | Clear::default().render(area, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 17 - Clear::default().render(area, buf); [INFO] [stdout] 17 + Clear.render(area, buf); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_tui/src/widgets/research_widget.rs:74:22 [INFO] [stdout] | [INFO] [stdout] 74 | .map(|s| Line::raw(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Line::raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/research_widget.rs:96:17 [INFO] [stdout] | [INFO] [stdout] 96 | format!("") [INFO] [stdout] | ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/widgets/research_widget.rs:106:78 [INFO] [stdout] | [INFO] [stdout] 106 | let researched = player.researched_technologies.contains(&id); [INFO] [stdout] | ^^^ help: change this to: `id` [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: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/widgets/terrain_widget.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | Clear::default().render(area, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 26 - Clear::default().render(area, buf); [INFO] [stdout] 26 + Clear.render(area, buf); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/terrain_widget.rs:42:24 [INFO] [stdout] | [INFO] [stdout] 42 | Paragraph::new(format!("{}", bp.header.glyph)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `bp.header.glyph.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/terrain_widget.rs:45:24 [INFO] [stdout] | [INFO] [stdout] 45 | Paragraph::new(format!("{}", bp.header.name)).render(name, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `bp.header.name.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/terrain_widget.rs:53:28 [INFO] [stdout] | [INFO] [stdout] 53 | Paragraph::new(format!("Road =")) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Road =".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/terrain_widget.rs:60:43 [INFO] [stdout] | [INFO] [stdout] 60 | Collectable::BonusFood => format!("Supplies (100 food)"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Supplies (100 food)".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/terrain_widget.rs:61:43 [INFO] [stdout] | [INFO] [stdout] 61 | Collectable::BonusGold => format!("Treasure (100 gold)"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Treasure (100 gold)".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/terrain_widget.rs:62:39 [INFO] [stdout] | [INFO] [stdout] 62 | Collectable::Ruins => format!("Ruins"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Ruins".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/terrain_widget.rs:63:39 [INFO] [stdout] | [INFO] [stdout] 63 | Collectable::Relic => format!("Relic"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Relic".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/widgets/unit_stats_widget.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | Clear::default().render(area, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 25 - Clear::default().render(area, buf); [INFO] [stdout] 25 + Clear.render(area, buf); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_tui/src/widgets/unit_stats_widget.rs:79:53 [INFO] [stdout] | [INFO] [stdout] 79 | let table = Table::new(rows.into_iter().map(|row| Row::new(row)), widths); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Row::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/widgets/unit_widget.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | Clear::default().render(area, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 28 - Clear::default().render(area, buf); [INFO] [stdout] 28 + Clear.render(area, buf); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/unit_widget.rs:77:28 [INFO] [stdout] | [INFO] [stdout] 77 | Paragraph::new(format!("Making...")) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Making...".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/unit_widget.rs:82:28 [INFO] [stdout] | [INFO] [stdout] 82 | Paragraph::new(format!("Holding Relic")) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Holding Relic".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:38:22 [INFO] [stdout] | [INFO] [stdout] 38 | all_actions: &Vec, [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] 38 - all_actions: &Vec, [INFO] [stdout] 38 + all_actions: &[PlayerAction], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:51:49 [INFO] [stdout] | [INFO] [stdout] 51 | if all_actions.iter().any(|oth| match oth { [INFO] [stdout] | _________________________________________________^ [INFO] [stdout] 52 | | PlayerAction::Building { [INFO] [stdout] 53 | | target: UnitTarget { at, .. }, [INFO] [stdout] 54 | | .. [INFO] [stdout] 55 | | } if *at == target.at => true, [INFO] [stdout] 56 | | _ => false, [INFO] [stdout] 57 | | }) { [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] 51 ~ if all_actions.iter().any(|oth| matches!(oth, PlayerAction::Building { [INFO] [stdout] 52 + target: UnitTarget { at, .. }, [INFO] [stdout] 53 + .. [INFO] [stdout] 54 ~ } if *at == target.at)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:110:49 [INFO] [stdout] | [INFO] [stdout] 110 | if all_actions.iter().any(|oth| match oth { [INFO] [stdout] | _________________________________________________^ [INFO] [stdout] 111 | | PlayerAction::Unit { [INFO] [stdout] 112 | | target: UnitTarget { at, .. }, [INFO] [stdout] 113 | | .. [INFO] [stdout] 114 | | } if *at == target.at => true, [INFO] [stdout] 115 | | _ => false, [INFO] [stdout] 116 | | }) { [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] 110 ~ if all_actions.iter().any(|oth| matches!(oth, PlayerAction::Unit { [INFO] [stdout] 111 + target: UnitTarget { at, .. }, [INFO] [stdout] 112 + .. [INFO] [stdout] 113 ~ } if *at == target.at)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:265:9 [INFO] [stdout] | [INFO] [stdout] 265 | sorted_techs.sort_by(|a, b| a.0 .0.cmp(&b.0 .0)); [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] 265 - sorted_techs.sort_by(|a, b| a.0 .0.cmp(&b.0 .0)); [INFO] [stdout] 265 + sorted_techs.sort_by_key(|a| a.0 .0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:300:1 [INFO] [stdout] | [INFO] [stdout] 300 | / pub enum NavigatorError { [INFO] [stdout] 301 | | InvalidPush, [INFO] [stdout] | | ----------- the second-largest variant carries no data at all [INFO] [stdout] 302 | | Empty, [INFO] [stdout] 303 | | Bonked(PlayerAction), [INFO] [stdout] | | -------------------- the largest variant contains at least 272 bytes [INFO] [stdout] 304 | | } [INFO] [stdout] | |_^ the entire enum is at least 272 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] = note: `#[warn(clippy::large_enum_variant)]` on by default [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 303 - Bonked(PlayerAction), [INFO] [stdout] 303 + Bonked(Box), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `IVec2` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:351:34 [INFO] [stdout] | [INFO] [stdout] 351 | destination: destination.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*destination` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:385:21 [INFO] [stdout] | [INFO] [stdout] 385 | / if let Some(select) = p.path.iter().skip(picked.len()).next() { [INFO] [stdout] 386 | | Some(PathNode { [INFO] [stdout] 387 | | select: select.clone(), [INFO] [stdout] 388 | | action: p.action.clone(), [INFO] [stdout] ... | [INFO] [stdout] 391 | | None [INFO] [stdout] 392 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 385 ~ p.path.iter().skip(picked.len()).next().map(|select| PathNode { [INFO] [stdout] 386 + select: select.clone(), [INFO] [stdout] 387 + action: p.action.clone(), [INFO] [stdout] 388 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `skip(..).next()` on an iterator [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:385:56 [INFO] [stdout] | [INFO] [stdout] 385 | if let Some(select) = p.path.iter().skip(picked.len()).next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(picked.len())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next [INFO] [stdout] = note: `#[warn(clippy::iter_skip_next)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:400:17 [INFO] [stdout] | [INFO] [stdout] 400 | / match (&first.select, &node.select) { [INFO] [stdout] 401 | | (Select::Confirm, Select::Confirm) => true, [INFO] [stdout] 402 | | (Select::Menu(_), Select::Menu(_)) => true, [INFO] [stdout] 403 | | (Select::Tile { .. }, Select::Tile { .. }) => true, [INFO] [stdout] 404 | | _ => false, [INFO] [stdout] 405 | | } [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] 400 - match (&first.select, &node.select) { [INFO] [stdout] 401 - (Select::Confirm, Select::Confirm) => true, [INFO] [stdout] 402 - (Select::Menu(_), Select::Menu(_)) => true, [INFO] [stdout] 403 - (Select::Tile { .. }, Select::Tile { .. }) => true, [INFO] [stdout] 404 - _ => false, [INFO] [stdout] 405 - } [INFO] [stdout] 400 + matches!((&first.select, &node.select), (Select::Confirm, Select::Confirm) | (Select::Menu(_), Select::Menu(_)) | (Select::Tile { .. }, Select::Tile { .. })) [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] --> crates/tage_tui/src/navigator.rs:466:21 [INFO] [stdout] | [INFO] [stdout] 466 | / match err { [INFO] [stdout] 467 | | NavigatorError::Bonked(action) => self.apply_bonk(action), [INFO] [stdout] 468 | | _ => {} [INFO] [stdout] 469 | | } [INFO] [stdout] | |_____________________^ help: try: `if let NavigatorError::Bonked(action) = err { self.apply_bonk(action) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:513:9 [INFO] [stdout] | [INFO] [stdout] 513 | / if input.next { [INFO] [stdout] 514 | | if self.navigator.is_none() { [INFO] [stdout] 515 | | // get closest non-done unit [INFO] [stdout] 516 | | let cursor = self.top_tile_picker().cursor; [INFO] [stdout] ... | [INFO] [stdout] 531 | | } [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] 513 ~ if input.next [INFO] [stdout] 514 ~ && self.navigator.is_none() { [INFO] [stdout] 515 | // get closest non-done unit [INFO] [stdout] ... [INFO] [stdout] 529 | } [INFO] [stdout] 530 ~ } [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] --> crates/tage_tui/src/navigator.rs:591:21 [INFO] [stdout] | [INFO] [stdout] 591 | / match err { [INFO] [stdout] 592 | | NavigatorError::Bonked(action) => self.apply_bonk(action), [INFO] [stdout] 593 | | _ => {} [INFO] [stdout] 594 | | } [INFO] [stdout] | |_____________________^ help: try: `if let NavigatorError::Bonked(action) = err { self.apply_bonk(action) }` [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] --> crates/tage_tui/src/navigator.rs:607:25 [INFO] [stdout] | [INFO] [stdout] 607 | / match err { [INFO] [stdout] 608 | | NavigatorError::Bonked(action) => self.apply_bonk(action), [INFO] [stdout] 609 | | _ => {} [INFO] [stdout] 610 | | } [INFO] [stdout] | |_________________________^ help: try: `if let NavigatorError::Bonked(action) = err { self.apply_bonk(action) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:833:85 [INFO] [stdout] | [INFO] [stdout] 833 | let bonus = board.get_player_bonus(&board.current_player_turn, Some(&id)); [INFO] [stdout] | ^^^ help: change this to: `id` [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] --> crates/tage_tui/src/navigator.rs:852:84 [INFO] [stdout] | [INFO] [stdout] 852 | let bonus = ActTrain::get_bonus(board, &board.current_player_turn, &id, &build_id); [INFO] [stdout] | ^^^ help: change this to: `id` [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] --> crates/tage_tui/src/navigator.rs:852:89 [INFO] [stdout] | [INFO] [stdout] 852 | let bonus = ActTrain::get_bonus(board, &board.current_player_turn, &id, &build_id); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `build_id` [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: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:879:1 [INFO] [stdout] | [INFO] [stdout] 879 | / impl PartialOrd for MenuChoice { [INFO] [stdout] 880 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 881 | | Some(self.priority().cmp(&other.priority())) [INFO] [stdout] 882 | | } [INFO] [stdout] 883 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 880 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 881 - Some(self.priority().cmp(&other.priority())) [INFO] [stdout] 882 - } [INFO] [stdout] 880 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_tui/src/net.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | / match &self.connection { [INFO] [stdout] 55 | | Some(Connection::Client(_)) => true, [INFO] [stdout] 56 | | _ => false, [INFO] [stdout] 57 | | } [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] 54 - match &self.connection { [INFO] [stdout] 55 - Some(Connection::Client(_)) => true, [INFO] [stdout] 56 - _ => false, [INFO] [stdout] 57 - } [INFO] [stdout] 54 + matches!(&self.connection, Some(Connection::Client(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_tui/src/net.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | / match &self.connection { [INFO] [stdout] 62 | | Some(Connection::Server(_)) => true, [INFO] [stdout] 63 | | _ => false, [INFO] [stdout] 64 | | } [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] 61 - match &self.connection { [INFO] [stdout] 62 - Some(Connection::Server(_)) => true, [INFO] [stdout] 63 - _ => false, [INFO] [stdout] 64 - } [INFO] [stdout] 61 + matches!(&self.connection, Some(Connection::Server(_))) [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] --> crates/tage_tui/src/net.rs:104:9 [INFO] [stdout] | [INFO] [stdout] 104 | / match &mut self.connection { [INFO] [stdout] 105 | | Some(Connection::Server(server)) => server.server.disconnect(client_id), [INFO] [stdout] 106 | | _ => {} [INFO] [stdout] 107 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(Connection::Server(server)) = &mut self.connection { server.server.disconnect(client_id) }` [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] --> crates/tage_tui/src/net.rs:111:9 [INFO] [stdout] | [INFO] [stdout] 111 | / match &mut self.connection { [INFO] [stdout] 112 | | Some(Connection::Client(client)) => { [INFO] [stdout] 113 | | client.client.send_message( [INFO] [stdout] 114 | | DefaultChannel::ReliableOrdered, [INFO] [stdout] ... | [INFO] [stdout] 122 | | _ => {} [INFO] [stdout] 123 | | } [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] 111 ~ if let Some(Connection::Client(client)) = &mut self.connection { [INFO] [stdout] 112 + client.client.send_message( [INFO] [stdout] 113 + DefaultChannel::ReliableOrdered, [INFO] [stdout] 114 + bincode::encode_to_vec::<&ClientMessages, Configuration>( [INFO] [stdout] 115 + message, [INFO] [stdout] 116 + Configuration::default(), [INFO] [stdout] 117 + ) [INFO] [stdout] 118 + .unwrap(), [INFO] [stdout] 119 + ); [INFO] [stdout] 120 + } [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] --> crates/tage_tui/src/net.rs:127:9 [INFO] [stdout] | [INFO] [stdout] 127 | / match &mut self.connection { [INFO] [stdout] 128 | | Some(Connection::Server(server)) => { [INFO] [stdout] 129 | | server.server.broadcast_message( [INFO] [stdout] 130 | | DefaultChannel::ReliableOrdered, [INFO] [stdout] ... | [INFO] [stdout] 138 | | _ => {} [INFO] [stdout] 139 | | } [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] 127 ~ if let Some(Connection::Server(server)) = &mut self.connection { [INFO] [stdout] 128 + server.server.broadcast_message( [INFO] [stdout] 129 + DefaultChannel::ReliableOrdered, [INFO] [stdout] 130 + bincode::encode_to_vec::<&ServerMessages, Configuration>( [INFO] [stdout] 131 + message, [INFO] [stdout] 132 + Configuration::default(), [INFO] [stdout] 133 + ) [INFO] [stdout] 134 + .unwrap(), [INFO] [stdout] 135 + ); [INFO] [stdout] 136 + } [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] --> crates/tage_tui/src/net.rs:143:9 [INFO] [stdout] | [INFO] [stdout] 143 | / match &mut self.connection { [INFO] [stdout] 144 | | Some(Connection::Server(server)) => { [INFO] [stdout] 145 | | server.server.send_message( [INFO] [stdout] 146 | | client_id, [INFO] [stdout] ... | [INFO] [stdout] 155 | | _ => {} [INFO] [stdout] 156 | | } [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] 143 ~ if let Some(Connection::Server(server)) = &mut self.connection { [INFO] [stdout] 144 + server.server.send_message( [INFO] [stdout] 145 + client_id, [INFO] [stdout] 146 + DefaultChannel::ReliableOrdered, [INFO] [stdout] 147 + bincode::encode_to_vec::<&ServerMessages, Configuration>( [INFO] [stdout] 148 + message, [INFO] [stdout] 149 + Configuration::default(), [INFO] [stdout] 150 + ) [INFO] [stdout] 151 + .unwrap(), [INFO] [stdout] 152 + ); [INFO] [stdout] 153 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> crates/tage_tui/src/net.rs:168:1 [INFO] [stdout] | [INFO] [stdout] 168 | / pub enum Connection { [INFO] [stdout] 169 | | Client(Client), [INFO] [stdout] | | -------------- the largest variant contains at least 8544 bytes [INFO] [stdout] 170 | | Server(Server), [INFO] [stdout] | | -------------- the second-largest variant contains at least 3256 bytes [INFO] [stdout] 171 | | } [INFO] [stdout] | |_^ the entire enum is at least 8544 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 169 - Client(Client), [INFO] [stdout] 169 + Client(Box), [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] --> crates/tage_tui/src/net.rs:314:25 [INFO] [stdout] | [INFO] [stdout] 314 | / match &message { [INFO] [stdout] 315 | | ClientMessages::MemberChange { member } => { [INFO] [stdout] 316 | | self.members.insert(client_id, member.clone()); [INFO] [stdout] ... | [INFO] [stdout] 319 | | } [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] 314 ~ if let ClientMessages::MemberChange { member } = &message { [INFO] [stdout] 315 + self.members.insert(client_id, member.clone()); [INFO] [stdout] 316 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/widgets/battle_widget.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | Clear::default().render(area, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] = note: `#[warn(clippy::default_constructed_unit_structs)]` on by default [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 23 - Clear::default().render(area, buf); [INFO] [stdout] 23 + Clear.render(area, buf); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/widgets/battle_widget.rs:99:56 [INFO] [stdout] | [INFO] [stdout] 99 | if let Some(unit) = self.board.grid.get_at(&pos).get_top_unit() { [INFO] [stdout] | ^^^^ help: change this to: `pos` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/widgets/battle_widget.rs:114:29 [INFO] [stdout] | [INFO] [stdout] 114 | .get_at(&pos) [INFO] [stdout] | ^^^^ help: change this to: `pos` [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: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/battle_widget.rs:119:21 [INFO] [stdout] | [INFO] [stdout] 119 | format!("Dead") [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Dead".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/widgets/board_tile_widget.rs:32:47 [INFO] [stdout] | [INFO] [stdout] 32 | if let Some(fog) = self.board.fog.get(&self.fog_player) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `self.fog_player` [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 `let...else` may be rewritten with the `?` operator [INFO] [stdout] --> crates/tage_tui/src/settings.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | / let Some(path) = Self::disk_path() else { [INFO] [stdout] 24 | | return None; [INFO] [stdout] 25 | | }; [INFO] [stdout] | |__________^ help: replace it with: `let path = Self::disk_path()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> crates/tage_tui/src/widgets/board_tile_widget.rs:56:57 [INFO] [stdout] | [INFO] [stdout] 56 | let (mut overall_color, text_color_fg) = if let Some(_) = self.travel_direction { [INFO] [stdout] | -------^^^^^^^------------------------ help: try: `if self.travel_direction.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/widgets/bp_unit_widget.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | Clear::default().render(area, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 22 - Clear::default().render(area, buf); [INFO] [stdout] 22 + Clear.render(area, buf); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/bp_unit_widget.rs:54:18 [INFO] [stdout] | [INFO] [stdout] 54 | line(format!("Trains:")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Trains:".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/bp_unit_widget.rs:63:18 [INFO] [stdout] | [INFO] [stdout] 63 | line(format!("Builds:")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Builds:".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/bp_unit_widget.rs:84:18 [INFO] [stdout] | [INFO] [stdout] 84 | line(format!("Abilities:")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Abilities:".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/bp_unit_widget.rs:93:18 [INFO] [stdout] | [INFO] [stdout] 93 | line(format!("Building constraints:")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Building constraints:".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/bp_unit_widget.rs:100:18 [INFO] [stdout] | [INFO] [stdout] 100 | line(format!("Requires to have researched:")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Requires to have researched:".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/bp_unit_widget.rs:106:18 [INFO] [stdout] | [INFO] [stdout] 106 | line(format!("Powers:")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Powers:".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/bp_unit_widget.rs:115:14 [INFO] [stdout] | [INFO] [stdout] 115 | line(format!("Stats:")); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Stats:".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/widgets/member_widget.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | Clear::default().render(area, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 11 - Clear::default().render(area, buf); [INFO] [stdout] 11 + Clear.render(area, buf); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/widgets/panel_widget.rs:43:13 [INFO] [stdout] | [INFO] [stdout] 43 | Clear::default().render(area, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 43 - Clear::default().render(area, buf); [INFO] [stdout] 43 + Clear.render(area, buf); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/widgets/research_widget.rs:17:9 [INFO] [stdout] | [INFO] [stdout] 17 | Clear::default().render(area, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 17 - Clear::default().render(area, buf); [INFO] [stdout] 17 + Clear.render(area, buf); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_tui/src/widgets/research_widget.rs:74:22 [INFO] [stdout] | [INFO] [stdout] 74 | .map(|s| Line::raw(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Line::raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/research_widget.rs:96:17 [INFO] [stdout] | [INFO] [stdout] 96 | format!("") [INFO] [stdout] | ^^^^^^^^^^^ help: consider using `String::new()`: `String::new()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/widgets/research_widget.rs:106:78 [INFO] [stdout] | [INFO] [stdout] 106 | let researched = player.researched_technologies.contains(&id); [INFO] [stdout] | ^^^ help: change this to: `id` [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: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/widgets/terrain_widget.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | Clear::default().render(area, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 26 - Clear::default().render(area, buf); [INFO] [stdout] 26 + Clear.render(area, buf); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/terrain_widget.rs:42:24 [INFO] [stdout] | [INFO] [stdout] 42 | Paragraph::new(format!("{}", bp.header.glyph)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `bp.header.glyph.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/terrain_widget.rs:45:24 [INFO] [stdout] | [INFO] [stdout] 45 | Paragraph::new(format!("{}", bp.header.name)).render(name, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `bp.header.name.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/terrain_widget.rs:53:28 [INFO] [stdout] | [INFO] [stdout] 53 | Paragraph::new(format!("Road =")) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Road =".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/terrain_widget.rs:60:43 [INFO] [stdout] | [INFO] [stdout] 60 | Collectable::BonusFood => format!("Supplies (100 food)"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Supplies (100 food)".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/terrain_widget.rs:61:43 [INFO] [stdout] | [INFO] [stdout] 61 | Collectable::BonusGold => format!("Treasure (100 gold)"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Treasure (100 gold)".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/terrain_widget.rs:62:39 [INFO] [stdout] | [INFO] [stdout] 62 | Collectable::Ruins => format!("Ruins"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Ruins".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/terrain_widget.rs:63:39 [INFO] [stdout] | [INFO] [stdout] 63 | Collectable::Relic => format!("Relic"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Relic".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/widgets/unit_stats_widget.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | Clear::default().render(area, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 25 - Clear::default().render(area, buf); [INFO] [stdout] 25 + Clear.render(area, buf); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> crates/tage_tui/src/input.rs:30:53 [INFO] [stdout] | [INFO] [stdout] 30 | pub fn from_events(keybinds: &Keybinds, events: &Vec) -> Self { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 30 - pub fn from_events(keybinds: &Keybinds, events: &Vec) -> Self { [INFO] [stdout] 30 + pub fn from_events(keybinds: &Keybinds, events: &[Event]) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_tui/src/widgets/unit_stats_widget.rs:79:53 [INFO] [stdout] | [INFO] [stdout] 79 | let table = Table::new(rows.into_iter().map(|row| Row::new(row)), widths); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Row::new` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/widgets/unit_widget.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | Clear::default().render(area, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 28 - Clear::default().render(area, buf); [INFO] [stdout] 28 + Clear.render(area, buf); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> crates/tage_tui/src/input.rs:133:53 [INFO] [stdout] | [INFO] [stdout] 133 | pub fn from_events(keybinds: &Keybinds, events: &Vec) -> Self { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 133 - pub fn from_events(keybinds: &Keybinds, events: &Vec) -> Self { [INFO] [stdout] 133 + pub fn from_events(keybinds: &Keybinds, events: &[Event]) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/unit_widget.rs:77:28 [INFO] [stdout] | [INFO] [stdout] 77 | Paragraph::new(format!("Making...")) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Making...".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/widgets/unit_widget.rs:82:28 [INFO] [stdout] | [INFO] [stdout] 82 | Paragraph::new(format!("Holding Relic")) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Holding Relic".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:38:22 [INFO] [stdout] | [INFO] [stdout] 38 | all_actions: &Vec, [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] 38 - all_actions: &Vec, [INFO] [stdout] 38 + all_actions: &[PlayerAction], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:51:49 [INFO] [stdout] | [INFO] [stdout] 51 | if all_actions.iter().any(|oth| match oth { [INFO] [stdout] | _________________________________________________^ [INFO] [stdout] 52 | | PlayerAction::Building { [INFO] [stdout] 53 | | target: UnitTarget { at, .. }, [INFO] [stdout] 54 | | .. [INFO] [stdout] 55 | | } if *at == target.at => true, [INFO] [stdout] 56 | | _ => false, [INFO] [stdout] 57 | | }) { [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] 51 ~ if all_actions.iter().any(|oth| matches!(oth, PlayerAction::Building { [INFO] [stdout] 52 + target: UnitTarget { at, .. }, [INFO] [stdout] 53 + .. [INFO] [stdout] 54 ~ } if *at == target.at)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:110:49 [INFO] [stdout] | [INFO] [stdout] 110 | if all_actions.iter().any(|oth| match oth { [INFO] [stdout] | _________________________________________________^ [INFO] [stdout] 111 | | PlayerAction::Unit { [INFO] [stdout] 112 | | target: UnitTarget { at, .. }, [INFO] [stdout] 113 | | .. [INFO] [stdout] 114 | | } if *at == target.at => true, [INFO] [stdout] 115 | | _ => false, [INFO] [stdout] 116 | | }) { [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] 110 ~ if all_actions.iter().any(|oth| matches!(oth, PlayerAction::Unit { [INFO] [stdout] 111 + target: UnitTarget { at, .. }, [INFO] [stdout] 112 + .. [INFO] [stdout] 113 ~ } if *at == target.at)) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `let...else` may be rewritten with the `?` operator [INFO] [stdout] --> crates/tage_tui/src/member.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | / let Some(path) = Self::disk_path() else { [INFO] [stdout] 55 | | return None; [INFO] [stdout] 56 | | }; [INFO] [stdout] | |__________^ help: replace it with: `let path = Self::disk_path()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:265:9 [INFO] [stdout] | [INFO] [stdout] 265 | sorted_techs.sort_by(|a, b| a.0 .0.cmp(&b.0 .0)); [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] 265 - sorted_techs.sort_by(|a, b| a.0 .0.cmp(&b.0 .0)); [INFO] [stdout] 265 + sorted_techs.sort_by_key(|a| a.0 .0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:300:1 [INFO] [stdout] | [INFO] [stdout] 300 | / pub enum NavigatorError { [INFO] [stdout] 301 | | InvalidPush, [INFO] [stdout] | | ----------- the second-largest variant carries no data at all [INFO] [stdout] 302 | | Empty, [INFO] [stdout] 303 | | Bonked(PlayerAction), [INFO] [stdout] | | -------------------- the largest variant contains at least 272 bytes [INFO] [stdout] 304 | | } [INFO] [stdout] | |_^ the entire enum is at least 272 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] = note: `#[warn(clippy::large_enum_variant)]` on by default [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 303 - Bonked(PlayerAction), [INFO] [stdout] 303 + Bonked(Box), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/menu_main.rs:202:29 [INFO] [stdout] | [INFO] [stdout] 202 | blueprints: &board.bp(), [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `board.bp()` [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: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_main.rs:216:29 [INFO] [stdout] | [INFO] [stdout] 216 | frame.render_widget(Clear::default(), area) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 216 - frame.render_widget(Clear::default(), area) [INFO] [stdout] 216 + frame.render_widget(Clear, area) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `IVec2` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:351:34 [INFO] [stdout] | [INFO] [stdout] 351 | destination: destination.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*destination` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:107:21 [INFO] [stdout] | [INFO] [stdout] 107 | / if ALLOWED_PATH_CHARS.contains(&c) && ui_state.member_profile.name.len() < 32 { [INFO] [stdout] 108 | | save.push(c) [INFO] [stdout] 109 | | } [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] 106 ~ Some(KeyCode::Char(c)) [INFO] [stdout] 107 ~ if ALLOWED_PATH_CHARS.contains(&c) && ui_state.member_profile.name.len() < 32 => { [INFO] [stdout] 108 | save.push(c) [INFO] [stdout] 109 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:385:21 [INFO] [stdout] | [INFO] [stdout] 385 | / if let Some(select) = p.path.iter().skip(picked.len()).next() { [INFO] [stdout] 386 | | Some(PathNode { [INFO] [stdout] 387 | | select: select.clone(), [INFO] [stdout] 388 | | action: p.action.clone(), [INFO] [stdout] ... | [INFO] [stdout] 391 | | None [INFO] [stdout] 392 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 385 ~ p.path.iter().skip(picked.len()).next().map(|select| PathNode { [INFO] [stdout] 386 + select: select.clone(), [INFO] [stdout] 387 + action: p.action.clone(), [INFO] [stdout] 388 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `skip(..).next()` on an iterator [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:385:56 [INFO] [stdout] | [INFO] [stdout] 385 | if let Some(select) = p.path.iter().skip(picked.len()).next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(picked.len())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next [INFO] [stdout] = note: `#[warn(clippy::iter_skip_next)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:400:17 [INFO] [stdout] | [INFO] [stdout] 400 | / match (&first.select, &node.select) { [INFO] [stdout] 401 | | (Select::Confirm, Select::Confirm) => true, [INFO] [stdout] 402 | | (Select::Menu(_), Select::Menu(_)) => true, [INFO] [stdout] 403 | | (Select::Tile { .. }, Select::Tile { .. }) => true, [INFO] [stdout] 404 | | _ => false, [INFO] [stdout] 405 | | } [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] 400 - match (&first.select, &node.select) { [INFO] [stdout] 401 - (Select::Confirm, Select::Confirm) => true, [INFO] [stdout] 402 - (Select::Menu(_), Select::Menu(_)) => true, [INFO] [stdout] 403 - (Select::Tile { .. }, Select::Tile { .. }) => true, [INFO] [stdout] 404 - _ => false, [INFO] [stdout] 405 - } [INFO] [stdout] 400 + matches!((&first.select, &node.select), (Select::Confirm, Select::Confirm) | (Select::Menu(_), Select::Menu(_)) | (Select::Tile { .. }, Select::Tile { .. })) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:203:36 [INFO] [stdout] | [INFO] [stdout] 203 | Paragraph::new(format!("No actions have been taken in this turn")) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"No actions have been taken in this turn".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:466:21 [INFO] [stdout] | [INFO] [stdout] 466 | / match err { [INFO] [stdout] 467 | | NavigatorError::Bonked(action) => self.apply_bonk(action), [INFO] [stdout] 468 | | _ => {} [INFO] [stdout] 469 | | } [INFO] [stdout] | |_____________________^ help: try: `if let NavigatorError::Bonked(action) = err { self.apply_bonk(action) }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:242:32 [INFO] [stdout] | [INFO] [stdout] 242 | Paragraph::new(format!("{}", save)).alignment(Alignment::Center), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `save.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:513:9 [INFO] [stdout] | [INFO] [stdout] 513 | / if input.next { [INFO] [stdout] 514 | | if self.navigator.is_none() { [INFO] [stdout] 515 | | // get closest non-done unit [INFO] [stdout] 516 | | let cursor = self.top_tile_picker().cursor; [INFO] [stdout] ... | [INFO] [stdout] 531 | | } [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] 513 ~ if input.next [INFO] [stdout] 514 ~ && self.navigator.is_none() { [INFO] [stdout] 515 | // get closest non-done unit [INFO] [stdout] ... [INFO] [stdout] 529 | } [INFO] [stdout] 530 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:282:17 [INFO] [stdout] | [INFO] [stdout] 282 | / net.get_members().iter().map(|(_id, member)| { [INFO] [stdout] 283 | | let color = Color::Rgb(member.color[0], member.color[1], member.color[2]); [INFO] [stdout] 284 | | Row::new(vec![Cell::new( [INFO] [stdout] 285 | | Line::from(member.name.clone()) [INFO] [stdout] ... | [INFO] [stdout] 288 | | )]) [INFO] [stdout] 289 | | }), [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 282 ~ net.get_members().values().map(|member| { [INFO] [stdout] 283 + let color = Color::Rgb(member.color[0], member.color[1], member.color[2]); [INFO] [stdout] 284 + Row::new(vec![Cell::new( [INFO] [stdout] 285 + Line::from(member.name.clone()) [INFO] [stdout] 286 + .alignment(Alignment::Center) [INFO] [stdout] 287 + .style(Style::default().fg(text_color_contrast(color)).bg(color)), [INFO] [stdout] 288 + )]) [INFO] [stdout] 289 ~ }), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:336:29 [INFO] [stdout] | [INFO] [stdout] 336 | frame.render_widget(Clear::default(), area); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 336 - frame.render_widget(Clear::default(), area); [INFO] [stdout] 336 + frame.render_widget(Clear, area); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:397:9 [INFO] [stdout] | [INFO] [stdout] 397 | tally_sorted.sort_by(|a, b| a.0 .0.cmp(&b.0 .0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 397 - tally_sorted.sort_by(|a, b| a.0 .0.cmp(&b.0 .0)); [INFO] [stdout] 397 + tally_sorted.sort_by_key(|a| a.0 .0); [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] --> crates/tage_tui/src/navigator.rs:591:21 [INFO] [stdout] | [INFO] [stdout] 591 | / match err { [INFO] [stdout] 592 | | NavigatorError::Bonked(action) => self.apply_bonk(action), [INFO] [stdout] 593 | | _ => {} [INFO] [stdout] 594 | | } [INFO] [stdout] | |_____________________^ help: try: `if let NavigatorError::Bonked(action) = err { self.apply_bonk(action) }` [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] --> crates/tage_tui/src/navigator.rs:607:25 [INFO] [stdout] | [INFO] [stdout] 607 | / match err { [INFO] [stdout] 608 | | NavigatorError::Bonked(action) => self.apply_bonk(action), [INFO] [stdout] 609 | | _ => {} [INFO] [stdout] 610 | | } [INFO] [stdout] | |_________________________^ help: try: `if let NavigatorError::Bonked(action) = err { self.apply_bonk(action) }` [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: iterating on a map's keys [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:535:35 [INFO] [stdout] | [INFO] [stdout] 535 | "Terrain" => Some(bp.terrain.iter().map(|(id, _)| id.clone().into()).collect()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.terrain.keys().map(|id| id.clone().into())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:536:33 [INFO] [stdout] | [INFO] [stdout] 536 | "Units" => Some(bp.units.iter().map(|(id, _)| id.clone().into()).collect()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.units.keys().map(|id| id.clone().into())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:537:40 [INFO] [stdout] | [INFO] [stdout] 537 | "Technologies" => Some(bp.techs.iter().map(|(id, _)| id.clone().into()).collect()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.techs.keys().map(|id| id.clone().into())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:539:21 [INFO] [stdout] | [INFO] [stdout] 539 | / bp.abilities [INFO] [stdout] 540 | | .iter() [INFO] [stdout] 541 | | .map(|(id, _)| id.clone().into()) [INFO] [stdout] | |_________________________________________________________^ help: try: `bp.abilities.keys().map(|id| id.clone().into())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:544:34 [INFO] [stdout] | [INFO] [stdout] 544 | "Powers" => Some(bp.powers.iter().map(|(id, _)| id.clone().into()).collect()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.powers.keys().map(|id| id.clone().into())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:546:21 [INFO] [stdout] | [INFO] [stdout] 546 | / bp.civilizations [INFO] [stdout] 547 | | .iter() [INFO] [stdout] 548 | | .map(|(id, _)| id.clone().into()) [INFO] [stdout] | |_________________________________________________________^ help: try: `bp.civilizations.keys().map(|id| id.clone().into())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:559:66 [INFO] [stdout] | [INFO] [stdout] 559 | list.sort_by(|a, b| bp.get(a).get_name().cmp(&bp.get(b).get_name())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: change this to: `bp.get(b).get_name()` [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] --> crates/tage_tui/src/navigator.rs:833:85 [INFO] [stdout] | [INFO] [stdout] 833 | let bonus = board.get_player_bonus(&board.current_player_turn, Some(&id)); [INFO] [stdout] | ^^^ help: change this to: `id` [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] --> crates/tage_tui/src/navigator.rs:852:84 [INFO] [stdout] | [INFO] [stdout] 852 | let bonus = ActTrain::get_bonus(board, &board.current_player_turn, &id, &build_id); [INFO] [stdout] | ^^^ help: change this to: `id` [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] --> crates/tage_tui/src/navigator.rs:852:89 [INFO] [stdout] | [INFO] [stdout] 852 | let bonus = ActTrain::get_bonus(board, &board.current_player_turn, &id, &build_id); [INFO] [stdout] | ^^^^^^^^^ help: change this to: `build_id` [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: non-canonical implementation of `partial_cmp` on an `Ord` type [INFO] [stdout] --> crates/tage_tui/src/navigator.rs:879:1 [INFO] [stdout] | [INFO] [stdout] 879 | / impl PartialOrd for MenuChoice { [INFO] [stdout] 880 | | fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 881 | | Some(self.priority().cmp(&other.priority())) [INFO] [stdout] 882 | | } [INFO] [stdout] 883 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#non_canonical_partial_ord_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_partial_ord_impl)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 880 - fn partial_cmp(&self, other: &Self) -> Option { [INFO] [stdout] 881 - Some(self.priority().cmp(&other.priority())) [INFO] [stdout] 882 - } [INFO] [stdout] 880 + fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:755:53 [INFO] [stdout] | [INFO] [stdout] 755 | self.power.require_on_building.view(&self.bp) [INFO] [stdout] | ^^^^^^^^ help: change this to: `self.bp` [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: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_tui/src/net.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | / match &self.connection { [INFO] [stdout] 55 | | Some(Connection::Client(_)) => true, [INFO] [stdout] 56 | | _ => false, [INFO] [stdout] 57 | | } [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] 54 - match &self.connection { [INFO] [stdout] 55 - Some(Connection::Client(_)) => true, [INFO] [stdout] 56 - _ => false, [INFO] [stdout] 57 - } [INFO] [stdout] 54 + matches!(&self.connection, Some(Connection::Client(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_tui/src/net.rs:61:9 [INFO] [stdout] | [INFO] [stdout] 61 | / match &self.connection { [INFO] [stdout] 62 | | Some(Connection::Server(_)) => true, [INFO] [stdout] 63 | | _ => false, [INFO] [stdout] 64 | | } [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] 61 - match &self.connection { [INFO] [stdout] 62 - Some(Connection::Server(_)) => true, [INFO] [stdout] 63 - _ => false, [INFO] [stdout] 64 - } [INFO] [stdout] 61 + matches!(&self.connection, Some(Connection::Server(_))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:764:39 [INFO] [stdout] | [INFO] [stdout] 764 | self.power.bonus.view(&self.bp) [INFO] [stdout] | ^^^^^^^^ help: change this to: `self.bp` [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] --> crates/tage_tui/src/menu_pause.rs:770:45 [INFO] [stdout] | [INFO] [stdout] 770 | &self.power.unit_bonus.view(&self.bp) [INFO] [stdout] | ^^^^^^^^ help: change this to: `self.bp` [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] --> crates/tage_tui/src/menu_pause.rs:776:47 [INFO] [stdout] | [INFO] [stdout] 776 | &self.power.battle_bonus.view(&self.bp) [INFO] [stdout] | ^^^^^^^^ help: change this to: `self.bp` [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: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:780:29 [INFO] [stdout] | [INFO] [stdout] 780 | description += &format!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider using `.to_string()`: `"\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> crates/tage_tui/src/net.rs:104:9 [INFO] [stdout] | [INFO] [stdout] 104 | / match &mut self.connection { [INFO] [stdout] 105 | | Some(Connection::Server(server)) => server.server.disconnect(client_id), [INFO] [stdout] 106 | | _ => {} [INFO] [stdout] 107 | | } [INFO] [stdout] | |_________^ help: try: `if let Some(Connection::Server(server)) = &mut self.connection { server.server.disconnect(client_id) }` [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] --> crates/tage_tui/src/net.rs:111:9 [INFO] [stdout] | [INFO] [stdout] 111 | / match &mut self.connection { [INFO] [stdout] 112 | | Some(Connection::Client(client)) => { [INFO] [stdout] 113 | | client.client.send_message( [INFO] [stdout] 114 | | DefaultChannel::ReliableOrdered, [INFO] [stdout] ... | [INFO] [stdout] 122 | | _ => {} [INFO] [stdout] 123 | | } [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] 111 ~ if let Some(Connection::Client(client)) = &mut self.connection { [INFO] [stdout] 112 + client.client.send_message( [INFO] [stdout] 113 + DefaultChannel::ReliableOrdered, [INFO] [stdout] 114 + bincode::encode_to_vec::<&ClientMessages, Configuration>( [INFO] [stdout] 115 + message, [INFO] [stdout] 116 + Configuration::default(), [INFO] [stdout] 117 + ) [INFO] [stdout] 118 + .unwrap(), [INFO] [stdout] 119 + ); [INFO] [stdout] 120 + } [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] --> crates/tage_tui/src/net.rs:127:9 [INFO] [stdout] | [INFO] [stdout] 127 | / match &mut self.connection { [INFO] [stdout] 128 | | Some(Connection::Server(server)) => { [INFO] [stdout] 129 | | server.server.broadcast_message( [INFO] [stdout] 130 | | DefaultChannel::ReliableOrdered, [INFO] [stdout] ... | [INFO] [stdout] 138 | | _ => {} [INFO] [stdout] 139 | | } [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] 127 ~ if let Some(Connection::Server(server)) = &mut self.connection { [INFO] [stdout] 128 + server.server.broadcast_message( [INFO] [stdout] 129 + DefaultChannel::ReliableOrdered, [INFO] [stdout] 130 + bincode::encode_to_vec::<&ServerMessages, Configuration>( [INFO] [stdout] 131 + message, [INFO] [stdout] 132 + Configuration::default(), [INFO] [stdout] 133 + ) [INFO] [stdout] 134 + .unwrap(), [INFO] [stdout] 135 + ); [INFO] [stdout] 136 + } [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] --> crates/tage_tui/src/net.rs:143:9 [INFO] [stdout] | [INFO] [stdout] 143 | / match &mut self.connection { [INFO] [stdout] 144 | | Some(Connection::Server(server)) => { [INFO] [stdout] 145 | | server.server.send_message( [INFO] [stdout] 146 | | client_id, [INFO] [stdout] ... | [INFO] [stdout] 155 | | _ => {} [INFO] [stdout] 156 | | } [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] 143 ~ if let Some(Connection::Server(server)) = &mut self.connection { [INFO] [stdout] 144 + server.server.send_message( [INFO] [stdout] 145 + client_id, [INFO] [stdout] 146 + DefaultChannel::ReliableOrdered, [INFO] [stdout] 147 + bincode::encode_to_vec::<&ServerMessages, Configuration>( [INFO] [stdout] 148 + message, [INFO] [stdout] 149 + Configuration::default(), [INFO] [stdout] 150 + ) [INFO] [stdout] 151 + .unwrap(), [INFO] [stdout] 152 + ); [INFO] [stdout] 153 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:788:22 [INFO] [stdout] | [INFO] [stdout] 788 | .map(|s| Line::raw(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Line::raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> crates/tage_tui/src/net.rs:168:1 [INFO] [stdout] | [INFO] [stdout] 168 | / pub enum Connection { [INFO] [stdout] 169 | | Client(Client), [INFO] [stdout] | | -------------- the largest variant contains at least 8544 bytes [INFO] [stdout] 170 | | Server(Server), [INFO] [stdout] | | -------------- the second-largest variant contains at least 3256 bytes [INFO] [stdout] 171 | | } [INFO] [stdout] | |_^ the entire enum is at least 8544 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 169 - Client(Client), [INFO] [stdout] 169 + Client(Box), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:890:24 [INFO] [stdout] | [INFO] [stdout] 890 | Paragraph::new(format!("{}", view_level(self.tech.level))).render(level, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `view_level(self.tech.level).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:1008:22 [INFO] [stdout] | [INFO] [stdout] 1008 | .map(|s| Line::raw(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Line::raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:64:29 [INFO] [stdout] | [INFO] [stdout] 64 | frame.render_widget(Clear::default(), area); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 64 - frame.render_widget(Clear::default(), area); [INFO] [stdout] 64 + frame.render_widget(Clear, area); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:127:13 [INFO] [stdout] | [INFO] [stdout] 127 | / match self.cursor { [INFO] [stdout] 128 | | 0 => { [INFO] [stdout] 129 | | let speed = match ui_state.settings.machine_speed { [INFO] [stdout] 130 | | MachineSpeed::Skip => MachineSpeed::StepMoves, [INFO] [stdout] ... | [INFO] [stdout] 138 | | _ => {} [INFO] [stdout] 139 | | } [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] 127 ~ if self.cursor == 0 { [INFO] [stdout] 128 + let speed = match ui_state.settings.machine_speed { [INFO] [stdout] 129 + MachineSpeed::Skip => MachineSpeed::StepMoves, [INFO] [stdout] 130 + MachineSpeed::StepMoves => MachineSpeed::StepMovesSlow, [INFO] [stdout] 131 + MachineSpeed::StepMovesSlow => MachineSpeed::Skip, [INFO] [stdout] 132 + MachineSpeed::StepSelects => todo!(), [INFO] [stdout] 133 + }; [INFO] [stdout] 134 + ui_state.settings.machine_speed = speed; [INFO] [stdout] 135 + ui_state.settings.to_disk(); [INFO] [stdout] 136 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:146:29 [INFO] [stdout] | [INFO] [stdout] 146 | frame.render_widget(Clear::default(), area); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 146 - frame.render_widget(Clear::default(), area); [INFO] [stdout] 146 + frame.render_widget(Clear, area); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:164:47 [INFO] [stdout] | [INFO] [stdout] 164 | MachineSpeed::Skip => format!("Skip"), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Skip".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:165:52 [INFO] [stdout] | [INFO] [stdout] 165 | MachineSpeed::StepMoves => format!("Step"), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Step".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:166:56 [INFO] [stdout] | [INFO] [stdout] 166 | MachineSpeed::StepMovesSlow => format!("Step slowly"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Step slowly".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:167:54 [INFO] [stdout] | [INFO] [stdout] 167 | MachineSpeed::StepSelects => format!("Step Detailed"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Step Detailed".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `KeyCode` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:209:21 [INFO] [stdout] | [INFO] [stdout] 209 | keycode.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*keycode` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:215:17 [INFO] [stdout] | [INFO] [stdout] 215 | self.cursor_keybinds = self.cursor_keybinds + input.acc.y; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.cursor_keybinds += input.acc.y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> crates/tage_tui/src/net.rs:314:25 [INFO] [stdout] | [INFO] [stdout] 314 | / match &message { [INFO] [stdout] 315 | | ClientMessages::MemberChange { member } => { [INFO] [stdout] 316 | | self.members.insert(client_id, member.clone()); [INFO] [stdout] ... | [INFO] [stdout] 319 | | } [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] 314 ~ if let ClientMessages::MemberChange { member } = &message { [INFO] [stdout] 315 + self.members.insert(client_id, member.clone()); [INFO] [stdout] 316 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:262:29 [INFO] [stdout] | [INFO] [stdout] 262 | frame.render_widget(Clear::default(), area); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 262 - frame.render_widget(Clear::default(), area); [INFO] [stdout] 262 + frame.render_widget(Clear, area); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `KeyCode` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:308:31 [INFO] [stdout] | [INFO] [stdout] 308 | let key = self.keybinds.clone().get_key_from_string(c).clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self.keybinds.clone().get_key_from_string(c)` [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: comparison to empty slice [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:232:28 [INFO] [stdout] | [INFO] [stdout] 232 | if map_settings.path != "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!map_settings.path.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:282:17 [INFO] [stdout] | [INFO] [stdout] 282 | / match message { [INFO] [stdout] 283 | | ClientMessages::MemberChange { member } => { [INFO] [stdout] 284 | | let player_list = next.get_player_list(); [INFO] [stdout] 285 | | if let Some(player_setting) = player_list.iter_mut().find(|p| { [INFO] [stdout] ... | [INFO] [stdout] 299 | | _ => {} [INFO] [stdout] 300 | | } [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] 282 ~ if let ClientMessages::MemberChange { member } = message { [INFO] [stdout] 283 + let player_list = next.get_player_list(); [INFO] [stdout] 284 + if let Some(player_setting) = player_list.iter_mut().find(|p| { [INFO] [stdout] 285 + if let Controller::Remote(raw) = p.controller { [INFO] [stdout] 286 + ClientId::from_raw(raw) == client_id [INFO] [stdout] 287 + } else { [INFO] [stdout] 288 + false [INFO] [stdout] 289 + } [INFO] [stdout] 290 + }) { [INFO] [stdout] 291 + player_setting.name = member.name; [INFO] [stdout] 292 + player_setting.symbol = member.symbol; [INFO] [stdout] 293 + player_setting.color = color_to_u32(member.color); [INFO] [stdout] 294 + player_setting.civilization = member.civilization; [INFO] [stdout] 295 + } [INFO] [stdout] 296 + send_settings = true; [INFO] [stdout] 297 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:323:21 [INFO] [stdout] | [INFO] [stdout] 323 | / if ALLOWED_NAME_CHARS.contains(&c) && select_name.len() < 32 { [INFO] [stdout] 324 | | select_name.push(c); [INFO] [stdout] 325 | | } [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] 322 ~ Some(KeyCode::Char(c)) [INFO] [stdout] 323 ~ if ALLOWED_NAME_CHARS.contains(&c) && select_name.len() < 32 => { [INFO] [stdout] 324 | select_name.push(c); [INFO] [stdout] 325 ~ } [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] --> crates/tage_tui/src/menu_lobby.rs:330:13 [INFO] [stdout] | [INFO] [stdout] 330 | / match input.keycode { [INFO] [stdout] 331 | | Some(KeyCode::Char(c)) => { [INFO] [stdout] 332 | | *select_symbol = c.to_string(); [INFO] [stdout] ... | [INFO] [stdout] 335 | | } [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] 330 ~ if let Some(KeyCode::Char(c)) = input.keycode { [INFO] [stdout] 331 + *select_symbol = c.to_string(); [INFO] [stdout] 332 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `let...else` may be rewritten with the `?` operator [INFO] [stdout] --> crates/tage_tui/src/settings.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | / let Some(path) = Self::disk_path() else { [INFO] [stdout] 24 | | return None; [INFO] [stdout] 25 | | }; [INFO] [stdout] | |__________^ help: replace it with: `let path = Self::disk_path()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:354:25 [INFO] [stdout] | [INFO] [stdout] 354 | *cursor = *cursor + input.acc.y; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*cursor += input.acc.y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:375:20 [INFO] [stdout] | [INFO] [stdout] 375 | if let Some(_) = net.error.pop() { [INFO] [stdout] | -------^^^^^^^------------------ help: try: `if net.error.pop().is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:394:21 [INFO] [stdout] | [INFO] [stdout] 394 | / match &mut net.connection { [INFO] [stdout] 395 | | Some(Connection::Client(client)) => { [INFO] [stdout] 396 | | let client_id = ClientId::from_raw(id); [INFO] [stdout] 397 | | if Some(client_id) == client.get_local_id() { [INFO] [stdout] ... | [INFO] [stdout] 404 | | _ => {} [INFO] [stdout] 405 | | } [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] 394 ~ if let Some(Connection::Client(client)) = &mut net.connection { [INFO] [stdout] 395 + let client_id = ClientId::from_raw(id); [INFO] [stdout] 396 + if Some(client_id) == client.get_local_id() { [INFO] [stdout] 397 + if let Some(member) = client.members.get_mut(&client_id) { [INFO] [stdout] 398 + member.name = select_name; [INFO] [stdout] 399 + send_member = Some(member.clone()); [INFO] [stdout] 400 + } [INFO] [stdout] 401 + } [INFO] [stdout] 402 + } [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] --> crates/tage_tui/src/menu_lobby.rs:411:21 [INFO] [stdout] | [INFO] [stdout] 411 | / match &mut net.connection { [INFO] [stdout] 412 | | Some(Connection::Client(client)) => { [INFO] [stdout] 413 | | let client_id = ClientId::from_raw(id); [INFO] [stdout] 414 | | if Some(client_id) == client.get_local_id() { [INFO] [stdout] ... | [INFO] [stdout] 421 | | _ => {} [INFO] [stdout] 422 | | } [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] 411 ~ if let Some(Connection::Client(client)) = &mut net.connection { [INFO] [stdout] 412 + let client_id = ClientId::from_raw(id); [INFO] [stdout] 413 + if Some(client_id) == client.get_local_id() { [INFO] [stdout] 414 + if let Some(member) = client.members.get_mut(&client_id) { [INFO] [stdout] 415 + member.symbol = select_symbol; [INFO] [stdout] 416 + send_member = Some(member.clone()); [INFO] [stdout] 417 + } [INFO] [stdout] 418 + } [INFO] [stdout] 419 + } [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] --> crates/tage_tui/src/menu_lobby.rs:458:21 [INFO] [stdout] | [INFO] [stdout] 458 | / match &mut net.connection { [INFO] [stdout] 459 | | Some(Connection::Client(client)) => { [INFO] [stdout] 460 | | let client_id = ClientId::from_raw(id); [INFO] [stdout] 461 | | if Some(client_id) == client.get_local_id() { [INFO] [stdout] ... | [INFO] [stdout] 471 | | _ => {} [INFO] [stdout] 472 | | } [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] 458 ~ if let Some(Connection::Client(client)) = &mut net.connection { [INFO] [stdout] 459 + let client_id = ClientId::from_raw(id); [INFO] [stdout] 460 + if Some(client_id) == client.get_local_id() { [INFO] [stdout] 461 + if let Some(member) = client.members.get_mut(&client_id) { [INFO] [stdout] 462 + member.civilization = bp [INFO] [stdout] 463 + .get_civilization(&select_civilization.choices[c]) [INFO] [stdout] 464 + .name [INFO] [stdout] 465 + .clone(); [INFO] [stdout] 466 + send_member = Some(member.clone()); [INFO] [stdout] 467 + } [INFO] [stdout] 468 + } [INFO] [stdout] 469 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:537:25 [INFO] [stdout] | [INFO] [stdout] 537 | / if !choices.is_empty() { [INFO] [stdout] 538 | | let local = if let Controller::Remote(id) = [INFO] [stdout] 539 | | &choices[*cursor as usize].controller [INFO] [stdout] ... | [INFO] [stdout] 613 | | } [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] 536 ~ } [INFO] [stdout] 537 ~ if !choices.is_empty() => { [INFO] [stdout] 538 | let local = if let Controller::Remote(id) = [INFO] [stdout] ... [INFO] [stdout] 612 | } [INFO] [stdout] 613 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:616:25 [INFO] [stdout] | [INFO] [stdout] 616 | / if next.chosen_map.is_some() { [INFO] [stdout] 617 | | next.map_settings = MapSettings { [INFO] [stdout] 618 | | players: next [INFO] [stdout] 619 | | .get_player_list() [INFO] [stdout] ... | [INFO] [stdout] 634 | | next_state = MenuState::Play(next.map_settings.clone()) [INFO] [stdout] 635 | | } [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] 615 ~ LobbySection::Start if !net.is_client() [INFO] [stdout] 616 ~ && next.chosen_map.is_some() => { [INFO] [stdout] 617 | next.map_settings = MapSettings { [INFO] [stdout] ... [INFO] [stdout] 634 | next_state = MenuState::Play(next.map_settings.clone()) [INFO] [stdout] 635 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:593:50 [INFO] [stdout] | [INFO] [stdout] 593 | ... choices: bp [INFO] [stdout] | ________________________________^ [INFO] [stdout] 594 | | ... .civilizations [INFO] [stdout] 595 | | ... .iter() [INFO] [stdout] 596 | | ... .map(|(id, _)| id.clone()) [INFO] [stdout] | |____________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 593 ~ choices: bp [INFO] [stdout] 594 + .civilizations.keys().map(|id| id.clone()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:725:24 [INFO] [stdout] | [INFO] [stdout] 725 | if self.map_settings.path == "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.map_settings.path.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:790:45 [INFO] [stdout] | [INFO] [stdout] 790 | ... None => format!("Alone"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Alone".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:801:45 [INFO] [stdout] | [INFO] [stdout] 801 | ... format!("Host hotseat") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Host hotseat".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:803:45 [INFO] [stdout] | [INFO] [stdout] 803 | ... format!("Local player") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Local player".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:808:45 [INFO] [stdout] | [INFO] [stdout] 808 | ... format!("Host player") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Host player".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:811:45 [INFO] [stdout] | [INFO] [stdout] 811 | ... format!("Local player") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Local player".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:813:45 [INFO] [stdout] | [INFO] [stdout] 813 | ... format!("Remote player") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Remote player".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:817:41 [INFO] [stdout] | [INFO] [stdout] 817 | ... format!("Boulder Weak") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Boulder Weak".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:820:41 [INFO] [stdout] | [INFO] [stdout] 820 | ... format!("Boulder Average") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Boulder Average".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:823:41 [INFO] [stdout] | [INFO] [stdout] 823 | ... format!("Boulder Strong") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Boulder Strong".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:826:41 [INFO] [stdout] | [INFO] [stdout] 826 | ... format!("Peak Weak") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Peak Weak".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:829:41 [INFO] [stdout] | [INFO] [stdout] 829 | ... format!("Peak Average") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Peak Average".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:832:41 [INFO] [stdout] | [INFO] [stdout] 832 | ... format!("Peak Strong") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Peak Strong".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:835:41 [INFO] [stdout] | [INFO] [stdout] 835 | ... format!("Tuned Boulder") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Tuned Boulder".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:838:41 [INFO] [stdout] | [INFO] [stdout] 838 | ... format!("Tuned Peak") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Tuned Peak".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:844:33 [INFO] [stdout] | [INFO] [stdout] 844 | ... format!("{}", bp.get_civilization(&player.civ(bp)).name), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `bp.get_civilization(&player.civ(bp)).name.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:905:37 [INFO] [stdout] | [INFO] [stdout] 905 | frame.render_widget(Clear::default(), rest); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 905 - frame.render_widget(Clear::default(), rest); [INFO] [stdout] 905 + frame.render_widget(Clear, rest); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:955:37 [INFO] [stdout] | [INFO] [stdout] 955 | frame.render_widget(Clear::default(), center); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 955 - frame.render_widget(Clear::default(), center); [INFO] [stdout] 955 + frame.render_widget(Clear, center); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:972:33 [INFO] [stdout] | [INFO] [stdout] 972 | None => format!("Alone, all others are hostile"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Alone, all others are hostile".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:988:37 [INFO] [stdout] | [INFO] [stdout] 988 | frame.render_widget(Clear::default(), center); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 988 - frame.render_widget(Clear::default(), center); [INFO] [stdout] 988 + frame.render_widget(Clear, center); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1015:37 [INFO] [stdout] | [INFO] [stdout] 1015 | frame.render_widget(Clear::default(), center); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 1015 - frame.render_widget(Clear::default(), center); [INFO] [stdout] 1015 + frame.render_widget(Clear, center); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1036:37 [INFO] [stdout] | [INFO] [stdout] 1036 | frame.render_widget(Clear::default(), center); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 1036 - frame.render_widget(Clear::default(), center); [INFO] [stdout] 1036 + frame.render_widget(Clear, center); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1096:37 [INFO] [stdout] | [INFO] [stdout] 1096 | frame.render_widget(Clear::default(), center); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 1096 - frame.render_widget(Clear::default(), center); [INFO] [stdout] 1096 + frame.render_widget(Clear, center); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1128:37 [INFO] [stdout] | [INFO] [stdout] 1128 | frame.render_widget(Clear::default(), center); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 1128 - frame.render_widget(Clear::default(), center); [INFO] [stdout] 1128 + frame.render_widget(Clear, center); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1144:46 [INFO] [stdout] | [INFO] [stdout] 1144 | Controller::Human => format!("Local"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Local".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1147:29 [INFO] [stdout] | [INFO] [stdout] 1147 | ... format!("Machine Boulder Weak") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Machine Boulder Weak".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1150:29 [INFO] [stdout] | [INFO] [stdout] 1150 | ... format!("Machine Boulder Average") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Machine Boulder Average".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1153:29 [INFO] [stdout] | [INFO] [stdout] 1153 | ... format!("Machine Boulder Strong") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Machine Boulder Strong".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1156:29 [INFO] [stdout] | [INFO] [stdout] 1156 | ... format!("Machine Peak Weak") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Machine Peak Weak".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1159:29 [INFO] [stdout] | [INFO] [stdout] 1159 | ... format!("Machine Peak Average") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Machine Peak Average".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1162:29 [INFO] [stdout] | [INFO] [stdout] 1162 | ... format!("Machine Peak Strong") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Machine Peak Strong".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `net.error.get(0)` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1182:30 [INFO] [stdout] | [INFO] [stdout] 1182 | if let Some(error) = net.error.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `net.error.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: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1214:29 [INFO] [stdout] | [INFO] [stdout] 1214 | frame.render_widget(Clear::default(), center); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 1214 - frame.render_widget(Clear::default(), center); [INFO] [stdout] 1214 + frame.render_widget(Clear, center); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_load.rs:88:29 [INFO] [stdout] | [INFO] [stdout] 88 | frame.render_widget(Clear::default(), area); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 88 - frame.render_widget(Clear::default(), area); [INFO] [stdout] 88 + frame.render_widget(Clear, area); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> crates/tage_tui/src/input.rs:30:53 [INFO] [stdout] | [INFO] [stdout] 30 | pub fn from_events(keybinds: &Keybinds, events: &Vec) -> Self { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 30 - pub fn from_events(keybinds: &Keybinds, events: &Vec) -> Self { [INFO] [stdout] 30 + pub fn from_events(keybinds: &Keybinds, events: &[Event]) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/tage_tui/src/menu_profile.rs:40:21 [INFO] [stdout] | [INFO] [stdout] 40 | / if ALLOWED_NAME_CHARS.contains(&c) && ui_state.member_profile.name.len() < 32 { [INFO] [stdout] 41 | | ui_state.member_profile.name.push(c); [INFO] [stdout] 42 | | } [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] 39 ~ Some(KeyCode::Char(c)) [INFO] [stdout] 40 ~ if ALLOWED_NAME_CHARS.contains(&c) && ui_state.member_profile.name.len() < 32 => { [INFO] [stdout] 41 | ui_state.member_profile.name.push(c); [INFO] [stdout] 42 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/tage_tui/src/menu_profile.rs:54:21 [INFO] [stdout] | [INFO] [stdout] 54 | / if ALLOWED_NAME_CHARS.contains(&c) { [INFO] [stdout] 55 | | ui_state.member_profile.symbol = c.to_string(); [INFO] [stdout] 56 | | next.editing_symbol = false; [INFO] [stdout] 57 | | input.select = false; [INFO] [stdout] 58 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 53 ~ Some(KeyCode::Char(c)) [INFO] [stdout] 54 ~ if ALLOWED_NAME_CHARS.contains(&c) => { [INFO] [stdout] 55 | ui_state.member_profile.symbol = c.to_string(); [INFO] [stdout] 56 | next.editing_symbol = false; [INFO] [stdout] 57 | input.select = false; [INFO] [stdout] 58 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> crates/tage_tui/src/input.rs:133:53 [INFO] [stdout] | [INFO] [stdout] 133 | pub fn from_events(keybinds: &Keybinds, events: &Vec) -> Self { [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] help: change this to [INFO] [stdout] | [INFO] [stdout] 133 - pub fn from_events(keybinds: &Keybinds, events: &Vec) -> Self { [INFO] [stdout] 133 + pub fn from_events(keybinds: &Keybinds, events: &[Event]) -> Self { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> crates/tage_tui/src/menu_profile.rs:140:26 [INFO] [stdout] | [INFO] [stdout] 140 | .zip(profile.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:629:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 140 - .zip(profile.into_iter()) [INFO] [stdout] 140 + .zip(profile) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/tage_tui/src/menu_connect.rs:39:21 [INFO] [stdout] | [INFO] [stdout] 39 | / if ALLOWED_IP_CHARS.contains(&c) && next.addr.len() < 20 { [INFO] [stdout] 40 | | next.addr.push(c); [INFO] [stdout] 41 | | } [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] 38 ~ Some(KeyCode::Char(c)) [INFO] [stdout] 39 ~ if ALLOWED_IP_CHARS.contains(&c) && next.addr.len() < 20 => { [INFO] [stdout] 40 | next.addr.push(c); [INFO] [stdout] 41 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> crates/tage_tui/src/menu_connect.rs:72:73 [INFO] [stdout] | [INFO] [stdout] 72 | ... Some(format!("Ip {}: {}\n\n{}", self.addr, e.to_string(), help)); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> crates/tage_tui/src/menu_connect.rs:109:26 [INFO] [stdout] | [INFO] [stdout] 109 | .zip(["", "", self.addr.as_str(), ""].into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:629:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 109 - .zip(["", "", self.addr.as_str(), ""].into_iter()) [INFO] [stdout] 109 + .zip(["", "", self.addr.as_str(), ""]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `render` doesn't need a mutable reference [INFO] [stdout] --> crates/tage_tui/src/lib.rs:147:13 [INFO] [stdout] | [INFO] [stdout] 147 | &mut game_state, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 147 - &mut game_state, [INFO] [stdout] 147 + &game_state, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `let...else` may be rewritten with the `?` operator [INFO] [stdout] --> crates/tage_tui/src/member.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | / let Some(path) = Self::disk_path() else { [INFO] [stdout] 55 | | return None; [INFO] [stdout] 56 | | }; [INFO] [stdout] | |__________^ help: replace it with: `let path = Self::disk_path()?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/lib.rs:199:24 [INFO] [stdout] | [INFO] [stdout] 199 | grid: load_map(&bp, &settings)?, [INFO] [stdout] | ^^^ help: change this to: `bp` [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 boolean expression can be simplified [INFO] [stdout] --> crates/tage_tui/src/lib.rs:500:16 [INFO] [stdout] | [INFO] [stdout] 500 | if !ui_state.winning_players.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ui_state.winning_players.is_none()` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/lib.rs:275:74 [INFO] [stdout] | [INFO] [stdout] 275 | let menu_input = MenuInput::from_events(&ui_state.settings.keybinds, &event_list); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `event_list` [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] --> crates/tage_tui/src/lib.rs:276:78 [INFO] [stdout] | [INFO] [stdout] 276 | let mut game_input = GameInput::from_events(&ui_state.settings.keybinds, &event_list); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `event_list` [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] --> crates/tage_tui/src/menu_main.rs:202:29 [INFO] [stdout] | [INFO] [stdout] 202 | blueprints: &board.bp(), [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `board.bp()` [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: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_main.rs:216:29 [INFO] [stdout] | [INFO] [stdout] 216 | frame.render_widget(Clear::default(), area) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 216 - frame.render_widget(Clear::default(), area) [INFO] [stdout] 216 + frame.render_widget(Clear, area) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:107:21 [INFO] [stdout] | [INFO] [stdout] 107 | / if ALLOWED_PATH_CHARS.contains(&c) && ui_state.member_profile.name.len() < 32 { [INFO] [stdout] 108 | | save.push(c) [INFO] [stdout] 109 | | } [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] 106 ~ Some(KeyCode::Char(c)) [INFO] [stdout] 107 ~ if ALLOWED_PATH_CHARS.contains(&c) && ui_state.member_profile.name.len() < 32 => { [INFO] [stdout] 108 | save.push(c) [INFO] [stdout] 109 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_tui/src/lib.rs:582:27 [INFO] [stdout] | [INFO] [stdout] 582 | .find(|p| match p.controller { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 583 | | Controller::Remote(raw_id) if raw_id == id.raw() => true, [INFO] [stdout] 584 | | _ => false, [INFO] [stdout] 585 | | }) [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] 582 - .find(|p| match p.controller { [INFO] [stdout] 583 - Controller::Remote(raw_id) if raw_id == id.raw() => true, [INFO] [stdout] 584 - _ => false, [INFO] [stdout] 585 - }) [INFO] [stdout] 582 + .find(|p| matches!(p.controller, Controller::Remote(raw_id) if raw_id == id.raw())) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `ClientId` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_tui/src/lib.rs:589:21 [INFO] [stdout] | [INFO] [stdout] 589 | id.clone(), [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*id` [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] --> crates/tage_tui/src/lib.rs:611:70 [INFO] [stdout] | [INFO] [stdout] 611 | terminal.draw(|frame| main_menu_state.render(frame, bp, net, &ui_state))?; [INFO] [stdout] | ^^^^^^^^^ help: change this to: `ui_state` [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: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:203:36 [INFO] [stdout] | [INFO] [stdout] 203 | Paragraph::new(format!("No actions have been taken in this turn")) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"No actions have been taken in this turn".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:242:32 [INFO] [stdout] | [INFO] [stdout] 242 | Paragraph::new(format!("{}", save)).alignment(Alignment::Center), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `save.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> crates/tage_tui/src/lib.rs:693:13 [INFO] [stdout] | [INFO] [stdout] 693 | / match menu_picker.choices.get(menu_picker.cursor) { [INFO] [stdout] 694 | | Some(MenuChoice::BuildArea(area)) => { [INFO] [stdout] 695 | | target = area.iter().collect(); [INFO] [stdout] ... | [INFO] [stdout] 698 | | } [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] 693 ~ if let Some(MenuChoice::BuildArea(area)) = menu_picker.choices.get(menu_picker.cursor) { [INFO] [stdout] 694 + target = area.iter().collect(); [INFO] [stdout] 695 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/lib.rs:704:33 [INFO] [stdout] | [INFO] [stdout] 704 | frame.render_widget(Clear::default(), details); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 704 - frame.render_widget(Clear::default(), details); [INFO] [stdout] 704 + frame.render_widget(Clear, details); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's values [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:282:17 [INFO] [stdout] | [INFO] [stdout] 282 | / net.get_members().iter().map(|(_id, member)| { [INFO] [stdout] 283 | | let color = Color::Rgb(member.color[0], member.color[1], member.color[2]); [INFO] [stdout] 284 | | Row::new(vec![Cell::new( [INFO] [stdout] 285 | | Line::from(member.name.clone()) [INFO] [stdout] ... | [INFO] [stdout] 288 | | )]) [INFO] [stdout] 289 | | }), [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] = note: `#[warn(clippy::iter_kv_map)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 282 ~ net.get_members().values().map(|member| { [INFO] [stdout] 283 + let color = Color::Rgb(member.color[0], member.color[1], member.color[2]); [INFO] [stdout] 284 + Row::new(vec![Cell::new( [INFO] [stdout] 285 + Line::from(member.name.clone()) [INFO] [stdout] 286 + .alignment(Alignment::Center) [INFO] [stdout] 287 + .style(Style::default().fg(text_color_contrast(color)).bg(color)), [INFO] [stdout] 288 + )]) [INFO] [stdout] 289 ~ }), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/lib.rs:732:33 [INFO] [stdout] | [INFO] [stdout] 732 | frame.render_widget(Clear::default(), details); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 732 - frame.render_widget(Clear::default(), details); [INFO] [stdout] 732 + frame.render_widget(Clear, details); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:336:29 [INFO] [stdout] | [INFO] [stdout] 336 | frame.render_widget(Clear::default(), area); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 336 - frame.render_widget(Clear::default(), area); [INFO] [stdout] 336 + frame.render_widget(Clear, area); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_tui/src/lib.rs:809:34 [INFO] [stdout] | [INFO] [stdout] 809 | .find(|node| match node.select { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 810 | | Select::Tile(xy) if xy == top_tile_picker.cursor => true, [INFO] [stdout] 811 | | _ => false, [INFO] [stdout] 812 | | }) [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] 809 - .find(|node| match node.select { [INFO] [stdout] 810 - Select::Tile(xy) if xy == top_tile_picker.cursor => true, [INFO] [stdout] 811 - _ => false, [INFO] [stdout] 812 - }) [INFO] [stdout] 809 + .find(|node| matches!(node.select, Select::Tile(xy) if xy == top_tile_picker.cursor)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `IVec2` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_tui/src/lib.rs:884:48 [INFO] [stdout] | [INFO] [stdout] 884 | ... atk_pos_moved: destination.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*destination` [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 `IVec2` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_tui/src/lib.rs:885:42 [INFO] [stdout] | [INFO] [stdout] 885 | ... def_pos: def_pos.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*def_pos` [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: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/lib.rs:898:45 [INFO] [stdout] | [INFO] [stdout] 898 | frame.render_widget(Clear::default(), inner); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 898 - frame.render_widget(Clear::default(), inner); [INFO] [stdout] 898 + frame.render_widget(Clear, inner); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:397:9 [INFO] [stdout] | [INFO] [stdout] 397 | tally_sorted.sort_by(|a, b| a.0 .0.cmp(&b.0 .0)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 397 - tally_sorted.sort_by(|a, b| a.0 .0.cmp(&b.0 .0)); [INFO] [stdout] 397 + tally_sorted.sort_by_key(|a| a.0 .0); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/lib.rs:920:45 [INFO] [stdout] | [INFO] [stdout] 920 | ... description += &format!("Current targets: "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Current targets: ".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/lib.rs:931:49 [INFO] [stdout] | [INFO] [stdout] 931 | ... description += &format!("more than 20 units"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"more than 20 units".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/lib.rs:933:45 [INFO] [stdout] | [INFO] [stdout] 933 | ... description += &format!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider using `.to_string()`: `"\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/lib.rs:954:45 [INFO] [stdout] | [INFO] [stdout] 954 | ... description += &format!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider using `.to_string()`: `"\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_tui/src/lib.rs:963:42 [INFO] [stdout] | [INFO] [stdout] 963 | ... .map(|s| Line::raw(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Line::raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:535:35 [INFO] [stdout] | [INFO] [stdout] 535 | "Terrain" => Some(bp.terrain.iter().map(|(id, _)| id.clone().into()).collect()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.terrain.keys().map(|id| id.clone().into())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:536:33 [INFO] [stdout] | [INFO] [stdout] 536 | "Units" => Some(bp.units.iter().map(|(id, _)| id.clone().into()).collect()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.units.keys().map(|id| id.clone().into())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:537:40 [INFO] [stdout] | [INFO] [stdout] 537 | "Technologies" => Some(bp.techs.iter().map(|(id, _)| id.clone().into()).collect()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.techs.keys().map(|id| id.clone().into())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:539:21 [INFO] [stdout] | [INFO] [stdout] 539 | / bp.abilities [INFO] [stdout] 540 | | .iter() [INFO] [stdout] 541 | | .map(|(id, _)| id.clone().into()) [INFO] [stdout] | |_________________________________________________________^ help: try: `bp.abilities.keys().map(|id| id.clone().into())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:544:34 [INFO] [stdout] | [INFO] [stdout] 544 | "Powers" => Some(bp.powers.iter().map(|(id, _)| id.clone().into()).collect()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `bp.powers.keys().map(|id| id.clone().into())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:546:21 [INFO] [stdout] | [INFO] [stdout] 546 | / bp.civilizations [INFO] [stdout] 547 | | .iter() [INFO] [stdout] 548 | | .map(|(id, _)| id.clone().into()) [INFO] [stdout] | |_________________________________________________________^ help: try: `bp.civilizations.keys().map(|id| id.clone().into())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:559:66 [INFO] [stdout] | [INFO] [stdout] 559 | list.sort_by(|a, b| bp.get(a).get_name().cmp(&bp.get(b).get_name())); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: change this to: `bp.get(b).get_name()` [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: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_tui/src/lib.rs:1064:20 [INFO] [stdout] | [INFO] [stdout] 1064 | if match menu_picker.choices.first() { [INFO] [stdout] | ____________________^ [INFO] [stdout] 1065 | | Some(MenuChoice::BuildArea(_)) => true, [INFO] [stdout] 1066 | | _ => false, [INFO] [stdout] 1067 | | } { [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] 1064 - if match menu_picker.choices.first() { [INFO] [stdout] 1065 - Some(MenuChoice::BuildArea(_)) => true, [INFO] [stdout] 1066 - _ => false, [INFO] [stdout] 1067 - } { [INFO] [stdout] 1064 + if matches!(menu_picker.choices.first(), Some(MenuChoice::BuildArea(_))) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/lib.rs:1082:41 [INFO] [stdout] | [INFO] [stdout] 1082 | frame.render_widget(Clear::default(), menu_bar); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 1082 - frame.render_widget(Clear::default(), menu_bar); [INFO] [stdout] 1082 + frame.render_widget(Clear, menu_bar); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/lib.rs:1154:33 [INFO] [stdout] | [INFO] [stdout] 1154 | frame.render_widget(Clear::default(), inner); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 1154 - frame.render_widget(Clear::default(), inner); [INFO] [stdout] 1154 + frame.render_widget(Clear, inner); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:755:53 [INFO] [stdout] | [INFO] [stdout] 755 | self.power.require_on_building.view(&self.bp) [INFO] [stdout] | ^^^^^^^^ help: change this to: `self.bp` [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: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/lib.rs:1233:25 [INFO] [stdout] | [INFO] [stdout] 1233 | frame.render_widget(Clear::default(), area); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 1233 - frame.render_widget(Clear::default(), area); [INFO] [stdout] 1233 + frame.render_widget(Clear, area); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:764:39 [INFO] [stdout] | [INFO] [stdout] 764 | self.power.bonus.view(&self.bp) [INFO] [stdout] | ^^^^^^^^ help: change this to: `self.bp` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> crates/tage_tui/src/lib.rs:1250:5 [INFO] [stdout] | [INFO] [stdout] 1249 | let inner = bordered(frame, inner); [INFO] [stdout] | ----------------------------------- unnecessary `let` binding [INFO] [stdout] 1250 | inner [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] 1249 ~ [INFO] [stdout] 1250 ~ bordered(frame, inner) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:770:45 [INFO] [stdout] | [INFO] [stdout] 770 | &self.power.unit_bonus.view(&self.bp) [INFO] [stdout] | ^^^^^^^^ help: change this to: `self.bp` [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] --> crates/tage_tui/src/menu_pause.rs:776:47 [INFO] [stdout] | [INFO] [stdout] 776 | &self.power.battle_bonus.view(&self.bp) [INFO] [stdout] | ^^^^^^^^ help: change this to: `self.bp` [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: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:780:29 [INFO] [stdout] | [INFO] [stdout] 780 | description += &format!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider using `.to_string()`: `"\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:482:21 [INFO] [stdout] | [INFO] [stdout] 482 | topics: vec![ [INFO] [stdout] | _____________________^ [INFO] [stdout] 483 | | "Terrain", [INFO] [stdout] 484 | | "Units", [INFO] [stdout] 485 | | "Technologies", [INFO] [stdout] ... | [INFO] [stdout] 489 | | "Base Bonuses", [INFO] [stdout] 490 | | ] [INFO] [stdout] | |_____________^ [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] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 482 ~ topics: ["Terrain", [INFO] [stdout] 483 + "Units", [INFO] [stdout] 484 + "Technologies", [INFO] [stdout] 485 + "Abilities", [INFO] [stdout] 486 + "Powers", [INFO] [stdout] 487 + "Civilization", [INFO] [stdout] 488 + "Base Bonuses"] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:788:22 [INFO] [stdout] | [INFO] [stdout] 788 | .map(|s| Line::raw(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Line::raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:890:24 [INFO] [stdout] | [INFO] [stdout] 890 | Paragraph::new(format!("{}", view_level(self.tech.level))).render(level, buf); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `view_level(self.tech.level).to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:1008:22 [INFO] [stdout] | [INFO] [stdout] 1008 | .map(|s| Line::raw(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Line::raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:64:29 [INFO] [stdout] | [INFO] [stdout] 64 | frame.render_widget(Clear::default(), area); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 64 - frame.render_widget(Clear::default(), area); [INFO] [stdout] 64 + frame.render_widget(Clear, area); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:127:13 [INFO] [stdout] | [INFO] [stdout] 127 | / match self.cursor { [INFO] [stdout] 128 | | 0 => { [INFO] [stdout] 129 | | let speed = match ui_state.settings.machine_speed { [INFO] [stdout] 130 | | MachineSpeed::Skip => MachineSpeed::StepMoves, [INFO] [stdout] ... | [INFO] [stdout] 138 | | _ => {} [INFO] [stdout] 139 | | } [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] 127 ~ if self.cursor == 0 { [INFO] [stdout] 128 + let speed = match ui_state.settings.machine_speed { [INFO] [stdout] 129 + MachineSpeed::Skip => MachineSpeed::StepMoves, [INFO] [stdout] 130 + MachineSpeed::StepMoves => MachineSpeed::StepMovesSlow, [INFO] [stdout] 131 + MachineSpeed::StepMovesSlow => MachineSpeed::Skip, [INFO] [stdout] 132 + MachineSpeed::StepSelects => todo!(), [INFO] [stdout] 133 + }; [INFO] [stdout] 134 + ui_state.settings.machine_speed = speed; [INFO] [stdout] 135 + ui_state.settings.to_disk(); [INFO] [stdout] 136 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:146:29 [INFO] [stdout] | [INFO] [stdout] 146 | frame.render_widget(Clear::default(), area); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 146 - frame.render_widget(Clear::default(), area); [INFO] [stdout] 146 + frame.render_widget(Clear, area); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:164:47 [INFO] [stdout] | [INFO] [stdout] 164 | MachineSpeed::Skip => format!("Skip"), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Skip".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:165:52 [INFO] [stdout] | [INFO] [stdout] 165 | MachineSpeed::StepMoves => format!("Step"), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Step".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:166:56 [INFO] [stdout] | [INFO] [stdout] 166 | MachineSpeed::StepMovesSlow => format!("Step slowly"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Step slowly".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:167:54 [INFO] [stdout] | [INFO] [stdout] 167 | MachineSpeed::StepSelects => format!("Step Detailed"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Step Detailed".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `KeyCode` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:209:21 [INFO] [stdout] | [INFO] [stdout] 209 | keycode.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*keycode` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:215:17 [INFO] [stdout] | [INFO] [stdout] 215 | self.cursor_keybinds = self.cursor_keybinds + input.acc.y; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `self.cursor_keybinds += input.acc.y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:262:29 [INFO] [stdout] | [INFO] [stdout] 262 | frame.render_widget(Clear::default(), area); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 262 - frame.render_widget(Clear::default(), area); [INFO] [stdout] 262 + frame.render_widget(Clear, area); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `KeyCode` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_tui/src/menu_settings.rs:308:31 [INFO] [stdout] | [INFO] [stdout] 308 | let key = self.keybinds.clone().get_key_from_string(c).clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*self.keybinds.clone().get_key_from_string(c)` [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: comparison to empty slice [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:232:28 [INFO] [stdout] | [INFO] [stdout] 232 | if map_settings.path != "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!map_settings.path.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:282:17 [INFO] [stdout] | [INFO] [stdout] 282 | / match message { [INFO] [stdout] 283 | | ClientMessages::MemberChange { member } => { [INFO] [stdout] 284 | | let player_list = next.get_player_list(); [INFO] [stdout] 285 | | if let Some(player_setting) = player_list.iter_mut().find(|p| { [INFO] [stdout] ... | [INFO] [stdout] 299 | | _ => {} [INFO] [stdout] 300 | | } [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] 282 ~ if let ClientMessages::MemberChange { member } = message { [INFO] [stdout] 283 + let player_list = next.get_player_list(); [INFO] [stdout] 284 + if let Some(player_setting) = player_list.iter_mut().find(|p| { [INFO] [stdout] 285 + if let Controller::Remote(raw) = p.controller { [INFO] [stdout] 286 + ClientId::from_raw(raw) == client_id [INFO] [stdout] 287 + } else { [INFO] [stdout] 288 + false [INFO] [stdout] 289 + } [INFO] [stdout] 290 + }) { [INFO] [stdout] 291 + player_setting.name = member.name; [INFO] [stdout] 292 + player_setting.symbol = member.symbol; [INFO] [stdout] 293 + player_setting.color = color_to_u32(member.color); [INFO] [stdout] 294 + player_setting.civilization = member.civilization; [INFO] [stdout] 295 + } [INFO] [stdout] 296 + send_settings = true; [INFO] [stdout] 297 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:323:21 [INFO] [stdout] | [INFO] [stdout] 323 | / if ALLOWED_NAME_CHARS.contains(&c) && select_name.len() < 32 { [INFO] [stdout] 324 | | select_name.push(c); [INFO] [stdout] 325 | | } [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] 322 ~ Some(KeyCode::Char(c)) [INFO] [stdout] 323 ~ if ALLOWED_NAME_CHARS.contains(&c) && select_name.len() < 32 => { [INFO] [stdout] 324 | select_name.push(c); [INFO] [stdout] 325 ~ } [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] --> crates/tage_tui/src/menu_lobby.rs:330:13 [INFO] [stdout] | [INFO] [stdout] 330 | / match input.keycode { [INFO] [stdout] 331 | | Some(KeyCode::Char(c)) => { [INFO] [stdout] 332 | | *select_symbol = c.to_string(); [INFO] [stdout] ... | [INFO] [stdout] 335 | | } [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] 330 ~ if let Some(KeyCode::Char(c)) = input.keycode { [INFO] [stdout] 331 + *select_symbol = c.to_string(); [INFO] [stdout] 332 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:354:25 [INFO] [stdout] | [INFO] [stdout] 354 | *cursor = *cursor + input.acc.y; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `*cursor += input.acc.y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:375:20 [INFO] [stdout] | [INFO] [stdout] 375 | if let Some(_) = net.error.pop() { [INFO] [stdout] | -------^^^^^^^------------------ help: try: `if net.error.pop().is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:394:21 [INFO] [stdout] | [INFO] [stdout] 394 | / match &mut net.connection { [INFO] [stdout] 395 | | Some(Connection::Client(client)) => { [INFO] [stdout] 396 | | let client_id = ClientId::from_raw(id); [INFO] [stdout] 397 | | if Some(client_id) == client.get_local_id() { [INFO] [stdout] ... | [INFO] [stdout] 404 | | _ => {} [INFO] [stdout] 405 | | } [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] 394 ~ if let Some(Connection::Client(client)) = &mut net.connection { [INFO] [stdout] 395 + let client_id = ClientId::from_raw(id); [INFO] [stdout] 396 + if Some(client_id) == client.get_local_id() { [INFO] [stdout] 397 + if let Some(member) = client.members.get_mut(&client_id) { [INFO] [stdout] 398 + member.name = select_name; [INFO] [stdout] 399 + send_member = Some(member.clone()); [INFO] [stdout] 400 + } [INFO] [stdout] 401 + } [INFO] [stdout] 402 + } [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] --> crates/tage_tui/src/menu_lobby.rs:411:21 [INFO] [stdout] | [INFO] [stdout] 411 | / match &mut net.connection { [INFO] [stdout] 412 | | Some(Connection::Client(client)) => { [INFO] [stdout] 413 | | let client_id = ClientId::from_raw(id); [INFO] [stdout] 414 | | if Some(client_id) == client.get_local_id() { [INFO] [stdout] ... | [INFO] [stdout] 421 | | _ => {} [INFO] [stdout] 422 | | } [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] 411 ~ if let Some(Connection::Client(client)) = &mut net.connection { [INFO] [stdout] 412 + let client_id = ClientId::from_raw(id); [INFO] [stdout] 413 + if Some(client_id) == client.get_local_id() { [INFO] [stdout] 414 + if let Some(member) = client.members.get_mut(&client_id) { [INFO] [stdout] 415 + member.symbol = select_symbol; [INFO] [stdout] 416 + send_member = Some(member.clone()); [INFO] [stdout] 417 + } [INFO] [stdout] 418 + } [INFO] [stdout] 419 + } [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] --> crates/tage_tui/src/menu_lobby.rs:458:21 [INFO] [stdout] | [INFO] [stdout] 458 | / match &mut net.connection { [INFO] [stdout] 459 | | Some(Connection::Client(client)) => { [INFO] [stdout] 460 | | let client_id = ClientId::from_raw(id); [INFO] [stdout] 461 | | if Some(client_id) == client.get_local_id() { [INFO] [stdout] ... | [INFO] [stdout] 471 | | _ => {} [INFO] [stdout] 472 | | } [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] 458 ~ if let Some(Connection::Client(client)) = &mut net.connection { [INFO] [stdout] 459 + let client_id = ClientId::from_raw(id); [INFO] [stdout] 460 + if Some(client_id) == client.get_local_id() { [INFO] [stdout] 461 + if let Some(member) = client.members.get_mut(&client_id) { [INFO] [stdout] 462 + member.civilization = bp [INFO] [stdout] 463 + .get_civilization(&select_civilization.choices[c]) [INFO] [stdout] 464 + .name [INFO] [stdout] 465 + .clone(); [INFO] [stdout] 466 + send_member = Some(member.clone()); [INFO] [stdout] 467 + } [INFO] [stdout] 468 + } [INFO] [stdout] 469 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:537:25 [INFO] [stdout] | [INFO] [stdout] 537 | / if !choices.is_empty() { [INFO] [stdout] 538 | | let local = if let Controller::Remote(id) = [INFO] [stdout] 539 | | &choices[*cursor as usize].controller [INFO] [stdout] ... | [INFO] [stdout] 613 | | } [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] 536 ~ } [INFO] [stdout] 537 ~ if !choices.is_empty() => { [INFO] [stdout] 538 | let local = if let Controller::Remote(id) = [INFO] [stdout] ... [INFO] [stdout] 612 | } [INFO] [stdout] 613 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:616:25 [INFO] [stdout] | [INFO] [stdout] 616 | / if next.chosen_map.is_some() { [INFO] [stdout] 617 | | next.map_settings = MapSettings { [INFO] [stdout] 618 | | players: next [INFO] [stdout] 619 | | .get_player_list() [INFO] [stdout] ... | [INFO] [stdout] 634 | | next_state = MenuState::Play(next.map_settings.clone()) [INFO] [stdout] 635 | | } [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] 615 ~ LobbySection::Start if !net.is_client() [INFO] [stdout] 616 ~ && next.chosen_map.is_some() => { [INFO] [stdout] 617 | next.map_settings = MapSettings { [INFO] [stdout] ... [INFO] [stdout] 634 | next_state = MenuState::Play(next.map_settings.clone()) [INFO] [stdout] 635 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: iterating on a map's keys [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:593:50 [INFO] [stdout] | [INFO] [stdout] 593 | ... choices: bp [INFO] [stdout] | ________________________________^ [INFO] [stdout] 594 | | ... .civilizations [INFO] [stdout] 595 | | ... .iter() [INFO] [stdout] 596 | | ... .map(|(id, _)| id.clone()) [INFO] [stdout] | |____________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_kv_map [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 593 ~ choices: bp [INFO] [stdout] 594 + .civilizations.keys().map(|id| id.clone()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:725:24 [INFO] [stdout] | [INFO] [stdout] 725 | if self.map_settings.path == "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.map_settings.path.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:790:45 [INFO] [stdout] | [INFO] [stdout] 790 | ... None => format!("Alone"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Alone".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:801:45 [INFO] [stdout] | [INFO] [stdout] 801 | ... format!("Host hotseat") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Host hotseat".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:803:45 [INFO] [stdout] | [INFO] [stdout] 803 | ... format!("Local player") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Local player".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:808:45 [INFO] [stdout] | [INFO] [stdout] 808 | ... format!("Host player") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Host player".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:811:45 [INFO] [stdout] | [INFO] [stdout] 811 | ... format!("Local player") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Local player".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:813:45 [INFO] [stdout] | [INFO] [stdout] 813 | ... format!("Remote player") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Remote player".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:817:41 [INFO] [stdout] | [INFO] [stdout] 817 | ... format!("Boulder Weak") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Boulder Weak".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:820:41 [INFO] [stdout] | [INFO] [stdout] 820 | ... format!("Boulder Average") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Boulder Average".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:823:41 [INFO] [stdout] | [INFO] [stdout] 823 | ... format!("Boulder Strong") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Boulder Strong".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:826:41 [INFO] [stdout] | [INFO] [stdout] 826 | ... format!("Peak Weak") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Peak Weak".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:829:41 [INFO] [stdout] | [INFO] [stdout] 829 | ... format!("Peak Average") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Peak Average".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:832:41 [INFO] [stdout] | [INFO] [stdout] 832 | ... format!("Peak Strong") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Peak Strong".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:835:41 [INFO] [stdout] | [INFO] [stdout] 835 | ... format!("Tuned Boulder") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Tuned Boulder".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:838:41 [INFO] [stdout] | [INFO] [stdout] 838 | ... format!("Tuned Peak") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Tuned Peak".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:844:33 [INFO] [stdout] | [INFO] [stdout] 844 | ... format!("{}", bp.get_civilization(&player.civ(bp)).name), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `bp.get_civilization(&player.civ(bp)).name.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:905:37 [INFO] [stdout] | [INFO] [stdout] 905 | frame.render_widget(Clear::default(), rest); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 905 - frame.render_widget(Clear::default(), rest); [INFO] [stdout] 905 + frame.render_widget(Clear, rest); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:955:37 [INFO] [stdout] | [INFO] [stdout] 955 | frame.render_widget(Clear::default(), center); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 955 - frame.render_widget(Clear::default(), center); [INFO] [stdout] 955 + frame.render_widget(Clear, center); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:972:33 [INFO] [stdout] | [INFO] [stdout] 972 | None => format!("Alone, all others are hostile"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Alone, all others are hostile".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:988:37 [INFO] [stdout] | [INFO] [stdout] 988 | frame.render_widget(Clear::default(), center); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 988 - frame.render_widget(Clear::default(), center); [INFO] [stdout] 988 + frame.render_widget(Clear, center); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1015:37 [INFO] [stdout] | [INFO] [stdout] 1015 | frame.render_widget(Clear::default(), center); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 1015 - frame.render_widget(Clear::default(), center); [INFO] [stdout] 1015 + frame.render_widget(Clear, center); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1036:37 [INFO] [stdout] | [INFO] [stdout] 1036 | frame.render_widget(Clear::default(), center); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 1036 - frame.render_widget(Clear::default(), center); [INFO] [stdout] 1036 + frame.render_widget(Clear, center); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1096:37 [INFO] [stdout] | [INFO] [stdout] 1096 | frame.render_widget(Clear::default(), center); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 1096 - frame.render_widget(Clear::default(), center); [INFO] [stdout] 1096 + frame.render_widget(Clear, center); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1128:37 [INFO] [stdout] | [INFO] [stdout] 1128 | frame.render_widget(Clear::default(), center); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 1128 - frame.render_widget(Clear::default(), center); [INFO] [stdout] 1128 + frame.render_widget(Clear, center); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1144:46 [INFO] [stdout] | [INFO] [stdout] 1144 | Controller::Human => format!("Local"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Local".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1147:29 [INFO] [stdout] | [INFO] [stdout] 1147 | ... format!("Machine Boulder Weak") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Machine Boulder Weak".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1150:29 [INFO] [stdout] | [INFO] [stdout] 1150 | ... format!("Machine Boulder Average") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Machine Boulder Average".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1153:29 [INFO] [stdout] | [INFO] [stdout] 1153 | ... format!("Machine Boulder Strong") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Machine Boulder Strong".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1156:29 [INFO] [stdout] | [INFO] [stdout] 1156 | ... format!("Machine Peak Weak") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Machine Peak Weak".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1159:29 [INFO] [stdout] | [INFO] [stdout] 1159 | ... format!("Machine Peak Average") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Machine Peak Average".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1162:29 [INFO] [stdout] | [INFO] [stdout] 1162 | ... format!("Machine Peak Strong") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Machine Peak Strong".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `net.error.get(0)` [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1182:30 [INFO] [stdout] | [INFO] [stdout] 1182 | if let Some(error) = net.error.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `net.error.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: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_lobby.rs:1214:29 [INFO] [stdout] | [INFO] [stdout] 1214 | frame.render_widget(Clear::default(), center); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 1214 - frame.render_widget(Clear::default(), center); [INFO] [stdout] 1214 + frame.render_widget(Clear, center); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/menu_load.rs:88:29 [INFO] [stdout] | [INFO] [stdout] 88 | frame.render_widget(Clear::default(), area); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 88 - frame.render_widget(Clear::default(), area); [INFO] [stdout] 88 + frame.render_widget(Clear, area); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/tage_tui/src/menu_profile.rs:40:21 [INFO] [stdout] | [INFO] [stdout] 40 | / if ALLOWED_NAME_CHARS.contains(&c) && ui_state.member_profile.name.len() < 32 { [INFO] [stdout] 41 | | ui_state.member_profile.name.push(c); [INFO] [stdout] 42 | | } [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] 39 ~ Some(KeyCode::Char(c)) [INFO] [stdout] 40 ~ if ALLOWED_NAME_CHARS.contains(&c) && ui_state.member_profile.name.len() < 32 => { [INFO] [stdout] 41 | ui_state.member_profile.name.push(c); [INFO] [stdout] 42 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/tage_tui/src/menu_profile.rs:54:21 [INFO] [stdout] | [INFO] [stdout] 54 | / if ALLOWED_NAME_CHARS.contains(&c) { [INFO] [stdout] 55 | | ui_state.member_profile.symbol = c.to_string(); [INFO] [stdout] 56 | | next.editing_symbol = false; [INFO] [stdout] 57 | | input.select = false; [INFO] [stdout] 58 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 53 ~ Some(KeyCode::Char(c)) [INFO] [stdout] 54 ~ if ALLOWED_NAME_CHARS.contains(&c) => { [INFO] [stdout] 55 | ui_state.member_profile.symbol = c.to_string(); [INFO] [stdout] 56 | next.editing_symbol = false; [INFO] [stdout] 57 | input.select = false; [INFO] [stdout] 58 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> crates/tage_tui/src/menu_profile.rs:140:26 [INFO] [stdout] | [INFO] [stdout] 140 | .zip(profile.into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:629:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 140 - .zip(profile.into_iter()) [INFO] [stdout] 140 + .zip(profile) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> crates/tage_tui/src/menu_connect.rs:39:21 [INFO] [stdout] | [INFO] [stdout] 39 | / if ALLOWED_IP_CHARS.contains(&c) && next.addr.len() < 20 { [INFO] [stdout] 40 | | next.addr.push(c); [INFO] [stdout] 41 | | } [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] 38 ~ Some(KeyCode::Char(c)) [INFO] [stdout] 39 ~ if ALLOWED_IP_CHARS.contains(&c) && next.addr.len() < 20 => { [INFO] [stdout] 40 | next.addr.push(c); [INFO] [stdout] 41 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `to_string` applied to a type that implements `Display` in `format!` args [INFO] [stdout] --> crates/tage_tui/src/menu_connect.rs:72:73 [INFO] [stdout] | [INFO] [stdout] 72 | ... Some(format!("Ip {}: {}\n\n{}", self.addr, e.to_string(), help)); [INFO] [stdout] | ^^^^^^^^^^^^ help: remove this [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_in_format_args [INFO] [stdout] = note: `#[warn(clippy::to_string_in_format_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator` [INFO] [stdout] --> crates/tage_tui/src/menu_connect.rs:109:26 [INFO] [stdout] | [INFO] [stdout] 109 | .zip(["", "", self.addr.as_str(), ""].into_iter()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: this parameter accepts any `IntoIterator`, so you don't need to call `.into_iter()` [INFO] [stdout] --> /rustc/3645249d79dfb136b5d8de3ce153d19d6698d92d/library/core/src/iter/traits/iterator.rs:629:11 [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] help: consider removing the `.into_iter()` [INFO] [stdout] | [INFO] [stdout] 109 - .zip(["", "", self.addr.as_str(), ""].into_iter()) [INFO] [stdout] 109 + .zip(["", "", self.addr.as_str(), ""]) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `render` doesn't need a mutable reference [INFO] [stdout] --> crates/tage_tui/src/lib.rs:147:13 [INFO] [stdout] | [INFO] [stdout] 147 | &mut game_state, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_mut_passed [INFO] [stdout] = note: `#[warn(clippy::unnecessary_mut_passed)]` on by default [INFO] [stdout] help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] 147 - &mut game_state, [INFO] [stdout] 147 + &game_state, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/lib.rs:199:24 [INFO] [stdout] | [INFO] [stdout] 199 | grid: load_map(&bp, &settings)?, [INFO] [stdout] | ^^^ help: change this to: `bp` [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 boolean expression can be simplified [INFO] [stdout] --> crates/tage_tui/src/lib.rs:500:16 [INFO] [stdout] | [INFO] [stdout] 500 | if !ui_state.winning_players.is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ui_state.winning_players.is_none()` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> crates/tage_tui/src/lib.rs:275:74 [INFO] [stdout] | [INFO] [stdout] 275 | let menu_input = MenuInput::from_events(&ui_state.settings.keybinds, &event_list); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `event_list` [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] --> crates/tage_tui/src/lib.rs:276:78 [INFO] [stdout] | [INFO] [stdout] 276 | let mut game_input = GameInput::from_events(&ui_state.settings.keybinds, &event_list); [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `event_list` [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: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_tui/src/lib.rs:582:27 [INFO] [stdout] | [INFO] [stdout] 582 | .find(|p| match p.controller { [INFO] [stdout] | ___________________________^ [INFO] [stdout] 583 | | Controller::Remote(raw_id) if raw_id == id.raw() => true, [INFO] [stdout] 584 | | _ => false, [INFO] [stdout] 585 | | }) [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] 582 - .find(|p| match p.controller { [INFO] [stdout] 583 - Controller::Remote(raw_id) if raw_id == id.raw() => true, [INFO] [stdout] 584 - _ => false, [INFO] [stdout] 585 - }) [INFO] [stdout] 582 + .find(|p| matches!(p.controller, Controller::Remote(raw_id) if raw_id == id.raw())) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `ClientId` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_tui/src/lib.rs:589:21 [INFO] [stdout] | [INFO] [stdout] 589 | id.clone(), [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*id` [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] --> crates/tage_tui/src/lib.rs:611:70 [INFO] [stdout] | [INFO] [stdout] 611 | terminal.draw(|frame| main_menu_state.render(frame, bp, net, &ui_state))?; [INFO] [stdout] | ^^^^^^^^^ help: change this to: `ui_state` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> crates/tage_tui/src/lib.rs:693:13 [INFO] [stdout] | [INFO] [stdout] 693 | / match menu_picker.choices.get(menu_picker.cursor) { [INFO] [stdout] 694 | | Some(MenuChoice::BuildArea(area)) => { [INFO] [stdout] 695 | | target = area.iter().collect(); [INFO] [stdout] ... | [INFO] [stdout] 698 | | } [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] 693 ~ if let Some(MenuChoice::BuildArea(area)) = menu_picker.choices.get(menu_picker.cursor) { [INFO] [stdout] 694 + target = area.iter().collect(); [INFO] [stdout] 695 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/lib.rs:704:33 [INFO] [stdout] | [INFO] [stdout] 704 | frame.render_widget(Clear::default(), details); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 704 - frame.render_widget(Clear::default(), details); [INFO] [stdout] 704 + frame.render_widget(Clear, details); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/lib.rs:732:33 [INFO] [stdout] | [INFO] [stdout] 732 | frame.render_widget(Clear::default(), details); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 732 - frame.render_widget(Clear::default(), details); [INFO] [stdout] 732 + frame.render_widget(Clear, details); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_tui/src/lib.rs:809:34 [INFO] [stdout] | [INFO] [stdout] 809 | .find(|node| match node.select { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 810 | | Select::Tile(xy) if xy == top_tile_picker.cursor => true, [INFO] [stdout] 811 | | _ => false, [INFO] [stdout] 812 | | }) [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] 809 - .find(|node| match node.select { [INFO] [stdout] 810 - Select::Tile(xy) if xy == top_tile_picker.cursor => true, [INFO] [stdout] 811 - _ => false, [INFO] [stdout] 812 - }) [INFO] [stdout] 809 + .find(|node| matches!(node.select, Select::Tile(xy) if xy == top_tile_picker.cursor)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `IVec2` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_tui/src/lib.rs:884:48 [INFO] [stdout] | [INFO] [stdout] 884 | ... atk_pos_moved: destination.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try dereferencing it: `*destination` [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 `IVec2` which implements the `Copy` trait [INFO] [stdout] --> crates/tage_tui/src/lib.rs:885:42 [INFO] [stdout] | [INFO] [stdout] 885 | ... def_pos: def_pos.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: try dereferencing it: `*def_pos` [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: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/lib.rs:898:45 [INFO] [stdout] | [INFO] [stdout] 898 | frame.render_widget(Clear::default(), inner); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 898 - frame.render_widget(Clear::default(), inner); [INFO] [stdout] 898 + frame.render_widget(Clear, inner); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/lib.rs:920:45 [INFO] [stdout] | [INFO] [stdout] 920 | ... description += &format!("Current targets: "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Current targets: ".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/lib.rs:931:49 [INFO] [stdout] | [INFO] [stdout] 931 | ... description += &format!("more than 20 units"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"more than 20 units".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/lib.rs:933:45 [INFO] [stdout] | [INFO] [stdout] 933 | ... description += &format!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider using `.to_string()`: `"\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> crates/tage_tui/src/lib.rs:954:45 [INFO] [stdout] | [INFO] [stdout] 954 | ... description += &format!("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^ help: consider using `.to_string()`: `"\n".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> crates/tage_tui/src/lib.rs:963:42 [INFO] [stdout] | [INFO] [stdout] 963 | ... .map(|s| Line::raw(s)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Line::raw` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> crates/tage_tui/src/lib.rs:1064:20 [INFO] [stdout] | [INFO] [stdout] 1064 | if match menu_picker.choices.first() { [INFO] [stdout] | ____________________^ [INFO] [stdout] 1065 | | Some(MenuChoice::BuildArea(_)) => true, [INFO] [stdout] 1066 | | _ => false, [INFO] [stdout] 1067 | | } { [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] 1064 - if match menu_picker.choices.first() { [INFO] [stdout] 1065 - Some(MenuChoice::BuildArea(_)) => true, [INFO] [stdout] 1066 - _ => false, [INFO] [stdout] 1067 - } { [INFO] [stdout] 1064 + if matches!(menu_picker.choices.first(), Some(MenuChoice::BuildArea(_))) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/lib.rs:1082:41 [INFO] [stdout] | [INFO] [stdout] 1082 | frame.render_widget(Clear::default(), menu_bar); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 1082 - frame.render_widget(Clear::default(), menu_bar); [INFO] [stdout] 1082 + frame.render_widget(Clear, menu_bar); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/lib.rs:1154:33 [INFO] [stdout] | [INFO] [stdout] 1154 | frame.render_widget(Clear::default(), inner); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 1154 - frame.render_widget(Clear::default(), inner); [INFO] [stdout] 1154 + frame.render_widget(Clear, inner); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `default` to create a unit struct [INFO] [stdout] --> crates/tage_tui/src/lib.rs:1233:25 [INFO] [stdout] | [INFO] [stdout] 1233 | frame.render_widget(Clear::default(), area); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#default_constructed_unit_structs [INFO] [stdout] help: remove this call to `default` [INFO] [stdout] | [INFO] [stdout] 1233 - frame.render_widget(Clear::default(), area); [INFO] [stdout] 1233 + frame.render_widget(Clear, area); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> crates/tage_tui/src/lib.rs:1250:5 [INFO] [stdout] | [INFO] [stdout] 1249 | let inner = bordered(frame, inner); [INFO] [stdout] | ----------------------------------- unnecessary `let` binding [INFO] [stdout] 1250 | inner [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] 1249 ~ [INFO] [stdout] 1250 ~ bordered(frame, inner) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> crates/tage_tui/src/menu_pause.rs:482:21 [INFO] [stdout] | [INFO] [stdout] 482 | topics: vec![ [INFO] [stdout] | _____________________^ [INFO] [stdout] 483 | | "Terrain", [INFO] [stdout] 484 | | "Units", [INFO] [stdout] 485 | | "Technologies", [INFO] [stdout] ... | [INFO] [stdout] 489 | | "Base Bonuses", [INFO] [stdout] 490 | | ] [INFO] [stdout] | |_____________^ [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] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 482 ~ topics: ["Terrain", [INFO] [stdout] 483 + "Units", [INFO] [stdout] 484 + "Technologies", [INFO] [stdout] 485 + "Abilities", [INFO] [stdout] 486 + "Powers", [INFO] [stdout] 487 + "Civilization", [INFO] [stdout] 488 + "Base Bonuses"] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking tage v0.1.0 (/opt/rustwide/workdir) [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 25.66s [INFO] running `Command { std: "docker" "inspect" "3b9fb82b86a043a142a5cf5168a150f7286c9c42841b97ee309bfe6cf8835734", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "3b9fb82b86a043a142a5cf5168a150f7286c9c42841b97ee309bfe6cf8835734", kill_on_drop: false }` [INFO] [stdout] 3b9fb82b86a043a142a5cf5168a150f7286c9c42841b97ee309bfe6cf8835734