[INFO] cloning repository https://github.com/skishore/wrl [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/skishore/wrl" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fskishore%2Fwrl", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fskishore%2Fwrl'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 948c22c522405895427af93571215a469f48e52e [INFO] linting skishore/wrl against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fskishore%2Fwrl" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/skishore/wrl [INFO] finished tweaking git repo https://github.com/skishore/wrl [INFO] tweaked toml for git repo https://github.com/skishore/wrl written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/skishore/wrl 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/skishore/wrl 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] Blocking waiting for file lock on package cache [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded termion v2.0.3 [INFO] [stderr] Downloaded game-loop v1.3.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] aabdd758f52415ae10161b5e419e9efb94354ad1e2525df398e05ba10fe910ee [INFO] running `Command { std: "docker" "start" "-a" "aabdd758f52415ae10161b5e419e9efb94354ad1e2525df398e05ba10fe910ee", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "aabdd758f52415ae10161b5e419e9efb94354ad1e2525df398e05ba10fe910ee", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "aabdd758f52415ae10161b5e419e9efb94354ad1e2525df398e05ba10fe910ee", kill_on_drop: false }` [INFO] [stdout] aabdd758f52415ae10161b5e419e9efb94354ad1e2525df398e05ba10fe910ee [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 79c234cb4898f2f608401d85611a6a9342def58e229edda31eece48719762550 [INFO] running `Command { std: "docker" "start" "-a" "79c234cb4898f2f608401d85611a6a9342def58e229edda31eece48719762550", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.178 [INFO] [stderr] Compiling zerocopy v0.8.31 [INFO] [stderr] Compiling getrandom v0.3.4 [INFO] [stderr] Compiling wasm-bindgen-shared v0.2.106 [INFO] [stderr] Compiling proc-macro2 v1.0.104 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Compiling slotmap v1.1.1 [INFO] [stderr] Compiling bumpalo v3.19.1 [INFO] [stderr] Checking unicode-ident v1.0.22 [INFO] [stderr] Checking numtoa v0.1.0 [INFO] [stderr] Checking once_cell v1.21.3 [INFO] [stderr] Checking game-loop v1.3.0 [INFO] [stderr] Checking flate2 v1.1.5 [INFO] [stderr] Compiling wasm-bindgen v0.2.106 [INFO] [stderr] Compiling quote v1.0.42 [INFO] [stderr] Compiling syn v2.0.112 [INFO] [stderr] Checking termion v2.0.3 [INFO] [stderr] Checking rand_core v0.9.3 [INFO] [stderr] Checking ppv-lite86 v0.2.21 [INFO] [stderr] Checking rand_chacha v0.9.0 [INFO] [stderr] Checking rand v0.9.2 [INFO] [stderr] Checking rand_distr v0.5.1 [INFO] [stderr] Compiling wasm-bindgen-macro-support v0.2.106 [INFO] [stderr] Checking wrl-base v0.1.0 (/opt/rustwide/workdir/base) [INFO] [stdout] warning: can be more succinctly written as a byte str [INFO] [stdout] --> base/src/debug.rs:260:21 [INFO] [stdout] | [INFO] [stdout] 260 | f.write_all(&[b'\0']) [INFO] [stdout] | ^^^^^^^^ help: try: `b"\0"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#byte_char_slices [INFO] [stdout] = note: `#[warn(clippy::byte_char_slices)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: can be more succinctly written as a byte str [INFO] [stdout] --> base/src/debug.rs:260:21 [INFO] [stdout] | [INFO] [stdout] 260 | f.write_all(&[b'\0']) [INFO] [stdout] | ^^^^^^^^ help: try: `b"\0"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#byte_char_slices [INFO] [stdout] = note: `#[warn(clippy::byte_char_slices)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider choosing a more descriptive name [INFO] [stdout] --> base/src/list.rs:528:13 [INFO] [stdout] | [INFO] [stdout] 528 | let _1 = list.push_front(1); [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#just_underscores_and_digits [INFO] [stdout] = note: `#[warn(clippy::just_underscores_and_digits)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider choosing a more descriptive name [INFO] [stdout] --> base/src/list.rs:529:13 [INFO] [stdout] | [INFO] [stdout] 529 | let _2 = list.push_back(2); [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#just_underscores_and_digits [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `ExplosionEffect` is never used [INFO] [stdout] --> base/src/effect.rs:240:4 [INFO] [stdout] | [INFO] [stdout] 240 | fn ExplosionEffect(point: Point) -> Effect { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `ImplosionEffect` is never used [INFO] [stdout] --> base/src/effect.rs:265:4 [INFO] [stdout] | [INFO] [stdout] 265 | fn ImplosionEffect(point: Point) -> Effect { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `RayEffect` is never used [INFO] [stdout] --> base/src/effect.rs:288:4 [INFO] [stdout] | [INFO] [stdout] 288 | fn RayEffect(source: Point, target: Point, speed: i32) -> Effect { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `SummonEffect` is never used [INFO] [stdout] --> base/src/effect.rs:302:8 [INFO] [stdout] | [INFO] [stdout] 302 | pub fn SummonEffect(source: Point, target: Point) -> Effect { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `WithdrawEffect` is never used [INFO] [stdout] --> base/src/effect.rs:314:8 [INFO] [stdout] | [INFO] [stdout] 314 | pub fn WithdrawEffect(source: Point, target: Point) -> Effect { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `SwitchEffect` is never used [INFO] [stdout] --> base/src/effect.rs:333:4 [INFO] [stdout] | [INFO] [stdout] 333 | fn SwitchEffect(source: Point, target: Point) -> Effect { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `choice` is never read [INFO] [stdout] --> base/src/ui.rs:104:5 [INFO] [stdout] | [INFO] [stdout] 101 | struct Layout { [INFO] [stdout] | ------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 104 | choice: Rect, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Summon` is never constructed [INFO] [stdout] --> base/src/ui.rs:194:5 [INFO] [stdout] | [INFO] [stdout] 192 | enum TargetData { [INFO] [stdout] | ---------- variant in this enum [INFO] [stdout] 193 | FarLook, [INFO] [stdout] 194 | Summon { index: usize, range: Bound }, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `end_menu_logging` is never used [INFO] [stdout] --> base/src/ui.rs:450:8 [INFO] [stdout] | [INFO] [stdout] 420 | impl Log { [INFO] [stdout] | -------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 450 | fn end_menu_logging(&mut self) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `index` and `summon` are never read [INFO] [stdout] --> base/src/ui.rs:492:5 [INFO] [stdout] | [INFO] [stdout] 491 | struct Menu { [INFO] [stdout] | ---- fields in this struct [INFO] [stdout] 492 | index: i32, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 493 | summon: i32, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `reserve` immediately after creation [INFO] [stdout] --> base/src/ai.rs:294:5 [INFO] [stdout] | [INFO] [stdout] 294 | / let mut result = vec![]; [INFO] [stdout] 295 | | result.reserve((ASSESS_STEPS * turns) as usize); [INFO] [stdout] | |____________________________________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut result = Vec::with_capacity((ASSESS_STEPS * turns) as usize);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [INFO] [stdout] = note: `#[warn(clippy::reserve_after_initialization)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> base/src/ai.rs:339:9 [INFO] [stdout] | [INFO] [stdout] 339 | std::f64::NEG_INFINITY, |acc, x| if acc > x.1 { acc } else { x.1 }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [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] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 339 - std::f64::NEG_INFINITY, |acc, x| if acc > x.1 { acc } else { x.1 }); [INFO] [stdout] 339 + f64::NEG_INFINITY, |acc, x| if acc > x.1 { acc } else { x.1 }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> base/src/ai.rs:344:17 [INFO] [stdout] | [INFO] [stdout] 344 | assert!(0 <= value && value < (1 << 16)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0..(1 << 16)).contains(&value)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> base/src/ai.rs:369:35 [INFO] [stdout] | [INFO] [stdout] 369 | let bonus0 = age_scale * (age as f64 + 1. / 16.); [INFO] [stdout] | ^^^^^^^^^^ help: try: `age` [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 multiplication by -1 can be written more succinctly [INFO] [stdout] --> base/src/ai.rs:424:14 [INFO] [stdout] | [INFO] [stdout] 424 | Some(-1.0 * d0 + -6.0 * d1 * decay + 12.0 * cos0 + 15.0 * cos1 + 4.0 * n as f64) [INFO] [stdout] | ^^^^^^^^^ help: consider using: `-d0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [INFO] [stdout] = note: `#[warn(clippy::neg_multiply)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> base/src/ai.rs:443:35 [INFO] [stdout] | [INFO] [stdout] 443 | let mut threat_distance = std::i32::MAX; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 443 - let mut threat_distance = std::i32::MAX; [INFO] [stdout] 443 + let mut threat_distance = i32::MAX; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this multiplication by -1 can be written more succinctly [INFO] [stdout] --> base/src/ai.rs:460:21 [INFO] [stdout] | [INFO] [stdout] 460 | -1. * scale * source_distance as f64 + [INFO] [stdout] | ^^^^^^^^^^^ help: consider using: `-scale` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> base/src/ai.rs:640:34 [INFO] [stdout] | [INFO] [stdout] 640 | let dirs = assess_directions(&dirs, ASSESS_TURNS_FLIGHT, rng); [INFO] [stdout] | ^^^^^ help: change this to: `dirs` [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: you are using an explicit closure for copying elements [INFO] [stdout] --> base/src/ai.rs:721:38 [INFO] [stdout] | [INFO] [stdout] 721 | if scores.is_empty() { *scores = cells.visited.iter().map(|&x| x).collect(); } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `cells.visited.iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> base/src/ai.rs:729:56 [INFO] [stdout] | [INFO] [stdout] 729 | let (mut best_point, mut best_score) = (None, (std::i32::MAX, std::i32::MAX)); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 729 - let (mut best_point, mut best_score) = (None, (std::i32::MAX, std::i32::MAX)); [INFO] [stdout] 729 + let (mut best_point, mut best_score) = (None, (i32::MAX, std::i32::MAX)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> base/src/ai.rs:729:71 [INFO] [stdout] | [INFO] [stdout] 729 | let (mut best_point, mut best_score) = (None, (std::i32::MAX, std::i32::MAX)); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 729 - let (mut best_point, mut best_score) = (None, (std::i32::MAX, std::i32::MAX)); [INFO] [stdout] 729 + let (mut best_point, mut best_score) = (None, (std::i32::MAX, i32::MAX)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `let...else` may be rewritten with the `?` operator [INFO] [stdout] --> base/src/ai.rs:736:9 [INFO] [stdout] | [INFO] [stdout] 736 | let Some(next) = best_point else { return None }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `let next = best_point?;` [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: usage of a legacy numeric constant [INFO] [stdout] --> base/src/ai.rs:975:21 [INFO] [stdout] | [INFO] [stdout] 975 | let mut best = (std::f64::NEG_INFINITY, None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 975 - let mut best = (std::f64::NEG_INFINITY, None); [INFO] [stdout] 975 + let mut best = (f64::NEG_INFINITY, None); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> base/src/ai.rs:1308:34 [INFO] [stdout] | [INFO] [stdout] 1308 | let dirs = assess_directions(&dirs, ASSESS_TURNS_FLIGHT, rng); [INFO] [stdout] | ^^^^^ help: change this to: `dirs` [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: unneeded unit return type [INFO] [stdout] --> base/src/bhv.rs:45:35 [INFO] [stdout] | [INFO] [stdout] 45 | pub fn on_exit ()>(self, f: F) -> Node> { [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: unneeded unit return type [INFO] [stdout] --> base/src/bhv.rs:49:35 [INFO] [stdout] | [INFO] [stdout] 49 | pub fn on_tick ()>(self, f: F) -> Node> { [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] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> base/src/bhv.rs:53:38 [INFO] [stdout] | [INFO] [stdout] 53 | pub fn on_running ()>(self, f: F) -> Node> { [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] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> base/src/bhv.rs:57:37 [INFO] [stdout] | [INFO] [stdout] 57 | pub fn post_tick ()>(self, f: F) -> Node> { [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] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> base/src/bhv.rs:82:12 [INFO] [stdout] | [INFO] [stdout] 82 | if self.last == None { return; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `self.last.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: unneeded unit return type [INFO] [stdout] --> base/src/bhv.rs:100:21 [INFO] [stdout] | [INFO] [stdout] 100 | impl (), T: Bhv> Bhv for OnExit { [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] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> base/src/bhv.rs:112:21 [INFO] [stdout] | [INFO] [stdout] 112 | impl (), T: Bhv> Bhv for OnTick { [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] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> base/src/bhv.rs:120:21 [INFO] [stdout] | [INFO] [stdout] 120 | impl (), T: Bhv> Bhv for OnRunning { [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] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> base/src/bhv.rs:132:21 [INFO] [stdout] | [INFO] [stdout] 132 | impl (), T: Bhv> Bhv for PostTick { [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] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> base/src/bhv.rs:238:38 [INFO] [stdout] | [INFO] [stdout] 238 | for x in &mut self.1 { x.1 = std::usize::MAX } [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 238 - for x in &mut self.1 { x.1 = std::usize::MAX } [INFO] [stdout] 238 + for x in &mut self.1 { x.1 = usize::MAX } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> base/src/debug.rs:44:65 [INFO] [stdout] | [INFO] [stdout] 44 | pub fn indent(&mut self, n: usize, f: impl Fn(&mut DebugLog) -> ()) { [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] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> base/src/debug.rs:102:9 [INFO] [stdout] | [INFO] [stdout] 102 | write!(self.file, "}}\n")?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] = note: `#[warn(clippy::write_with_newline)]` on by default [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 102 - write!(self.file, "}}\n")?; [INFO] [stdout] 102 + writeln!(self.file, "}}")?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `reserve` immediately after creation [INFO] [stdout] --> base/src/debug.rs:130:9 [INFO] [stdout] | [INFO] [stdout] 130 | / let mut xs = vec![]; [INFO] [stdout] 131 | | xs.reserve(frame.len()); [INFO] [stdout] | |________________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut xs = Vec::with_capacity(frame.len());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [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] --> base/src/debug.rs:135:41 [INFO] [stdout] | [INFO] [stdout] 135 | ParticleData::Sight(r) => { render_particle(x.point, r).map(|x| xs.push(x)); } [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] 135 - ParticleData::Sight(r) => { render_particle(x.point, r).map(|x| xs.push(x)); } [INFO] [stdout] 135 + ParticleData::Sight(r) => { if let Some(x) = render_particle(x.point, r) { xs.push(x) } } [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] --> base/src/debug.rs:136:44 [INFO] [stdout] | [INFO] [stdout] 136 | ParticleData::Sound(_, r) => { render_particle(x.point, r).map(|x| xs.push(x)); } [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] 136 - ParticleData::Sound(_, r) => { render_particle(x.point, r).map(|x| xs.push(x)); } [INFO] [stdout] 136 + ParticleData::Sound(_, r) => { if let Some(x) = render_particle(x.point, r) { xs.push(x) } } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> base/src/debug.rs:145:9 [INFO] [stdout] | [INFO] [stdout] 145 | write!(self.file, "}}\n")?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 145 - write!(self.file, "}}\n")?; [INFO] [stdout] 145 + writeln!(self.file, "}}")?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> base/src/debug.rs:159:46 [INFO] [stdout] | [INFO] [stdout] 159 | Self::write_array(&mut file, &frame)?; [INFO] [stdout] | ^^^^^^ help: change this to: `frame` [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: manual slice size calculation [INFO] [stdout] --> base/src/debug.rs:250:19 [INFO] [stdout] | [INFO] [stdout] 250 | let len = t.len() * std::mem::size_of::(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::mem::size_of_val(t)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_slice_size_calculation [INFO] [stdout] = note: `#[warn(clippy::manual_slice_size_calculation)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use `std::ptr::eq` when comparing raw pointers [INFO] [stdout] --> base/src/dex.rs:87:9 [INFO] [stdout] | [INFO] [stdout] 87 | *self as *const Species == *next as *const Species [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(*self, *next)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq [INFO] [stdout] = note: `#[warn(clippy::ptr_eq)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `line` [INFO] [stdout] --> base/src/effect.rs:306:14 [INFO] [stdout] | [INFO] [stdout] 306 | for i in 1..line.len() - 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 306 - for i in 1..line.len() - 1 { [INFO] [stdout] 306 + for in line.iter().take(line.len() - 1).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `line` [INFO] [stdout] --> base/src/effect.rs:361:14 [INFO] [stdout] | [INFO] [stdout] 361 | for i in 1..line.len() - 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 361 - for i in 1..line.len() - 1 { [INFO] [stdout] 361 + for (i, ) in line.iter().enumerate().take(line.len() - 1).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `line` [INFO] [stdout] --> base/src/effect.rs:398:14 [INFO] [stdout] | [INFO] [stdout] 398 | for i in 1..line.len() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 398 - for i in 1..line.len() { [INFO] [stdout] 398 + for (i, ) in line.iter().enumerate().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EID` contains a capitalized acronym [INFO] [stdout] --> base/src/entity.rs:130:12 [INFO] [stdout] | [INFO] [stdout] 130 | pub struct EID(NonZeroU64); [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Eid` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> base/src/knowledge.rs:114:36 [INFO] [stdout] | [INFO] [stdout] 114 | Timestamp((self.0 as i64 - other.0 as i64) as u64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `other.0` [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: name `UID` contains a capitalized acronym [INFO] [stdout] --> base/src/knowledge.rs:137:12 [INFO] [stdout] | [INFO] [stdout] 137 | pub struct UID(NonZeroU64); [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Uid` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> base/src/knowledge.rs:369:9 [INFO] [stdout] | [INFO] [stdout] 369 | return format!("{:?} - >{} turns ago", self.time - time, MAX_TURN_MEMORY); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 369 - return format!("{:?} - >{} turns ago", self.time - time, MAX_TURN_MEMORY); [INFO] [stdout] 369 + format!("{:?} - >{} turns ago", self.time - time, MAX_TURN_MEMORY) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> base/src/knowledge.rs:386:9 [INFO] [stdout] | [INFO] [stdout] 386 | self.turn_times.get((turn - 1) as usize).map(|&x| x).unwrap_or_default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `self.turn_times.get((turn - 1) as usize).copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> base/src/knowledge.rs:583:63 [INFO] [stdout] | [INFO] [stdout] 583 | self.sources.push_front(SourceKnowledge::new(uid, &event)) [INFO] [stdout] | ^^^^^^ help: change this to: `event` [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 closure [INFO] [stdout] --> base/src/lighting.rs:61:49 [INFO] [stdout] | [INFO] [stdout] 61 | visions: (0..=MAX_LIGHT_RADIUS).map(|x| Vision::new(x)).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vision::new` [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: non-canonical implementation of `clone` on a `Copy` type [INFO] [stdout] --> base/src/list.rs:68:29 [INFO] [stdout] | [INFO] [stdout] 68 | fn clone(&self) -> Self { Self(self.0, PhantomData) } [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#non_canonical_clone_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_clone_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> base/src/list.rs:114:22 [INFO] [stdout] | [INFO] [stdout] 114 | fn to_free_index(&self) -> Index { Index(self.0 | 1) } [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 `Copy`) usually take `self` by value [INFO] [stdout] --> base/src/list.rs:116:22 [INFO] [stdout] | [INFO] [stdout] 116 | fn to_used_index(&self) -> Index { Index(self.0 & !1) } [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: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> base/src/pathing.rs:565:40 [INFO] [stdout] | [INFO] [stdout] 565 | if result.visited.len() >= (cells as usize) { break; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `cells` [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: use `std::ptr::eq` when comparing raw pointers [INFO] [stdout] --> base/src/shadowcast.rs:293:17 [INFO] [stdout] | [INFO] [stdout] 293 | x.transform as *const Transform == s.transform as *const Transform { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(x.transform, s.transform)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `TID` contains a capitalized acronym [INFO] [stdout] --> base/src/threats.rs:256:10 [INFO] [stdout] | [INFO] [stdout] 256 | pub enum TID { CID, EID(EID), UID(UID) } [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Tid` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `CID` contains a capitalized acronym [INFO] [stdout] --> base/src/threats.rs:256:16 [INFO] [stdout] | [INFO] [stdout] 256 | pub enum TID { CID, EID(EID), UID(UID) } [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Cid` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EID` contains a capitalized acronym [INFO] [stdout] --> base/src/threats.rs:256:21 [INFO] [stdout] | [INFO] [stdout] 256 | pub enum TID { CID, EID(EID), UID(UID) } [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Eid` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `UID` contains a capitalized acronym [INFO] [stdout] --> base/src/threats.rs:256:31 [INFO] [stdout] | [INFO] [stdout] 256 | pub enum TID { CID, EID(EID), UID(UID) } [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Uid` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> base/src/threats.rs:433:33 [INFO] [stdout] | [INFO] [stdout] 433 | let tid = event.eid.map(|x| TID::EID(x)).or(event.uid.map(|x| TID::UID(x)))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `TID::EID` [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] --> base/src/threats.rs:433:67 [INFO] [stdout] | [INFO] [stdout] 433 | let tid = event.eid.map(|x| TID::EID(x)).or(event.uid.map(|x| TID::UID(x)))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `TID::UID` [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: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> base/src/ui.rs:79:11 [INFO] [stdout] | [INFO] [stdout] 79 | fn rivals<'a>(me: &'a Entity) -> Vec<&'a EntityKnowledge> { [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] 79 - fn rivals<'a>(me: &'a Entity) -> Vec<&'a EntityKnowledge> { [INFO] [stdout] 79 + fn rivals(me: &Entity) -> Vec<&EntityKnowledge> { [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] --> base/src/ui.rs:364:13 [INFO] [stdout] | [INFO] [stdout] 364 | target.as_mut().map(|x| update_target(known, x, update)); [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] 364 - target.as_mut().map(|x| update_target(known, x, update)); [INFO] [stdout] 364 + if let Some(x) = target.as_mut() { update_target(known, x, update) } [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] --> base/src/ui.rs:451:9 [INFO] [stdout] | [INFO] [stdout] 451 | self.lines.last_mut().map(|x| x.menu = false); [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] 451 - self.lines.last_mut().map(|x| x.menu = false); [INFO] [stdout] 451 + if let Some(x) = self.lines.last_mut() { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> base/src/ui.rs:739:20 [INFO] [stdout] | [INFO] [stdout] 739 | if !((i + count - frame) % count < 2) { continue; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `((i + count - frame) % count >= 2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> base/src/ui.rs:886:44 [INFO] [stdout] | [INFO] [stdout] 886 | for (_, &key) in SUMMON_KEYS.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 886 - for (_, &key) in SUMMON_KEYS.iter().enumerate() { [INFO] [stdout] 886 + for &key in SUMMON_KEYS.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `unwrap_or` to construct default value [INFO] [stdout] --> base/src/ui.rs:1055:53 [INFO] [stdout] | [INFO] [stdout] 1055 | let prefix = key.map(|x| UI::render_key(x)).unwrap_or(String::default()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> base/src/ui.rs:1055:30 [INFO] [stdout] | [INFO] [stdout] 1055 | let prefix = key.map(|x| UI::render_key(x)).unwrap_or(String::default()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `UI::render_key` [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 assertion is always `false` [INFO] [stdout] --> base/src/base.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 43 | assert!(false); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: replace this with `panic!()` or `unreachable!()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] = note: `#[warn(clippy::assertions_on_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `let...else` may be rewritten with the `?` operator [INFO] [stdout] --> base/src/base.rs:299:9 [INFO] [stdout] | [INFO] [stdout] 299 | let Some(x) = self.index(point) else { return None; }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `let x = self.index(point)?;` [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: use `std::ptr::eq` when comparing raw pointers [INFO] [stdout] --> base/src/game.rs:116:9 [INFO] [stdout] | [INFO] [stdout] 116 | *self as *const Tile == *next as *const Tile [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(*self, *next)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq [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] --> base/src/game.rs:158:5 [INFO] [stdout] | [INFO] [stdout] 158 | line.get_mut(..1).map(|x| x.make_ascii_uppercase()); line [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] 158 - line.get_mut(..1).map(|x| x.make_ascii_uppercase()); line [INFO] [stdout] 158 + if let Some(x) = line.get_mut(..1) { x.make_ascii_uppercase() } line [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `FOV` contains a capitalized acronym [INFO] [stdout] --> base/src/game.rs:173:8 [INFO] [stdout] | [INFO] [stdout] 173 | struct FOV { [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Fov` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> base/src/game.rs:354:9 [INFO] [stdout] | [INFO] [stdout] 354 | env.debug.as_mut().map(|x| x.record_frame(self, &frame)); [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] 354 - env.debug.as_mut().map(|x| x.record_frame(self, &frame)); [INFO] [stdout] 354 + if let Some(x) = env.debug.as_mut() { x.record_frame(self, &frame) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self._effect.frames.get(0)` [INFO] [stdout] --> base/src/game.rs:387:27 [INFO] [stdout] | [INFO] [stdout] 387 | let Some(frame) = self._effect.frames.get(0) else { return }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self._effect.frames.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: accessing first element with `self._effect.frames.get(0)` [INFO] [stdout] --> base/src/game.rs:416:27 [INFO] [stdout] | [INFO] [stdout] 416 | let Some(frame) = self._effect.frames.get(0).cloned() else { return }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self._effect.frames.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing an `Option` with `Some(..)` [INFO] [stdout] --> base/src/game.rs:486:20 [INFO] [stdout] | [INFO] [stdout] 486 | let prev = replace(&mut cell.eid, Some(eid)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::replace()` instead: `cell.eid.replace(eid)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_some [INFO] [stdout] = note: `#[warn(clippy::mem_replace_option_with_some)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing an `Option` with `None` [INFO] [stdout] --> base/src/game.rs:504:19 [INFO] [stdout] | [INFO] [stdout] 504 | let old = replace(&mut self.map.entry_mut(source).unwrap().eid, None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `self.map.entry_mut(source).unwrap().eid.take()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none [INFO] [stdout] = note: `#[warn(clippy::mem_replace_option_with_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the method `observe_event` doesn't need a mutable reference [INFO] [stdout] --> base/src/game.rs:567:29 [INFO] [stdout] | [INFO] [stdout] 567 | known.observe_event(&mut self.entities[eid], e); [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] 567 - known.observe_event(&mut self.entities[eid], e); [INFO] [stdout] 567 + known.observe_event(&self.entities[eid], e); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> base/src/game.rs:585:34 [INFO] [stdout] | [INFO] [stdout] 585 | let vision = fov.compute(&self, me); [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] --> base/src/game.rs:586:26 [INFO] [stdout] | [INFO] [stdout] 586 | known.update(me, &self, vision, rng); [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 `[Point; 8]` which implements the `Copy` trait [INFO] [stdout] --> base/src/game.rs:721:27 [INFO] [stdout] | [INFO] [stdout] 721 | let options: Vec<_> = dirs::ALL.clone().into_iter().filter( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `dirs::ALL` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> base/src/game.rs:872:26 [INFO] [stdout] | [INFO] [stdout] 872 | let action = ai.plan(&entity, env); [INFO] [stdout] | ^^^^^^^ help: change this to: `entity` [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 closure [INFO] [stdout] --> base/src/game.rs:1316:28 [INFO] [stdout] | [INFO] [stdout] 1316 | let rng = seed.map(|x| RNG::seed_from_u64(x)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `RNG::seed_from_u64` [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] --> base/src/game.rs:1317:38 [INFO] [stdout] | [INFO] [stdout] 1317 | let rng = rng.unwrap_or_else(|| RNG::from_os_rng()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `RNG::from_os_rng` [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: creating a new box with default content [INFO] [stdout] --> base/src/game.rs:1352:13 [INFO] [stdout] | [INFO] [stdout] 1352 | board.entities[player].known = Default::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with default instead: `*board.entities[player].known = Default::default()` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] = note: `#[warn(clippy::replace_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `std::mem::drop` with a value that does not implement `Drop`. Dropping such a type only extends its contained lifetimes [INFO] [stdout] --> base/src/game.rs:1383:9 [INFO] [stdout] | [INFO] [stdout] 1383 | std::mem::drop(Weather::Rain(Point(0, 64), 32)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: argument has type `game::Weather` [INFO] [stdout] --> base/src/game.rs:1383:24 [INFO] [stdout] | [INFO] [stdout] 1383 | std::mem::drop(Weather::Rain(Point(0, 64), 32)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#drop_non_drop [INFO] [stdout] = note: `#[warn(clippy::drop_non_drop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> base/src/mapgen.rs:59:9 [INFO] [stdout] | [INFO] [stdout] 59 | result.size = size; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `mapgen::MapgenConfig { size: size, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> base/src/mapgen.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | let mut result = Self::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> base/src/mapgen.rs:195:26 [INFO] [stdout] | [INFO] [stdout] 195 | let mut best_score = std::i64::MAX; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 195 - let mut best_score = std::i64::MAX; [INFO] [stdout] 195 + let mut best_score = i64::MAX; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> base/src/mapgen.rs:247:31 [INFO] [stdout] | [INFO] [stdout] 247 | let mut options: Vec<_> = options.iter().map(|&x| x).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `options.iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting float literal to `f64` is unnecessary [INFO] [stdout] --> base/src/mapgen.rs:277:30 [INFO] [stdout] | [INFO] [stdout] 277 | let period = scale / (2.0 as f64).powi(octave); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `2.0_f64` [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: usage of a legacy numeric constant [INFO] [stdout] --> base/src/mapgen.rs:397:26 [INFO] [stdout] | [INFO] [stdout] 397 | let sentinel = Point(std::i32::MAX, std::i32::MAX); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 397 - let sentinel = Point(std::i32::MAX, std::i32::MAX); [INFO] [stdout] 397 + let sentinel = Point(i32::MAX, std::i32::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> base/src/mapgen.rs:397:41 [INFO] [stdout] | [INFO] [stdout] 397 | let sentinel = Point(std::i32::MAX, std::i32::MAX); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 397 - let sentinel = Point(std::i32::MAX, std::i32::MAX); [INFO] [stdout] 397 + let sentinel = Point(std::i32::MAX, i32::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> base/src/mapgen.rs:480:56 [INFO] [stdout] | [INFO] [stdout] 480 | let (p1, p2) = *sample(&find_closest_pairs(&r1, &r2), rng); [INFO] [stdout] | ^^^ help: change this to: `r1` [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] --> base/src/mapgen.rs:480:61 [INFO] [stdout] | [INFO] [stdout] 480 | let (p1, p2) = *sample(&find_closest_pairs(&r1, &r2), rng); [INFO] [stdout] | ^^^ help: change this to: `r2` [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: feature `test` is declared but not used [INFO] [stdout] --> base/src/lib.rs:1:12 [INFO] [stdout] | [INFO] [stdout] 1 | #![feature(test)] [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_features)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking wrl-term v0.1.0 (/opt/rustwide/workdir/term) [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> base/src/bin/mapgen-test.rs:32:23 [INFO] [stdout] | [INFO] [stdout] 32 | (ch, (0xff as u32, 0xff as u32, 0xff as u32)) [INFO] [stdout] | ^^^^^^^^^^^ help: try: `0xff_u32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> base/src/bin/mapgen-test.rs:32:36 [INFO] [stdout] | [INFO] [stdout] 32 | (ch, (0xff as u32, 0xff as u32, 0xff as u32)) [INFO] [stdout] | ^^^^^^^^^^^ help: try: `0xff_u32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> base/src/bin/mapgen-test.rs:32:49 [INFO] [stdout] | [INFO] [stdout] 32 | (ch, (0xff as u32, 0xff as u32, 0xff as u32)) [INFO] [stdout] | ^^^^^^^^^^^ help: try: `0xff_u32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> base/src/bin/mapgen-test.rs:32:23 [INFO] [stdout] | [INFO] [stdout] 32 | (ch, (0xff as u32, 0xff as u32, 0xff as u32)) [INFO] [stdout] | ^^^^^^^^^^^ help: try: `0xff_u32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> base/src/bin/mapgen-test.rs:32:36 [INFO] [stdout] | [INFO] [stdout] 32 | (ch, (0xff as u32, 0xff as u32, 0xff as u32)) [INFO] [stdout] | ^^^^^^^^^^^ help: try: `0xff_u32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `u32` is unnecessary [INFO] [stdout] --> base/src/bin/mapgen-test.rs:32:49 [INFO] [stdout] | [INFO] [stdout] 32 | (ch, (0xff as u32, 0xff as u32, 0xff as u32)) [INFO] [stdout] | ^^^^^^^^^^^ help: try: `0xff_u32` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `ExplosionEffect` is never used [INFO] [stdout] --> base/src/effect.rs:240:4 [INFO] [stdout] | [INFO] [stdout] 240 | fn ExplosionEffect(point: Point) -> Effect { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `ImplosionEffect` is never used [INFO] [stdout] --> base/src/effect.rs:265:4 [INFO] [stdout] | [INFO] [stdout] 265 | fn ImplosionEffect(point: Point) -> Effect { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `RayEffect` is never used [INFO] [stdout] --> base/src/effect.rs:288:4 [INFO] [stdout] | [INFO] [stdout] 288 | fn RayEffect(source: Point, target: Point, speed: i32) -> Effect { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `SummonEffect` is never used [INFO] [stdout] --> base/src/effect.rs:302:8 [INFO] [stdout] | [INFO] [stdout] 302 | pub fn SummonEffect(source: Point, target: Point) -> Effect { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `WithdrawEffect` is never used [INFO] [stdout] --> base/src/effect.rs:314:8 [INFO] [stdout] | [INFO] [stdout] 314 | pub fn WithdrawEffect(source: Point, target: Point) -> Effect { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `SwitchEffect` is never used [INFO] [stdout] --> base/src/effect.rs:333:4 [INFO] [stdout] | [INFO] [stdout] 333 | fn SwitchEffect(source: Point, target: Point) -> Effect { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `choice` is never read [INFO] [stdout] --> base/src/ui.rs:104:5 [INFO] [stdout] | [INFO] [stdout] 101 | struct Layout { [INFO] [stdout] | ------ field in this struct [INFO] [stdout] ... [INFO] [stdout] 104 | choice: Rect, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Summon` is never constructed [INFO] [stdout] --> base/src/ui.rs:194:5 [INFO] [stdout] | [INFO] [stdout] 192 | enum TargetData { [INFO] [stdout] | ---------- variant in this enum [INFO] [stdout] 193 | FarLook, [INFO] [stdout] 194 | Summon { index: usize, range: Bound }, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `end_menu_logging` is never used [INFO] [stdout] --> base/src/ui.rs:450:8 [INFO] [stdout] | [INFO] [stdout] 420 | impl Log { [INFO] [stdout] | -------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 450 | fn end_menu_logging(&mut self) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `index` and `summon` are never read [INFO] [stdout] --> base/src/ui.rs:492:5 [INFO] [stdout] | [INFO] [stdout] 491 | struct Menu { [INFO] [stdout] | ---- fields in this struct [INFO] [stdout] 492 | index: i32, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 493 | summon: i32, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `reserve` immediately after creation [INFO] [stdout] --> base/src/ai.rs:294:5 [INFO] [stdout] | [INFO] [stdout] 294 | / let mut result = vec![]; [INFO] [stdout] 295 | | result.reserve((ASSESS_STEPS * turns) as usize); [INFO] [stdout] | |____________________________________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut result = Vec::with_capacity((ASSESS_STEPS * turns) as usize);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [INFO] [stdout] = note: `#[warn(clippy::reserve_after_initialization)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> base/src/ai.rs:339:9 [INFO] [stdout] | [INFO] [stdout] 339 | std::f64::NEG_INFINITY, |acc, x| if acc > x.1 { acc } else { x.1 }); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [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] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 339 - std::f64::NEG_INFINITY, |acc, x| if acc > x.1 { acc } else { x.1 }); [INFO] [stdout] 339 + f64::NEG_INFINITY, |acc, x| if acc > x.1 { acc } else { x.1 }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `Range::contains` implementation [INFO] [stdout] --> base/src/ai.rs:344:17 [INFO] [stdout] | [INFO] [stdout] 344 | assert!(0 <= value && value < (1 << 16)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0..(1 << 16)).contains(&value)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f64` -> `f64`) [INFO] [stdout] --> base/src/ai.rs:369:35 [INFO] [stdout] | [INFO] [stdout] 369 | let bonus0 = age_scale * (age as f64 + 1. / 16.); [INFO] [stdout] | ^^^^^^^^^^ help: try: `age` [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 multiplication by -1 can be written more succinctly [INFO] [stdout] --> base/src/ai.rs:424:14 [INFO] [stdout] | [INFO] [stdout] 424 | Some(-1.0 * d0 + -6.0 * d1 * decay + 12.0 * cos0 + 15.0 * cos1 + 4.0 * n as f64) [INFO] [stdout] | ^^^^^^^^^ help: consider using: `-d0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [INFO] [stdout] = note: `#[warn(clippy::neg_multiply)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> base/src/ai.rs:443:35 [INFO] [stdout] | [INFO] [stdout] 443 | let mut threat_distance = std::i32::MAX; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 443 - let mut threat_distance = std::i32::MAX; [INFO] [stdout] 443 + let mut threat_distance = i32::MAX; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this multiplication by -1 can be written more succinctly [INFO] [stdout] --> base/src/ai.rs:460:21 [INFO] [stdout] | [INFO] [stdout] 460 | -1. * scale * source_distance as f64 + [INFO] [stdout] | ^^^^^^^^^^^ help: consider using: `-scale` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#neg_multiply [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> base/src/ai.rs:640:34 [INFO] [stdout] | [INFO] [stdout] 640 | let dirs = assess_directions(&dirs, ASSESS_TURNS_FLIGHT, rng); [INFO] [stdout] | ^^^^^ help: change this to: `dirs` [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: you are using an explicit closure for copying elements [INFO] [stdout] --> base/src/ai.rs:721:38 [INFO] [stdout] | [INFO] [stdout] 721 | if scores.is_empty() { *scores = cells.visited.iter().map(|&x| x).collect(); } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `cells.visited.iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> base/src/ai.rs:729:56 [INFO] [stdout] | [INFO] [stdout] 729 | let (mut best_point, mut best_score) = (None, (std::i32::MAX, std::i32::MAX)); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 729 - let (mut best_point, mut best_score) = (None, (std::i32::MAX, std::i32::MAX)); [INFO] [stdout] 729 + let (mut best_point, mut best_score) = (None, (i32::MAX, std::i32::MAX)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> base/src/ai.rs:729:71 [INFO] [stdout] | [INFO] [stdout] 729 | let (mut best_point, mut best_score) = (None, (std::i32::MAX, std::i32::MAX)); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 729 - let (mut best_point, mut best_score) = (None, (std::i32::MAX, std::i32::MAX)); [INFO] [stdout] 729 + let (mut best_point, mut best_score) = (None, (std::i32::MAX, i32::MAX)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `let...else` may be rewritten with the `?` operator [INFO] [stdout] --> base/src/ai.rs:736:9 [INFO] [stdout] | [INFO] [stdout] 736 | let Some(next) = best_point else { return None }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `let next = best_point?;` [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: usage of a legacy numeric constant [INFO] [stdout] --> base/src/ai.rs:975:21 [INFO] [stdout] | [INFO] [stdout] 975 | let mut best = (std::f64::NEG_INFINITY, None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 975 - let mut best = (std::f64::NEG_INFINITY, None); [INFO] [stdout] 975 + let mut best = (f64::NEG_INFINITY, None); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> base/src/ai.rs:1308:34 [INFO] [stdout] | [INFO] [stdout] 1308 | let dirs = assess_directions(&dirs, ASSESS_TURNS_FLIGHT, rng); [INFO] [stdout] | ^^^^^ help: change this to: `dirs` [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: unneeded unit return type [INFO] [stdout] --> base/src/bhv.rs:45:35 [INFO] [stdout] | [INFO] [stdout] 45 | pub fn on_exit ()>(self, f: F) -> Node> { [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: unneeded unit return type [INFO] [stdout] --> base/src/bhv.rs:49:35 [INFO] [stdout] | [INFO] [stdout] 49 | pub fn on_tick ()>(self, f: F) -> Node> { [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] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> base/src/bhv.rs:53:38 [INFO] [stdout] | [INFO] [stdout] 53 | pub fn on_running ()>(self, f: F) -> Node> { [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] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> base/src/bhv.rs:57:37 [INFO] [stdout] | [INFO] [stdout] 57 | pub fn post_tick ()>(self, f: F) -> Node> { [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] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> base/src/bhv.rs:82:12 [INFO] [stdout] | [INFO] [stdout] 82 | if self.last == None { return; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `self.last.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: unneeded unit return type [INFO] [stdout] --> base/src/bhv.rs:100:21 [INFO] [stdout] | [INFO] [stdout] 100 | impl (), T: Bhv> Bhv for OnExit { [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] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> base/src/bhv.rs:112:21 [INFO] [stdout] | [INFO] [stdout] 112 | impl (), T: Bhv> Bhv for OnTick { [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] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> base/src/bhv.rs:120:21 [INFO] [stdout] | [INFO] [stdout] 120 | impl (), T: Bhv> Bhv for OnRunning { [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] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> base/src/bhv.rs:132:21 [INFO] [stdout] | [INFO] [stdout] 132 | impl (), T: Bhv> Bhv for PostTick { [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] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> base/src/bhv.rs:238:38 [INFO] [stdout] | [INFO] [stdout] 238 | for x in &mut self.1 { x.1 = std::usize::MAX } [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 238 - for x in &mut self.1 { x.1 = std::usize::MAX } [INFO] [stdout] 238 + for x in &mut self.1 { x.1 = usize::MAX } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> base/src/debug.rs:44:65 [INFO] [stdout] | [INFO] [stdout] 44 | pub fn indent(&mut self, n: usize, f: impl Fn(&mut DebugLog) -> ()) { [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] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> base/src/debug.rs:102:9 [INFO] [stdout] | [INFO] [stdout] 102 | write!(self.file, "}}\n")?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] = note: `#[warn(clippy::write_with_newline)]` on by default [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 102 - write!(self.file, "}}\n")?; [INFO] [stdout] 102 + writeln!(self.file, "}}")?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `reserve` immediately after creation [INFO] [stdout] --> base/src/debug.rs:130:9 [INFO] [stdout] | [INFO] [stdout] 130 | / let mut xs = vec![]; [INFO] [stdout] 131 | | xs.reserve(frame.len()); [INFO] [stdout] | |________________________________^ help: consider using `Vec::with_capacity(/* Space hint */)`: `let mut xs = Vec::with_capacity(frame.len());` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#reserve_after_initialization [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] --> base/src/debug.rs:135:41 [INFO] [stdout] | [INFO] [stdout] 135 | ParticleData::Sight(r) => { render_particle(x.point, r).map(|x| xs.push(x)); } [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] 135 - ParticleData::Sight(r) => { render_particle(x.point, r).map(|x| xs.push(x)); } [INFO] [stdout] 135 + ParticleData::Sight(r) => { if let Some(x) = render_particle(x.point, r) { xs.push(x) } } [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] --> base/src/debug.rs:136:44 [INFO] [stdout] | [INFO] [stdout] 136 | ParticleData::Sound(_, r) => { render_particle(x.point, r).map(|x| xs.push(x)); } [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] 136 - ParticleData::Sound(_, r) => { render_particle(x.point, r).map(|x| xs.push(x)); } [INFO] [stdout] 136 + ParticleData::Sound(_, r) => { if let Some(x) = render_particle(x.point, r) { xs.push(x) } } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> base/src/debug.rs:145:9 [INFO] [stdout] | [INFO] [stdout] 145 | write!(self.file, "}}\n")?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 145 - write!(self.file, "}}\n")?; [INFO] [stdout] 145 + writeln!(self.file, "}}")?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> base/src/debug.rs:159:46 [INFO] [stdout] | [INFO] [stdout] 159 | Self::write_array(&mut file, &frame)?; [INFO] [stdout] | ^^^^^^ help: change this to: `frame` [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: manual slice size calculation [INFO] [stdout] --> base/src/debug.rs:250:19 [INFO] [stdout] | [INFO] [stdout] 250 | let len = t.len() * std::mem::size_of::(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::mem::size_of_val(t)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_slice_size_calculation [INFO] [stdout] = note: `#[warn(clippy::manual_slice_size_calculation)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use `std::ptr::eq` when comparing raw pointers [INFO] [stdout] --> base/src/dex.rs:87:9 [INFO] [stdout] | [INFO] [stdout] 87 | *self as *const Species == *next as *const Species [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(*self, *next)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq [INFO] [stdout] = note: `#[warn(clippy::ptr_eq)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `line` [INFO] [stdout] --> base/src/effect.rs:306:14 [INFO] [stdout] | [INFO] [stdout] 306 | for i in 1..line.len() - 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 306 - for i in 1..line.len() - 1 { [INFO] [stdout] 306 + for in line.iter().take(line.len() - 1).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `line` [INFO] [stdout] --> base/src/effect.rs:361:14 [INFO] [stdout] | [INFO] [stdout] 361 | for i in 1..line.len() - 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 361 - for i in 1..line.len() - 1 { [INFO] [stdout] 361 + for (i, ) in line.iter().enumerate().take(line.len() - 1).skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `line` [INFO] [stdout] --> base/src/effect.rs:398:14 [INFO] [stdout] | [INFO] [stdout] 398 | for i in 1..line.len() { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 398 - for i in 1..line.len() { [INFO] [stdout] 398 + for (i, ) in line.iter().enumerate().skip(1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EID` contains a capitalized acronym [INFO] [stdout] --> base/src/entity.rs:130:12 [INFO] [stdout] | [INFO] [stdout] 130 | pub struct EID(NonZeroU64); [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Eid` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i64` -> `i64`) [INFO] [stdout] --> base/src/knowledge.rs:114:36 [INFO] [stdout] | [INFO] [stdout] 114 | Timestamp((self.0 as i64 - other.0 as i64) as u64) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `other.0` [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: name `UID` contains a capitalized acronym [INFO] [stdout] --> base/src/knowledge.rs:137:12 [INFO] [stdout] | [INFO] [stdout] 137 | pub struct UID(NonZeroU64); [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Uid` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> base/src/knowledge.rs:369:9 [INFO] [stdout] | [INFO] [stdout] 369 | return format!("{:?} - >{} turns ago", self.time - time, MAX_TURN_MEMORY); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 369 - return format!("{:?} - >{} turns ago", self.time - time, MAX_TURN_MEMORY); [INFO] [stdout] 369 + format!("{:?} - >{} turns ago", self.time - time, MAX_TURN_MEMORY) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> base/src/knowledge.rs:386:9 [INFO] [stdout] | [INFO] [stdout] 386 | self.turn_times.get((turn - 1) as usize).map(|&x| x).unwrap_or_default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `self.turn_times.get((turn - 1) as usize).copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> base/src/knowledge.rs:583:63 [INFO] [stdout] | [INFO] [stdout] 583 | self.sources.push_front(SourceKnowledge::new(uid, &event)) [INFO] [stdout] | ^^^^^^ help: change this to: `event` [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 closure [INFO] [stdout] --> base/src/lighting.rs:61:49 [INFO] [stdout] | [INFO] [stdout] 61 | visions: (0..=MAX_LIGHT_RADIUS).map(|x| Vision::new(x)).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vision::new` [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: empty string literal in `println!` [INFO] [stdout] --> base/src/lighting.rs:263:9 [INFO] [stdout] | [INFO] [stdout] 263 | println!(""); [INFO] [stdout] | ^^^^^^^^^--^ [INFO] [stdout] | | [INFO] [stdout] | help: remove the empty string [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#println_empty_string [INFO] [stdout] = note: `#[warn(clippy::println_empty_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: non-canonical implementation of `clone` on a `Copy` type [INFO] [stdout] --> base/src/list.rs:68:29 [INFO] [stdout] | [INFO] [stdout] 68 | fn clone(&self) -> Self { Self(self.0, PhantomData) } [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#non_canonical_clone_impl [INFO] [stdout] = note: `#[warn(clippy::non_canonical_clone_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> base/src/list.rs:114:22 [INFO] [stdout] | [INFO] [stdout] 114 | fn to_free_index(&self) -> Index { Index(self.0 | 1) } [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 `Copy`) usually take `self` by value [INFO] [stdout] --> base/src/list.rs:116:22 [INFO] [stdout] | [INFO] [stdout] 116 | fn to_used_index(&self) -> Index { Index(self.0 & !1) } [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: length comparison to zero [INFO] [stdout] --> base/src/list.rs:391:21 [INFO] [stdout] | [INFO] [stdout] 391 | assert!(self.len() == 0); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.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: length comparison to zero [INFO] [stdout] --> base/src/list.rs:393:21 [INFO] [stdout] | [INFO] [stdout] 393 | assert!(self.len() > 0); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.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: use `std::ptr::eq` when comparing raw pointers [INFO] [stdout] --> base/src/list.rs:396:21 [INFO] [stdout] | [INFO] [stdout] 396 | assert!(b as *const T == &self[bh] as *const T); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(b, &self[bh])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use `std::ptr::eq` when comparing raw pointers [INFO] [stdout] --> base/src/list.rs:397:21 [INFO] [stdout] | [INFO] [stdout] 397 | assert!(f as *const T == &self[fh] as *const T); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(f, &self[fh])` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Compiling wasm-bindgen-macro v0.2.106 [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> base/src/list.rs:495:17 [INFO] [stdout] | [INFO] [stdout] 495 | assert!(list.pop_back() == None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `list.pop_back().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] --> base/src/list.rs:520:17 [INFO] [stdout] | [INFO] [stdout] 520 | assert!(list.pop_front() == None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `list.pop_front().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: you are using an explicit closure for cloning elements [INFO] [stdout] --> base/src/list.rs:570:32 [INFO] [stdout] | [INFO] [stdout] 570 | let forwards: Vec<_> = list.iter().map(|x| x.clone()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `list.iter().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> base/src/list.rs:571:32 [INFO] [stdout] | [INFO] [stdout] 571 | let backward: Vec<_> = list.iter().rev().map(|x| x.clone()).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `list.iter().rev().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> base/src/pathing.rs:565:40 [INFO] [stdout] | [INFO] [stdout] 565 | if result.visited.len() >= (cells as usize) { break; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `cells` [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: use `std::ptr::eq` when comparing raw pointers [INFO] [stdout] --> base/src/shadowcast.rs:293:17 [INFO] [stdout] | [INFO] [stdout] 293 | x.transform as *const Transform == s.transform as *const Transform { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(x.transform, s.transform)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> base/src/shadowcast.rs:440:31 [INFO] [stdout] | [INFO] [stdout] 440 | let p = Point(x as i32, y as i32); [INFO] [stdout] | ^^^^^^^^ help: try: `x` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`i32` -> `i32`) [INFO] [stdout] --> base/src/shadowcast.rs:440:41 [INFO] [stdout] | [INFO] [stdout] 440 | let p = Point(x as i32, y as i32); [INFO] [stdout] | ^^^^^^^^ help: try: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> base/src/shadowcast.rs:885:35 [INFO] [stdout] | [INFO] [stdout] 885 | for line in show_fov(eye, &map, &visible) { println!("{}", line); } [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> base/src/shadowcast.rs:885:41 [INFO] [stdout] | [INFO] [stdout] 885 | for line in show_fov(eye, &map, &visible) { println!("{}", line); } [INFO] [stdout] | ^^^^^^^^ help: change this to: `visible` [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: name `TID` contains a capitalized acronym [INFO] [stdout] --> base/src/threats.rs:256:10 [INFO] [stdout] | [INFO] [stdout] 256 | pub enum TID { CID, EID(EID), UID(UID) } [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Tid` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `CID` contains a capitalized acronym [INFO] [stdout] --> base/src/threats.rs:256:16 [INFO] [stdout] | [INFO] [stdout] 256 | pub enum TID { CID, EID(EID), UID(UID) } [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Cid` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `EID` contains a capitalized acronym [INFO] [stdout] --> base/src/threats.rs:256:21 [INFO] [stdout] | [INFO] [stdout] 256 | pub enum TID { CID, EID(EID), UID(UID) } [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Eid` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `UID` contains a capitalized acronym [INFO] [stdout] --> base/src/threats.rs:256:31 [INFO] [stdout] | [INFO] [stdout] 256 | pub enum TID { CID, EID(EID), UID(UID) } [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter: `Uid` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> base/src/threats.rs:433:33 [INFO] [stdout] | [INFO] [stdout] 433 | let tid = event.eid.map(|x| TID::EID(x)).or(event.uid.map(|x| TID::UID(x)))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `TID::EID` [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] --> base/src/threats.rs:433:67 [INFO] [stdout] | [INFO] [stdout] 433 | let tid = event.eid.map(|x| TID::EID(x)).or(event.uid.map(|x| TID::UID(x)))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `TID::UID` [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: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> base/src/ui.rs:79:11 [INFO] [stdout] | [INFO] [stdout] 79 | fn rivals<'a>(me: &'a Entity) -> Vec<&'a EntityKnowledge> { [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] 79 - fn rivals<'a>(me: &'a Entity) -> Vec<&'a EntityKnowledge> { [INFO] [stdout] 79 + fn rivals(me: &Entity) -> Vec<&EntityKnowledge> { [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] --> base/src/ui.rs:364:13 [INFO] [stdout] | [INFO] [stdout] 364 | target.as_mut().map(|x| update_target(known, x, update)); [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] 364 - target.as_mut().map(|x| update_target(known, x, update)); [INFO] [stdout] 364 + if let Some(x) = target.as_mut() { update_target(known, x, update) } [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] --> base/src/ui.rs:451:9 [INFO] [stdout] | [INFO] [stdout] 451 | self.lines.last_mut().map(|x| x.menu = false); [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] 451 - self.lines.last_mut().map(|x| x.menu = false); [INFO] [stdout] 451 + if let Some(x) = self.lines.last_mut() { ... } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> base/src/ui.rs:739:20 [INFO] [stdout] | [INFO] [stdout] 739 | if !((i + count - frame) % count < 2) { continue; } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `((i + count - frame) % count >= 2)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> base/src/ui.rs:886:44 [INFO] [stdout] | [INFO] [stdout] 886 | for (_, &key) in SUMMON_KEYS.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 886 - for (_, &key) in SUMMON_KEYS.iter().enumerate() { [INFO] [stdout] 886 + for &key in SUMMON_KEYS.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `unwrap_or` to construct default value [INFO] [stdout] --> base/src/ui.rs:1055:53 [INFO] [stdout] | [INFO] [stdout] 1055 | let prefix = key.map(|x| UI::render_key(x)).unwrap_or(String::default()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> base/src/ui.rs:1055:30 [INFO] [stdout] | [INFO] [stdout] 1055 | let prefix = key.map(|x| UI::render_key(x)).unwrap_or(String::default()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `UI::render_key` [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 assertion is always `false` [INFO] [stdout] --> base/src/base.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 43 | assert!(false); [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: replace this with `panic!()` or `unreachable!()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assertions_on_constants [INFO] [stdout] = note: `#[warn(clippy::assertions_on_constants)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `let...else` may be rewritten with the `?` operator [INFO] [stdout] --> base/src/base.rs:299:9 [INFO] [stdout] | [INFO] [stdout] 299 | let Some(x) = self.index(point) else { return None; }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `let x = self.index(point)?;` [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: use `std::ptr::eq` when comparing raw pointers [INFO] [stdout] --> base/src/game.rs:116:9 [INFO] [stdout] | [INFO] [stdout] 116 | *self as *const Tile == *next as *const Tile [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::eq(*self, *next)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_eq [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] --> base/src/game.rs:158:5 [INFO] [stdout] | [INFO] [stdout] 158 | line.get_mut(..1).map(|x| x.make_ascii_uppercase()); line [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] 158 - line.get_mut(..1).map(|x| x.make_ascii_uppercase()); line [INFO] [stdout] 158 + if let Some(x) = line.get_mut(..1) { x.make_ascii_uppercase() } line [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `FOV` contains a capitalized acronym [INFO] [stdout] --> base/src/game.rs:173:8 [INFO] [stdout] | [INFO] [stdout] 173 | struct FOV { [INFO] [stdout] | ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Fov` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(f)` on an `Option` value where `f` is a closure that returns the unit type `()` [INFO] [stdout] --> base/src/game.rs:354:9 [INFO] [stdout] | [INFO] [stdout] 354 | env.debug.as_mut().map(|x| x.record_frame(self, &frame)); [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] 354 - env.debug.as_mut().map(|x| x.record_frame(self, &frame)); [INFO] [stdout] 354 + if let Some(x) = env.debug.as_mut() { x.record_frame(self, &frame) } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self._effect.frames.get(0)` [INFO] [stdout] --> base/src/game.rs:387:27 [INFO] [stdout] | [INFO] [stdout] 387 | let Some(frame) = self._effect.frames.get(0) else { return }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self._effect.frames.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: accessing first element with `self._effect.frames.get(0)` [INFO] [stdout] --> base/src/game.rs:416:27 [INFO] [stdout] | [INFO] [stdout] 416 | let Some(frame) = self._effect.frames.get(0).cloned() else { return }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `self._effect.frames.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing an `Option` with `Some(..)` [INFO] [stdout] --> base/src/game.rs:486:20 [INFO] [stdout] | [INFO] [stdout] 486 | let prev = replace(&mut cell.eid, Some(eid)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::replace()` instead: `cell.eid.replace(eid)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_some [INFO] [stdout] = note: `#[warn(clippy::mem_replace_option_with_some)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: replacing an `Option` with `None` [INFO] [stdout] --> base/src/game.rs:504:19 [INFO] [stdout] | [INFO] [stdout] 504 | let old = replace(&mut self.map.entry_mut(source).unwrap().eid, None); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider `Option::take()` instead: `self.map.entry_mut(source).unwrap().eid.take()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_option_with_none [INFO] [stdout] = note: `#[warn(clippy::mem_replace_option_with_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the method `observe_event` doesn't need a mutable reference [INFO] [stdout] --> base/src/game.rs:567:29 [INFO] [stdout] | [INFO] [stdout] 567 | known.observe_event(&mut self.entities[eid], e); [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] 567 - known.observe_event(&mut self.entities[eid], e); [INFO] [stdout] 567 + known.observe_event(&self.entities[eid], e); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> base/src/game.rs:585:34 [INFO] [stdout] | [INFO] [stdout] 585 | let vision = fov.compute(&self, me); [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] --> base/src/game.rs:586:26 [INFO] [stdout] | [INFO] [stdout] 586 | known.update(me, &self, vision, rng); [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 `[Point; 8]` which implements the `Copy` trait [INFO] [stdout] --> base/src/game.rs:721:27 [INFO] [stdout] | [INFO] [stdout] 721 | let options: Vec<_> = dirs::ALL.clone().into_iter().filter( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `dirs::ALL` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> base/src/game.rs:872:26 [INFO] [stdout] | [INFO] [stdout] 872 | let action = ai.plan(&entity, env); [INFO] [stdout] | ^^^^^^^ help: change this to: `entity` [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 closure [INFO] [stdout] --> base/src/game.rs:1316:28 [INFO] [stdout] | [INFO] [stdout] 1316 | let rng = seed.map(|x| RNG::seed_from_u64(x)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `RNG::seed_from_u64` [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] --> base/src/game.rs:1317:38 [INFO] [stdout] | [INFO] [stdout] 1317 | let rng = rng.unwrap_or_else(|| RNG::from_os_rng()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `RNG::from_os_rng` [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: creating a new box with default content [INFO] [stdout] --> base/src/game.rs:1352:13 [INFO] [stdout] | [INFO] [stdout] 1352 | board.entities[player].known = Default::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace existing content with default instead: `*board.entities[player].known = Default::default()` [INFO] [stdout] | [INFO] [stdout] = note: this creates a needless allocation [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#replace_box [INFO] [stdout] = note: `#[warn(clippy::replace_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: call to `std::mem::drop` with a value that does not implement `Drop`. Dropping such a type only extends its contained lifetimes [INFO] [stdout] --> base/src/game.rs:1383:9 [INFO] [stdout] | [INFO] [stdout] 1383 | std::mem::drop(Weather::Rain(Point(0, 64), 32)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: argument has type `game::Weather` [INFO] [stdout] --> base/src/game.rs:1383:24 [INFO] [stdout] | [INFO] [stdout] 1383 | std::mem::drop(Weather::Rain(Point(0, 64), 32)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#drop_non_drop [INFO] [stdout] = note: `#[warn(clippy::drop_non_drop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> base/src/mapgen.rs:59:9 [INFO] [stdout] | [INFO] [stdout] 59 | result.size = size; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `mapgen::MapgenConfig { size: size, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> base/src/mapgen.rs:58:9 [INFO] [stdout] | [INFO] [stdout] 58 | let mut result = Self::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> base/src/mapgen.rs:195:26 [INFO] [stdout] | [INFO] [stdout] 195 | let mut best_score = std::i64::MAX; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 195 - let mut best_score = std::i64::MAX; [INFO] [stdout] 195 + let mut best_score = i64::MAX; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> base/src/mapgen.rs:247:31 [INFO] [stdout] | [INFO] [stdout] 247 | let mut options: Vec<_> = options.iter().map(|&x| x).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `copied` method: `options.iter().copied()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting float literal to `f64` is unnecessary [INFO] [stdout] --> base/src/mapgen.rs:277:30 [INFO] [stdout] | [INFO] [stdout] 277 | let period = scale / (2.0 as f64).powi(octave); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `2.0_f64` [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: usage of a legacy numeric constant [INFO] [stdout] --> base/src/mapgen.rs:397:26 [INFO] [stdout] | [INFO] [stdout] 397 | let sentinel = Point(std::i32::MAX, std::i32::MAX); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 397 - let sentinel = Point(std::i32::MAX, std::i32::MAX); [INFO] [stdout] 397 + let sentinel = Point(i32::MAX, std::i32::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of a legacy numeric constant [INFO] [stdout] --> base/src/mapgen.rs:397:41 [INFO] [stdout] | [INFO] [stdout] 397 | let sentinel = Point(std::i32::MAX, std::i32::MAX); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 397 - let sentinel = Point(std::i32::MAX, std::i32::MAX); [INFO] [stdout] 397 + let sentinel = Point(std::i32::MAX, i32::MAX); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> base/src/mapgen.rs:480:56 [INFO] [stdout] | [INFO] [stdout] 480 | let (p1, p2) = *sample(&find_closest_pairs(&r1, &r2), rng); [INFO] [stdout] | ^^^ help: change this to: `r1` [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] --> base/src/mapgen.rs:480:61 [INFO] [stdout] | [INFO] [stdout] 480 | let (p1, p2) = *sample(&find_closest_pairs(&r1, &r2), rng); [INFO] [stdout] | ^^^ help: change this to: `r2` [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: passing a unit value to a function [INFO] [stdout] --> base/src/mapgen.rs:919:13 [INFO] [stdout] | [INFO] [stdout] 919 | / black_box({ [INFO] [stdout] 920 | | let seed = (i % NUM_SEEDS) + BASE_SEED; [INFO] [stdout] 921 | | let mut rng = RNG::seed_from_u64(seed); [INFO] [stdout] 922 | | mapgen(&mut rng); [INFO] [stdout] 923 | | }); [INFO] [stdout] | |______________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unit_arg [INFO] [stdout] = note: `#[warn(clippy::unit_arg)]` on by default [INFO] [stdout] help: remove the semicolon from the last statement in the block [INFO] [stdout] | [INFO] [stdout] 922 - mapgen(&mut rng); [INFO] [stdout] 922 + mapgen(&mut rng) [INFO] [stdout] | [INFO] [stdout] help: or move the expression in front of the call and replace it with the unit literal `()` [INFO] [stdout] | [INFO] [stdout] 919 ~ { [INFO] [stdout] 920 + let seed = (i % NUM_SEEDS) + BASE_SEED; [INFO] [stdout] 921 + let mut rng = RNG::seed_from_u64(seed); [INFO] [stdout] 922 + mapgen(&mut rng); [INFO] [stdout] 923 + }; [INFO] [stdout] 924 ~ black_box(()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking wrl-wasm v0.1.0 (/opt/rustwide/workdir/wasm) [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 11.83s [INFO] running `Command { std: "docker" "inspect" "79c234cb4898f2f608401d85611a6a9342def58e229edda31eece48719762550", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "79c234cb4898f2f608401d85611a6a9342def58e229edda31eece48719762550", kill_on_drop: false }` [INFO] [stdout] 79c234cb4898f2f608401d85611a6a9342def58e229edda31eece48719762550