[INFO] cloning repository https://github.com/KatTheGit/sylvan-row [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/KatTheGit/sylvan-row" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FKatTheGit%2Fsylvan-row", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FKatTheGit%2Fsylvan-row'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 75a4d7e0445e0e28ea642cc939da0f0e007b18bb [INFO] linting KatTheGit/sylvan-row against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FKatTheGit%2Fsylvan-row" "/workspace/builds/worker-7-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-7-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/KatTheGit/sylvan-row [INFO] finished tweaking git repo https://github.com/KatTheGit/sylvan-row [INFO] tweaked toml for git repo https://github.com/KatTheGit/sylvan-row written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/KatTheGit/sylvan-row 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/KatTheGit/sylvan-row already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded toml v0.9.11+spec-1.1.0 [INFO] [stderr] Downloaded serdect v0.2.0 [INFO] [stderr] Downloaded rusty-pkl v0.1.2 [INFO] [stderr] Downloaded quad-rand v0.2.3 [INFO] [stderr] Downloaded typemap-ors v1.0.0 [INFO] [stderr] Downloaded macos-accessibility-client v0.0.1 [INFO] [stderr] Downloaded macroquad_macro v0.1.8 [INFO] [stderr] Downloaded device_query v2.1.0 [INFO] [stderr] Downloaded atomic-arena v0.1.2 [INFO] [stderr] Downloaded linux-keyutils v0.2.4 [INFO] [stderr] Downloaded coreaudio-rs v0.13.0 [INFO] [stderr] Downloaded rtrb v0.3.2 [INFO] [stderr] Downloaded keyring v3.6.3 [INFO] [stderr] Downloaded arc-swap v1.8.0 [INFO] [stderr] Downloaded cpal v0.16.0 [INFO] [stderr] Downloaded kira v0.11.0 [INFO] [stderr] Downloaded log4rs v1.4.0 [INFO] [stderr] Downloaded portable-atomic v1.13.0 [INFO] [stderr] Downloaded objc2-audio-toolbox v0.3.2 [INFO] [stderr] Downloaded zerocopy v0.8.33 [INFO] [stderr] Downloaded miniquad v0.4.8 [INFO] [stderr] Downloaded redb v2.6.3 [INFO] [stderr] Downloaded ndk-sys v0.2.2 [INFO] [stderr] Downloaded fontdue v0.9.3 [INFO] [stderr] Downloaded flate2 v1.1.8 [INFO] [stderr] Downloaded zerocopy-derive v0.8.33 [INFO] [stderr] Downloaded ryu v1.0.22 [INFO] [stderr] Downloaded derive-where v1.6.0 [INFO] [stderr] Downloaded opaque-ke v4.1.0-pre.1 [INFO] [stderr] Downloaded objc2-core-audio v0.3.2 [INFO] [stderr] Downloaded triple_buffer v8.1.1 [INFO] [stderr] Downloaded objc-rs v0.2.8 [INFO] [stderr] Downloaded voprf v0.5.0 [INFO] [stderr] Downloaded winresource v0.1.30 [INFO] [stderr] Downloaded objc2-core-audio-types v0.3.2 [INFO] [stderr] Downloaded humantime v2.3.0 [INFO] [stderr] Downloaded zmij v1.0.16 [INFO] [stderr] Downloaded readkey v0.2.2 [INFO] [stderr] Downloaded macroquad v0.4.14 [INFO] [stderr] Downloaded readmouse v0.2.1 [INFO] [stderr] Downloaded mint v0.5.9 [INFO] [stderr] Downloaded mock_instant v0.6.0 [INFO] [stderr] Downloaded thread-id v5.1.0 [INFO] [stderr] Downloaded destructure_traitobject v0.2.0 [INFO] [stderr] Downloaded unsafe-any-ors v1.0.0 [INFO] [stderr] Downloaded glam v0.30.10 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] 363507c9ad989d9829a7f6e04c90f316bd0033786a6f9bc23f06731ca7562a78 [INFO] running `Command { std: "docker" "start" "-a" "363507c9ad989d9829a7f6e04c90f316bd0033786a6f9bc23f06731ca7562a78", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "363507c9ad989d9829a7f6e04c90f316bd0033786a6f9bc23f06731ca7562a78", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "363507c9ad989d9829a7f6e04c90f316bd0033786a6f9bc23f06731ca7562a78", kill_on_drop: false }` [INFO] [stdout] 363507c9ad989d9829a7f6e04c90f316bd0033786a6f9bc23f06731ca7562a78 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-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] a76c3909fffa5b6755094fe55c530d2884377a5981f5f01c6cad1cc994ee3c1b [INFO] running `Command { std: "docker" "start" "-a" "a76c3909fffa5b6755094fe55c530d2884377a5981f5f01c6cad1cc994ee3c1b", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.180 [INFO] [stderr] Compiling serde_core v1.0.228 [INFO] [stderr] Compiling proc-macro2 v1.0.106 [INFO] [stderr] Compiling unicode-ident v1.0.22 [INFO] [stderr] Compiling quote v1.0.44 [INFO] [stderr] Compiling serde v1.0.228 [INFO] [stderr] Compiling typenum v1.19.0 [INFO] [stderr] Checking bytemuck v1.24.0 [INFO] [stderr] Compiling generic-array v0.14.7 [INFO] [stderr] Checking encoding_rs v0.8.35 [INFO] [stderr] Compiling zerocopy v0.8.33 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Checking bitflags v2.10.0 [INFO] [stderr] Checking memchr v2.7.6 [INFO] [stderr] Checking simd-adler32 v0.3.8 [INFO] [stderr] Compiling semver v1.0.27 [INFO] [stderr] Compiling crc32fast v1.5.0 [INFO] [stderr] Compiling alsa-sys v0.3.1 [INFO] [stderr] Compiling winnow v0.7.14 [INFO] [stderr] Compiling cfg_aliases v0.2.1 [INFO] [stderr] Checking base16ct v0.2.0 [INFO] [stderr] Compiling find-msvc-tools v0.1.8 [INFO] [stderr] Checking adler2 v2.0.1 [INFO] [stderr] Compiling rustversion v1.0.22 [INFO] [stderr] Checking miniz_oxide v0.8.9 [INFO] [stderr] Compiling cc v1.2.54 [INFO] [stderr] Compiling rustc_version v0.4.1 [INFO] [stderr] Compiling nix v0.29.0 [INFO] [stderr] Checking aho-corasick v1.1.4 [INFO] [stderr] Compiling libudev-sys v0.1.4 [INFO] [stderr] Compiling crossbeam-utils v0.8.21 [INFO] [stderr] Compiling zmij v1.0.16 [INFO] [stderr] Compiling curve25519-dalek v4.1.3 [INFO] [stderr] Compiling syn v2.0.114 [INFO] [stderr] Checking flate2 v1.1.8 [INFO] [stderr] Checking fdeflate v0.3.7 [INFO] [stderr] Compiling x11 v2.21.0 [INFO] [stderr] Checking base64ct v1.8.3 [INFO] [stderr] Checking hashbrown v0.16.1 [INFO] [stderr] Compiling miniquad v0.4.8 [INFO] [stderr] Checking itoa v1.0.17 [INFO] [stderr] Compiling thiserror v2.0.18 [INFO] [stderr] Compiling cpal v0.16.0 [INFO] [stderr] Compiling unicode-xid v0.2.6 [INFO] [stderr] Compiling serde_json v1.0.149 [INFO] [stderr] Checking extended v0.1.0 [INFO] [stderr] Checking destructure_traitobject v0.2.0 [INFO] [stderr] Checking getrandom v0.2.17 [INFO] [stderr] Checking getrandom v0.3.4 [INFO] [stderr] Checking parking_lot_core v0.9.12 [INFO] [stderr] Checking inotify-sys v0.1.5 [INFO] [stderr] Checking rand_core v0.9.5 [INFO] [stderr] Checking inotify v0.10.2 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Checking unsafe-any-ors v1.0.0 [INFO] [stderr] Checking ff v0.13.1 [INFO] [stderr] Checking indexmap v2.13.0 [INFO] [stderr] Checking password-hash v0.5.0 [INFO] [stderr] Checking group v0.13.0 [INFO] [stderr] Checking errno v0.3.14 [INFO] [stderr] Checking parking_lot v0.12.5 [INFO] [stderr] Checking png v0.17.16 [INFO] [stderr] Checking alsa v0.9.1 [INFO] [stderr] Checking ordered-float v2.10.1 [INFO] [stderr] Compiling device_query v2.1.0 [INFO] [stderr] Checking is_terminal_polyfill v1.70.2 [INFO] [stderr] Checking opaque-debug v0.3.1 [INFO] [stderr] Checking uuid v1.19.0 [INFO] [stderr] Checking dasp_sample v0.11.0 [INFO] [stderr] Checking anstyle-query v1.1.5 [INFO] [stderr] Compiling redb v2.6.3 [INFO] [stderr] Checking regex-automata v0.4.13 [INFO] [stderr] Compiling gilrs v0.10.10 [INFO] [stderr] Checking ttf-parser v0.21.1 [INFO] [stderr] Checking ryu v1.0.22 [INFO] [stderr] Checking mint v0.5.9 [INFO] [stderr] Checking triple_buffer v8.1.1 [INFO] [stderr] Checking log v0.4.29 [INFO] [stderr] Checking anstream v0.6.21 [INFO] [stderr] Checking chrono v0.4.43 [INFO] [stderr] Checking ppv-lite86 v0.2.21 [INFO] [stderr] Compiling ring v0.17.14 [INFO] [stderr] Compiling toml_parser v1.0.6+spec-1.1.0 [INFO] [stderr] Checking signal-hook-registry v1.4.8 [INFO] [stderr] Checking typemap-ors v1.0.0 [INFO] [stderr] Checking arc-swap v1.8.0 [INFO] [stderr] Checking symphonia-core v0.5.5 [INFO] [stderr] Checking image v0.24.9 [INFO] [stderr] Checking gilrs-core v0.5.15 [INFO] [stderr] Checking glam v0.30.10 [INFO] [stderr] Checking rand_chacha v0.9.0 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand v0.9.2 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking linux-keyutils v0.2.4 [INFO] [stderr] Checking socket2 v0.6.2 [INFO] [stderr] Checking mio v1.1.1 [INFO] [stderr] Checking thread-id v5.1.0 [INFO] [stderr] Checking atomic-arena v0.1.2 [INFO] [stderr] Compiling pastey v0.1.1 [INFO] [stderr] Checking log-mdc v0.1.0 [INFO] [stderr] Compiling serde_spanned v1.0.4 [INFO] [stderr] Compiling toml_datetime v0.7.5+spec-1.1.0 [INFO] [stderr] Checking bytes v1.11.0 [INFO] [stderr] Checking jiff v0.2.18 [INFO] [stderr] Checking humantime v2.3.0 [INFO] [stderr] Checking symphonia-metadata v0.5.5 [INFO] [stderr] Checking symphonia-codec-pcm v0.5.5 [INFO] [stderr] Checking mock_instant v0.6.0 [INFO] [stderr] Compiling macroquad_macro v0.1.8 [INFO] [stderr] Checking symphonia-utils-xiph v0.5.5 [INFO] [stderr] Checking symphonia-format-riff v0.5.5 [INFO] [stderr] Checking symphonia-format-ogg v0.5.5 [INFO] [stderr] Checking symphonia-bundle-flac v0.5.5 [INFO] [stderr] Checking symphonia-codec-vorbis v0.5.5 [INFO] [stderr] Compiling toml v0.9.11+spec-1.1.0 [INFO] [stderr] Checking symphonia-bundle-mp3 v0.5.5 [INFO] [stderr] Checking fontdue v0.9.3 [INFO] [stderr] Checking glam v0.27.0 [INFO] [stderr] Checking quad-rand v0.2.3 [INFO] [stderr] Checking rtrb v0.3.2 [INFO] [stderr] Checking keyring v3.6.3 [INFO] [stderr] Checking strum v0.26.3 [INFO] [stderr] Checking pollster v0.4.0 [INFO] [stderr] Checking regex v1.12.2 [INFO] [stderr] Checking rusty-pkl v0.1.2 [INFO] [stderr] Compiling winresource v0.1.30 [INFO] [stderr] Checking env_filter v0.1.4 [INFO] [stderr] Checking symphonia v0.5.5 [INFO] [stderr] Compiling sylvan_row v0.1.0 (/opt/rustwide/workdir) [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Compiling zeroize_derive v1.4.3 [INFO] [stderr] Compiling curve25519-dalek-derive v0.1.1 [INFO] [stderr] Compiling thiserror-impl v2.0.18 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling derive-where v1.6.0 [INFO] [stderr] Compiling derive_more-impl v2.1.1 [INFO] [stderr] Compiling tokio-macros v2.6.0 [INFO] [stderr] Compiling strum_macros v0.26.4 [INFO] [stderr] Checking tokio v1.49.0 [INFO] [stderr] Checking macroquad v0.4.14 [INFO] [stderr] Checking derive_more v2.1.1 [INFO] [stderr] Checking env_logger v0.11.8 [INFO] [stderr] Checking zeroize v1.8.2 [INFO] [stderr] Checking serdect v0.2.0 [INFO] [stderr] Checking serde-value v0.7.0 [INFO] [stderr] Checking serde_yaml v0.9.34+deprecated [INFO] [stderr] Checking bincode v1.3.3 [INFO] [stderr] Checking der v0.7.10 [INFO] [stderr] Checking kira v0.11.0 [INFO] [stderr] Checking crypto-common v0.1.7 [INFO] [stderr] Checking block-buffer v0.10.4 [INFO] [stderr] Checking inout v0.1.4 [INFO] [stderr] Checking crypto-bigint v0.5.5 [INFO] [stderr] Checking universal-hash v0.5.1 [INFO] [stderr] Checking aead v0.5.2 [INFO] [stderr] Checking cipher v0.4.4 [INFO] [stderr] Checking poly1305 v0.8.0 [INFO] [stderr] Checking log4rs v1.4.0 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Checking chacha20 v0.9.1 [INFO] [stderr] Checking blake2 v0.10.6 [INFO] [stderr] Checking hmac v0.12.1 [INFO] [stderr] Checking sha2 v0.10.9 [INFO] [stderr] Checking spki v0.7.3 [INFO] [stderr] Checking sec1 v0.7.3 [INFO] [stderr] Checking hkdf v0.12.4 [INFO] [stderr] Checking chacha20poly1305 v0.10.1 [INFO] [stderr] Checking pkcs8 v0.10.2 [INFO] [stderr] Checking argon2 v0.5.3 [INFO] [stderr] Checking elliptic-curve v0.13.8 [INFO] [stderr] Checking voprf v0.5.0 [INFO] [stderr] Checking opaque-ke v4.1.0-pre.1 [INFO] [stdout] warning: unused import: `std::time::Duration` [INFO] [stdout] --> src/ui.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | use std::time::Duration; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ui.rs:120:7 [INFO] [stdout] | [INFO] [stdout] 120 | tab_names: tab_names, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `tab_names` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ui.rs:320:139 [INFO] [stdout] | [INFO] [stdout] 320 | ...nt), font_size: (size * 0.5 * vh) as u16, color: color, ..Default::default() }); [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `color` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/gameserver.rs:1448:19 [INFO] [stdout] | [INFO] [stdout] 1448 | position: position, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::time::Duration` [INFO] [stdout] --> src/ui.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | use std::time::Duration; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ui.rs:120:7 [INFO] [stdout] | [INFO] [stdout] 120 | tab_names: tab_names, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `tab_names` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/ui.rs:320:139 [INFO] [stdout] | [INFO] [stdout] 320 | ...nt), font_size: (size * 0.5 * vh) as u16, color: color, ..Default::default() }); [INFO] [stdout] | ^^^^^^^^^^^^ help: replace it with: `color` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like an `else if` but the `else` is missing [INFO] [stdout] --> src/game.rs:1288:8 [INFO] [stdout] | [INFO] [stdout] 1288 | } if player.is_dead { [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: to remove this lint, add the missing `else` or add a new line before the second `if` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#possible_missing_else [INFO] [stdout] = note: `#[warn(clippy::possible_missing_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/gameserver.rs:1448:19 [INFO] [stdout] | [INFO] [stdout] 1448 | position: position, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: replace it with: `position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like an `else if` but the `else` is missing [INFO] [stdout] --> src/game.rs:1288:8 [INFO] [stdout] | [INFO] [stdout] 1288 | } if player.is_dead { [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: to remove this lint, add the missing `else` or add a new line before the second `if` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#possible_missing_else [INFO] [stdout] = note: `#[warn(clippy::possible_missing_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:35:5 [INFO] [stdout] | [INFO] [stdout] 35 | / return Button { [INFO] [stdout] 36 | | position, [INFO] [stdout] 37 | | size, [INFO] [stdout] 38 | | text: text.to_string(), [INFO] [stdout] 39 | | font_size, [INFO] [stdout] 40 | | clickable: true, [INFO] [stdout] 41 | | } [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] 35 ~ Button { [INFO] [stdout] 36 + position, [INFO] [stdout] 37 + size, [INFO] [stdout] 38 + text: text.to_string(), [INFO] [stdout] 39 + font_size, [INFO] [stdout] 40 + clickable: true, [INFO] [stdout] 41 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | / if self.clickable { [INFO] [stdout] 55 | | if mouse.x > position.x && mouse.x < (position.x + size.x) { [INFO] [stdout] 56 | | if mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 57 | | graphics::draw_rectangle(position, size,GRAY); [INFO] [stdout] ... | [INFO] [stdout] 61 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 54 ~ if self.clickable [INFO] [stdout] 55 ~ && mouse.x > position.x && mouse.x < (position.x + size.x) { [INFO] [stdout] 56 | if mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] ... [INFO] [stdout] 59 | } [INFO] [stdout] 60 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:55:7 [INFO] [stdout] | [INFO] [stdout] 55 | / if mouse.x > position.x && mouse.x < (position.x + size.x) { [INFO] [stdout] 56 | | if mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 57 | | graphics::draw_rectangle(position, size,GRAY); [INFO] [stdout] 58 | | draw_text(text, position.x + 1.0*vh + 10.0, position.y + size.y * 0.65, font_size , BLACK); [INFO] [stdout] 59 | | } [INFO] [stdout] 60 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 55 ~ if mouse.x > position.x && mouse.x < (position.x + size.x) [INFO] [stdout] 56 ~ && mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 57 | graphics::draw_rectangle(position, size,GRAY); [INFO] [stdout] 58 | draw_text(text, position.x + 1.0*vh + 10.0, position.y + size.y * 0.65, font_size , BLACK); [INFO] [stdout] 59 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:72:5 [INFO] [stdout] | [INFO] [stdout] 72 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 72 - return false; [INFO] [stdout] 72 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:65:5 [INFO] [stdout] | [INFO] [stdout] 65 | / if mouse.x > self.position.x && mouse.x < (self.position.x + self.size.x) { [INFO] [stdout] 66 | | if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 67 | | if is_mouse_button_down(MouseButton::Left) { [INFO] [stdout] 68 | | return true & self.clickable; [INFO] [stdout] ... | [INFO] [stdout] 71 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 65 ~ if mouse.x > self.position.x && mouse.x < (self.position.x + self.size.x) [INFO] [stdout] 66 ~ && mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 67 | if is_mouse_button_down(MouseButton::Left) { [INFO] [stdout] 68 | return true & self.clickable; [INFO] [stdout] 69 | } [INFO] [stdout] 70 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:66:7 [INFO] [stdout] | [INFO] [stdout] 66 | / if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 67 | | if is_mouse_button_down(MouseButton::Left) { [INFO] [stdout] 68 | | return true & self.clickable; [INFO] [stdout] 69 | | } [INFO] [stdout] 70 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 66 ~ if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) [INFO] [stdout] 67 ~ && is_mouse_button_down(MouseButton::Left) { [INFO] [stdout] 68 | return true & self.clickable; [INFO] [stdout] 69 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:83:5 [INFO] [stdout] | [INFO] [stdout] 83 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 83 - return false; [INFO] [stdout] 83 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:76:5 [INFO] [stdout] | [INFO] [stdout] 76 | / if mouse.x > self.position.x && mouse.x < (self.position.x + self.size.x) { [INFO] [stdout] 77 | | if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 78 | | if is_mouse_button_pressed(MouseButton::Left) { [INFO] [stdout] 79 | | return true & self.clickable; [INFO] [stdout] ... | [INFO] [stdout] 82 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 76 ~ if mouse.x > self.position.x && mouse.x < (self.position.x + self.size.x) [INFO] [stdout] 77 ~ && mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 78 | if is_mouse_button_pressed(MouseButton::Left) { [INFO] [stdout] 79 | return true & self.clickable; [INFO] [stdout] 80 | } [INFO] [stdout] 81 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:77:7 [INFO] [stdout] | [INFO] [stdout] 77 | / if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 78 | | if is_mouse_button_pressed(MouseButton::Left) { [INFO] [stdout] 79 | | return true & self.clickable; [INFO] [stdout] 80 | | } [INFO] [stdout] 81 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 77 ~ if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) [INFO] [stdout] 78 ~ && is_mouse_button_pressed(MouseButton::Left) { [INFO] [stdout] 79 | return true & self.clickable; [INFO] [stdout] 80 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:94:5 [INFO] [stdout] | [INFO] [stdout] 94 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 94 - return false; [INFO] [stdout] 94 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 87 | / if mouse.x > self.position.x && mouse.x < (self.position.x + self.size.x) { [INFO] [stdout] 88 | | if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 89 | | if is_mouse_button_released(MouseButton::Left) { [INFO] [stdout] 90 | | return true & self.clickable; [INFO] [stdout] ... | [INFO] [stdout] 93 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 87 ~ if mouse.x > self.position.x && mouse.x < (self.position.x + self.size.x) [INFO] [stdout] 88 ~ && mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 89 | if is_mouse_button_released(MouseButton::Left) { [INFO] [stdout] 90 | return true & self.clickable; [INFO] [stdout] 91 | } [INFO] [stdout] 92 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:88:7 [INFO] [stdout] | [INFO] [stdout] 88 | / if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 89 | | if is_mouse_button_released(MouseButton::Left) { [INFO] [stdout] 90 | | return true & self.clickable; [INFO] [stdout] 91 | | } [INFO] [stdout] 92 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 88 ~ if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) [INFO] [stdout] 89 ~ && is_mouse_button_released(MouseButton::Left) { [INFO] [stdout] 90 | return true & self.clickable; [INFO] [stdout] 91 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:117:5 [INFO] [stdout] | [INFO] [stdout] 117 | / return Tabs { [INFO] [stdout] 118 | | position: Vector2::new(), [INFO] [stdout] 119 | | size: Vector2::new(), [INFO] [stdout] 120 | | tab_names: tab_names, [INFO] [stdout] 121 | | selected, [INFO] [stdout] 122 | | font_size, [INFO] [stdout] 123 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 117 ~ Tabs { [INFO] [stdout] 118 + position: Vector2::new(), [INFO] [stdout] 119 + size: Vector2::new(), [INFO] [stdout] 120 + tab_names: tab_names, [INFO] [stdout] 121 + selected, [INFO] [stdout] 122 + font_size, [INFO] [stdout] 123 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:157:7 [INFO] [stdout] | [INFO] [stdout] 157 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 157 - return false; [INFO] [stdout] 157 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:146:7 [INFO] [stdout] | [INFO] [stdout] 146 | / if clickable { [INFO] [stdout] 147 | | if mouse.x > position.x && mouse.x < (position.x + size.x) { [INFO] [stdout] 148 | | if mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 149 | | graphics::draw_rectangle(position, size,GRAY); [INFO] [stdout] ... | [INFO] [stdout] 156 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 146 ~ if clickable [INFO] [stdout] 147 ~ && mouse.x > position.x && mouse.x < (position.x + size.x) { [INFO] [stdout] 148 | if mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] ... [INFO] [stdout] 154 | } [INFO] [stdout] 155 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:147:9 [INFO] [stdout] | [INFO] [stdout] 147 | / if mouse.x > position.x && mouse.x < (position.x + size.x) { [INFO] [stdout] 148 | | if mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 149 | | graphics::draw_rectangle(position, size,GRAY); [INFO] [stdout] 150 | | draw_text(text, position.x + 1.0 *vh + 10.0, position.y + size.y * 0.65, font_size , BLACK); [INFO] [stdout] ... | [INFO] [stdout] 155 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 147 ~ if mouse.x > position.x && mouse.x < (position.x + size.x) [INFO] [stdout] 148 ~ && mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 149 | graphics::draw_rectangle(position, size,GRAY); [INFO] [stdout] ... [INFO] [stdout] 153 | } [INFO] [stdout] 154 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression assigns a bool literal [INFO] [stdout] --> src/ui.rs:171:11 [INFO] [stdout] | [INFO] [stdout] 171 | / if x == i { [INFO] [stdout] 172 | | self.selected[x] = true; [INFO] [stdout] 173 | | } [INFO] [stdout] 174 | | else { [INFO] [stdout] 175 | | self.selected[x] = false; [INFO] [stdout] 176 | | } [INFO] [stdout] | |___________^ help: you can reduce it to: `self.selected[x] = x == i;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign [INFO] [stdout] = note: `#[warn(clippy::needless_bool_assign)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:188:5 [INFO] [stdout] | [INFO] [stdout] 188 | return 0; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 188 - return 0; [INFO] [stdout] 188 + 0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:216:3 [INFO] [stdout] | [INFO] [stdout] 216 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 216 - return false; [INFO] [stdout] 216 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:207:3 [INFO] [stdout] | [INFO] [stdout] 207 | / if mouse.x > position.x && mouse.x < (position.x + size) { [INFO] [stdout] 208 | | if mouse.y > position.y && mouse.y < (position.y + size) { [INFO] [stdout] 209 | | graphics::draw_rectangle(position, Vector2 { x: size, y: size },Color { r: 0.05, g: 0.0, b: 0.1, a: 0.2 }); [INFO] [stdout] 210 | | if is_mouse_button_pressed(MouseButton::Left) { [INFO] [stdout] ... | [INFO] [stdout] 215 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 207 ~ if mouse.x > position.x && mouse.x < (position.x + size) [INFO] [stdout] 208 ~ && mouse.y > position.y && mouse.y < (position.y + size) { [INFO] [stdout] 209 | graphics::draw_rectangle(position, Vector2 { x: size, y: size },Color { r: 0.05, g: 0.0, b: 0.1, a: 0.2 }); [INFO] [stdout] ... [INFO] [stdout] 213 | } [INFO] [stdout] 214 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/ui.rs:221:1 [INFO] [stdout] | [INFO] [stdout] 221 | pub fn slider(position: Vector2, size: Vector2, text: &str, font_size: f32, vh: f32, value: &mut f32, value_min: f32, value_max: f32) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:253:3 [INFO] [stdout] | [INFO] [stdout] 253 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 253 - return false; [INFO] [stdout] 253 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:239:3 [INFO] [stdout] | [INFO] [stdout] 239 | / if mouse.x > (position.x - margin) && mouse.x < (position.x + size.x + margin) { [INFO] [stdout] 240 | | if mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 241 | | if is_mouse_button_down(MouseButton::Left) { [INFO] [stdout] 242 | | *value = (mouse.x - position.x) / size.x * (value_max - value_min) + value_min; [INFO] [stdout] ... | [INFO] [stdout] 252 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 239 ~ if mouse.x > (position.x - margin) && mouse.x < (position.x + size.x + margin) [INFO] [stdout] 240 ~ && mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 241 | if is_mouse_button_down(MouseButton::Left) { [INFO] [stdout] ... [INFO] [stdout] 250 | } [INFO] [stdout] 251 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:240:5 [INFO] [stdout] | [INFO] [stdout] 240 | / if mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 241 | | if is_mouse_button_down(MouseButton::Left) { [INFO] [stdout] 242 | | *value = (mouse.x - position.x) / size.x * (value_max - value_min) + value_min; [INFO] [stdout] 243 | | if *value > value_max { [INFO] [stdout] ... | [INFO] [stdout] 251 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 240 ~ if mouse.y > position.y && mouse.y < (position.y + size.y) [INFO] [stdout] 241 ~ && is_mouse_button_down(MouseButton::Left) { [INFO] [stdout] 242 | *value = (mouse.x - position.x) / size.x * (value_max - value_min) + value_min; [INFO] [stdout] ... [INFO] [stdout] 249 | return true; [INFO] [stdout] 250 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (10/7) [INFO] [stdout] --> src/ui.rs:265:1 [INFO] [stdout] | [INFO] [stdout] 265 | pub fn draw_ability_icon(position: Vector2, size: Vector2, ability_index: usize, squished: bool, progress: f32, vh: f32, vw: f32, font: &Font, character_descriptions: HashMap, character: Character) -> () { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/ui.rs:265:231 [INFO] [stdout] | [INFO] [stdout] 265 | ...er, CharacterDescription>, character: Character) -> () { [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] --> src/ui.rs:308:118 [INFO] [stdout] | [INFO] [stdout] 308 | pub fn draw_player_info(position: Vector2, size: f32, player: ClientPlayer, font: &Font, vh: f32, settings: Settings) -> () { [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: casting float literal to `f32` is unnecessary [INFO] [stdout] --> src/ui.rs:323:26 [INFO] [stdout] | [INFO] [stdout] 323 | Vector2 {x: (size * (100.0 as f32 / 100.0) * 2.0 ) * vh, y: (size * 0.25 ) * vh}, [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `100.0_f32` [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: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:467:3 [INFO] [stdout] | [INFO] [stdout] 467 | return (menu_paused, wants_to_quit) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 467 - return (menu_paused, wants_to_quit) [INFO] [stdout] 467 + (menu_paused, wants_to_quit) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ui.rs:420:44 [INFO] [stdout] | [INFO] [stdout] 420 | audio::set_volume(sfx_self_volume, &mut tracks.0); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `tracks.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ui.rs:421:45 [INFO] [stdout] | [INFO] [stdout] 421 | audio::set_volume(sfx_other_volume, &mut tracks.1); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `tracks.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ui.rs:422:41 [INFO] [stdout] | [INFO] [stdout] 422 | audio::set_volume(music_volume, &mut tracks.2); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `tracks.2` [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 `return` statement [INFO] [stdout] --> src/ui.rs:477:5 [INFO] [stdout] | [INFO] [stdout] 477 | return Vector2 { x: self.position.x + position.x, y: self.position.y + position.y } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 477 - return Vector2 { x: self.position.x + position.x, y: self.position.y + position.y } [INFO] [stdout] 477 + Vector2 { x: self.position.x + position.x, y: self.position.y + position.y } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:497:5 [INFO] [stdout] | [INFO] [stdout] 497 | return Notification { start_time: Instant::now(), text: String::from(text), duration } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 497 - return Notification { start_time: Instant::now(), text: String::from(text), duration } [INFO] [stdout] 497 + Notification { start_time: Instant::now(), text: String::from(text), duration } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Settings` [INFO] [stdout] --> src/ui.rs:519:3 [INFO] [stdout] | [INFO] [stdout] 519 | / pub fn new() -> Settings{ [INFO] [stdout] 520 | | return Settings { [INFO] [stdout] 521 | | camera_smoothing: true, [INFO] [stdout] 522 | | display_char_name_instead: true, [INFO] [stdout] ... | [INFO] [stdout] 532 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 518 + impl Default for Settings { [INFO] [stdout] 519 + fn default() -> Self { [INFO] [stdout] 520 + Self::new() [INFO] [stdout] 521 + } [INFO] [stdout] 522 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:520:5 [INFO] [stdout] | [INFO] [stdout] 520 | / return Settings { [INFO] [stdout] 521 | | camera_smoothing: true, [INFO] [stdout] 522 | | display_char_name_instead: true, [INFO] [stdout] 523 | | fullscreen: false, [INFO] [stdout] ... | [INFO] [stdout] 530 | | keybinds: KeybindSettings::new(), [INFO] [stdout] 531 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 520 ~ Settings { [INFO] [stdout] 521 + camera_smoothing: true, [INFO] [stdout] 522 + display_char_name_instead: true, [INFO] [stdout] 523 + fullscreen: false, [INFO] [stdout] 524 + saved_username: String::new(), [INFO] [stdout] 525 + store_credentials: false, [INFO] [stdout] 526 + master_volume: 80.0, [INFO] [stdout] 527 + music_volume: 100.0, [INFO] [stdout] 528 + sfx_self_volume: 100.0, [INFO] [stdout] 529 + sfx_other_volume: 50.0, [INFO] [stdout] 530 + keybinds: KeybindSettings::new(), [INFO] [stdout] 531 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:548:17 [INFO] [stdout] | [INFO] [stdout] 548 | return settings [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 548 - return settings [INFO] [stdout] 548 + settings [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:553:17 [INFO] [stdout] | [INFO] [stdout] 553 | return Settings::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 553 - return Settings::new(); [INFO] [stdout] 553 + Settings::new() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:566:13 [INFO] [stdout] | [INFO] [stdout] 566 | return Settings::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 566 - return Settings::new(); [INFO] [stdout] 566 + Settings::new() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:572:9 [INFO] [stdout] | [INFO] [stdout] 572 | return Settings::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 572 - return Settings::new(); [INFO] [stdout] 572 + Settings::new() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: file opened with `create`, but `truncate` behavior not defined [INFO] [stdout] --> src/ui.rs:538:8 [INFO] [stdout] | [INFO] [stdout] 538 | .create(true) [INFO] [stdout] | ^^^^^^^^^^^^- help: add: `.truncate(true)` [INFO] [stdout] | [INFO] [stdout] = help: if you intend to overwrite an existing file entirely, call `.truncate(true)` [INFO] [stdout] = help: if you instead know that you may want to keep some parts of the old file, call `.truncate(false)` [INFO] [stdout] = help: alternatively, use `.append(true)` to append to the file instead of overwriting it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options [INFO] [stdout] = note: `#[warn(clippy::suspicious_open_options)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/ui.rs:579:5 [INFO] [stdout] | [INFO] [stdout] 579 | / match settings_file { [INFO] [stdout] 580 | | Ok(mut file) => { [INFO] [stdout] 581 | | file.write_all(&bincode::serialize::(&self).expect("Serialization failure.")).expect("oops"); [INFO] [stdout] ... | [INFO] [stdout] 584 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 579 ~ if let Ok(mut file) = settings_file { [INFO] [stdout] 580 + file.write_all(&bincode::serialize::(&self).expect("Serialization failure.")).expect("oops"); [INFO] [stdout] 581 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ui.rs:581:56 [INFO] [stdout] | [INFO] [stdout] 581 | file.write_all(&bincode::serialize::(&self).expect("Serialization failure.")).expect("oops"); [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: you should consider adding a `Default` implementation for `KeybindSettings` [INFO] [stdout] --> src/ui.rs:605:3 [INFO] [stdout] | [INFO] [stdout] 605 | / pub fn new() -> KeybindSettings { [INFO] [stdout] 606 | | return KeybindSettings { [INFO] [stdout] 607 | | walk_up: (device_query::Keycode::W as u16, u16::MAX, 255, 255), [INFO] [stdout] 608 | | walk_down: (device_query::Keycode::S as u16, u16::MAX, 255, 255), [INFO] [stdout] ... | [INFO] [stdout] 617 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 604 + impl Default for KeybindSettings { [INFO] [stdout] 605 + fn default() -> Self { [INFO] [stdout] 606 + Self::new() [INFO] [stdout] 607 + } [INFO] [stdout] 608 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:606:5 [INFO] [stdout] | [INFO] [stdout] 606 | / return KeybindSettings { [INFO] [stdout] 607 | | walk_up: (device_query::Keycode::W as u16, u16::MAX, 255, 255), [INFO] [stdout] 608 | | walk_down: (device_query::Keycode::S as u16, u16::MAX, 255, 255), [INFO] [stdout] 609 | | walk_left: (device_query::Keycode::A as u16, u16::MAX, 255, 255), [INFO] [stdout] ... | [INFO] [stdout] 615 | | fullscreen: (device_query::Keycode::F11 as u16, u16::MAX, 255, 255), [INFO] [stdout] 616 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 606 ~ KeybindSettings { [INFO] [stdout] 607 + walk_up: (device_query::Keycode::W as u16, u16::MAX, 255, 255), [INFO] [stdout] 608 + walk_down: (device_query::Keycode::S as u16, u16::MAX, 255, 255), [INFO] [stdout] 609 + walk_left: (device_query::Keycode::A as u16, u16::MAX, 255, 255), [INFO] [stdout] 610 + walk_right: (device_query::Keycode::D as u16, u16::MAX, 255, 255), [INFO] [stdout] 611 + primary: (u16::MAX, u16::MAX, 1, 255), [INFO] [stdout] 612 + secondary: (u16::MAX, u16::MAX, rmb_index() as u8, 255), [INFO] [stdout] 613 + dash: (device_query::Keycode::Space as u16, u16::MAX, 255, 255), [INFO] [stdout] 614 + open_chat: (device_query::Keycode::Enter as u16, u16::MAX, 255, 255), [INFO] [stdout] 615 + fullscreen: (device_query::Keycode::F11 as u16, u16::MAX, 255, 255), [INFO] [stdout] 616 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:739:3 [INFO] [stdout] | [INFO] [stdout] 739 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 739 - return false; [INFO] [stdout] 739 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:742:3 [INFO] [stdout] | [INFO] [stdout] 742 | / return match keycode { [INFO] [stdout] 743 | | 0 => "Key0".to_string(), [INFO] [stdout] 744 | | 1 => "Key1".to_string(), [INFO] [stdout] 745 | | 2 => "Key2".to_string(), [INFO] [stdout] ... | [INFO] [stdout] 854 | | _ => "???".to_string(), [INFO] [stdout] 855 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 742 ~ match keycode { [INFO] [stdout] 743 + 0 => "Key0".to_string(), [INFO] [stdout] 744 + 1 => "Key1".to_string(), [INFO] [stdout] 745 + 2 => "Key2".to_string(), [INFO] [stdout] 746 + 3 => "Key3".to_string(), [INFO] [stdout] 747 + 4 => "Key4".to_string(), [INFO] [stdout] 748 + 5 => "Key5".to_string(), [INFO] [stdout] 749 + 6 => "Key6".to_string(), [INFO] [stdout] 750 + 7 => "Key7".to_string(), [INFO] [stdout] 751 + 8 => "Key8".to_string(), [INFO] [stdout] 752 + 9 => "Key9".to_string(), [INFO] [stdout] 753 + 10 => "A".to_string(), [INFO] [stdout] 754 + 11 => "B".to_string(), [INFO] [stdout] 755 + 12 => "C".to_string(), [INFO] [stdout] 756 + 13 => "D".to_string(), [INFO] [stdout] 757 + 14 => "E".to_string(), [INFO] [stdout] 758 + 15 => "F".to_string(), [INFO] [stdout] 759 + 16 => "G".to_string(), [INFO] [stdout] 760 + 17 => "H".to_string(), [INFO] [stdout] 761 + 18 => "I".to_string(), [INFO] [stdout] 762 + 19 => "J".to_string(), [INFO] [stdout] 763 + 20 => "K".to_string(), [INFO] [stdout] 764 + 21 => "L".to_string(), [INFO] [stdout] 765 + 22 => "M".to_string(), [INFO] [stdout] 766 + 23 => "N".to_string(), [INFO] [stdout] 767 + 24 => "O".to_string(), [INFO] [stdout] 768 + 25 => "P".to_string(), [INFO] [stdout] 769 + 26 => "Q".to_string(), [INFO] [stdout] 770 + 27 => "R".to_string(), [INFO] [stdout] 771 + 28 => "S".to_string(), [INFO] [stdout] 772 + 29 => "T".to_string(), [INFO] [stdout] 773 + 30 => "U".to_string(), [INFO] [stdout] 774 + 31 => "V".to_string(), [INFO] [stdout] 775 + 32 => "W".to_string(), [INFO] [stdout] 776 + 33 => "X".to_string(), [INFO] [stdout] 777 + 34 => "Y".to_string(), [INFO] [stdout] 778 + 35 => "Z".to_string(), [INFO] [stdout] 779 + 36 => "F1".to_string(), [INFO] [stdout] 780 + 37 => "F2".to_string(), [INFO] [stdout] 781 + 38 => "F3".to_string(), [INFO] [stdout] 782 + 39 => "F4".to_string(), [INFO] [stdout] 783 + 40 => "F5".to_string(), [INFO] [stdout] 784 + 41 => "F6".to_string(), [INFO] [stdout] 785 + 42 => "F7".to_string(), [INFO] [stdout] 786 + 43 => "F8".to_string(), [INFO] [stdout] 787 + 44 => "F9".to_string(), [INFO] [stdout] 788 + 45 => "F10".to_string(), [INFO] [stdout] 789 + 46 => "F11".to_string(), [INFO] [stdout] 790 + 47 => "F12".to_string(), [INFO] [stdout] 791 + 48 => "F13".to_string(), [INFO] [stdout] 792 + 49 => "F14".to_string(), [INFO] [stdout] 793 + 50 => "F15".to_string(), [INFO] [stdout] 794 + 51 => "F16".to_string(), [INFO] [stdout] 795 + 52 => "F17".to_string(), [INFO] [stdout] 796 + 53 => "F18".to_string(), [INFO] [stdout] 797 + 54 => "F19".to_string(), [INFO] [stdout] 798 + 55 => "F20".to_string(), [INFO] [stdout] 799 + 56 => "Escape".to_string(), [INFO] [stdout] 800 + 57 => "Space".to_string(), [INFO] [stdout] 801 + 58 => "LControl".to_string(), [INFO] [stdout] 802 + 59 => "RControl".to_string(), [INFO] [stdout] 803 + 60 => "LShift".to_string(), [INFO] [stdout] 804 + 61 => "RShift".to_string(), [INFO] [stdout] 805 + 62 => "LAlt".to_string(), [INFO] [stdout] 806 + 63 => "RAlt".to_string(), [INFO] [stdout] 807 + 64 => "Command".to_string(), [INFO] [stdout] 808 + 65 => "LOption".to_string(), [INFO] [stdout] 809 + 66 => "ROption".to_string(), [INFO] [stdout] 810 + 67 => "LMeta".to_string(), [INFO] [stdout] 811 + 68 => "RMeta".to_string(), [INFO] [stdout] 812 + 69 => "Enter".to_string(), [INFO] [stdout] 813 + 70 => "Up".to_string(), [INFO] [stdout] 814 + 71 => "Down".to_string(), [INFO] [stdout] 815 + 72 => "Left".to_string(), [INFO] [stdout] 816 + 73 => "Right".to_string(), [INFO] [stdout] 817 + 74 => "Backspace".to_string(), [INFO] [stdout] 818 + 75 => "CapsLock".to_string(), [INFO] [stdout] 819 + 76 => "Tab".to_string(), [INFO] [stdout] 820 + 77 => "Home".to_string(), [INFO] [stdout] 821 + 78 => "End".to_string(), [INFO] [stdout] 822 + 79 => "PageUp".to_string(), [INFO] [stdout] 823 + 80 => "PageDown".to_string(), [INFO] [stdout] 824 + 81 => "Insert".to_string(), [INFO] [stdout] 825 + 82 => "Delete".to_string(), [INFO] [stdout] 826 + 83 => "Numpad0".to_string(), [INFO] [stdout] 827 + 84 => "Numpad1".to_string(), [INFO] [stdout] 828 + 85 => "Numpad2".to_string(), [INFO] [stdout] 829 + 86 => "Numpad3".to_string(), [INFO] [stdout] 830 + 87 => "Numpad4".to_string(), [INFO] [stdout] 831 + 88 => "Numpad5".to_string(), [INFO] [stdout] 832 + 89 => "Numpad6".to_string(), [INFO] [stdout] 833 + 90 => "Numpad7".to_string(), [INFO] [stdout] 834 + 91 => "Numpad8".to_string(), [INFO] [stdout] 835 + 92 => "Numpad9".to_string(), [INFO] [stdout] 836 + 93 => "NumpadSubtract".to_string(), [INFO] [stdout] 837 + 94 => "NumpadAdd".to_string(), [INFO] [stdout] 838 + 95 => "NumpadDivide".to_string(), [INFO] [stdout] 839 + 96 => "NumpadMultiply".to_string(), [INFO] [stdout] 840 + 97 => "NumpadEquals".to_string(), [INFO] [stdout] 841 + 98 => "NumpadEnter".to_string(), [INFO] [stdout] 842 + 99 => "NumpadDecimal".to_string(), [INFO] [stdout] 843 + 100 => "Grave".to_string(), [INFO] [stdout] 844 + 101 => "Minus".to_string(), [INFO] [stdout] 845 + 102 => "Equal".to_string(), [INFO] [stdout] 846 + 103 => "LeftBracket".to_string(), [INFO] [stdout] 847 + 104 => "RightBracket".to_string(), [INFO] [stdout] 848 + 105 => "BackSlash".to_string(), [INFO] [stdout] 849 + 106 => "Semicolon".to_string(), [INFO] [stdout] 850 + 107 => "Apostrophe".to_string(), [INFO] [stdout] 851 + 108 => "Comma".to_string(), [INFO] [stdout] 852 + 109 => "Dot".to_string(), [INFO] [stdout] 853 + 110 => "Slash".to_string(), [INFO] [stdout] 854 + _ => "???".to_string(), [INFO] [stdout] 855 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (14/7) [INFO] [stdout] --> src/ui.rs:860:1 [INFO] [stdout] | [INFO] [stdout] 860 | / pub fn chatbox( [INFO] [stdout] 861 | | position: Vector2, [INFO] [stdout] 862 | | size: Vector2, [INFO] [stdout] 863 | | friends: Vec<(String, FriendShipStatus, bool)>, [INFO] [stdout] ... | [INFO] [stdout] 874 | | timer: &mut Instant, [INFO] [stdout] 875 | | ) { [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/ui.rs:891:8 [INFO] [stdout] | [INFO] [stdout] 891 | && friend.2 == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `friend.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:908:3 [INFO] [stdout] | [INFO] [stdout] 908 | / if !*is_chatbox_open { [INFO] [stdout] 909 | | if get_keys_pressed().contains(&KeyCode::Enter) { [INFO] [stdout] 910 | | clear_input_queue(); [INFO] [stdout] 911 | | *is_chatbox_open = true; [INFO] [stdout] ... | [INFO] [stdout] 915 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 908 ~ if !*is_chatbox_open [INFO] [stdout] 909 ~ && get_keys_pressed().contains(&KeyCode::Enter) { [INFO] [stdout] 910 | clear_input_queue(); [INFO] [stdout] ... [INFO] [stdout] 913 | return [INFO] [stdout] 914 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:917:3 [INFO] [stdout] | [INFO] [stdout] 917 | / if *is_chatbox_open { [INFO] [stdout] 918 | | if get_keys_pressed().contains(&KeyCode::Enter) [INFO] [stdout] 919 | | && (chat_input_buffer.is_empty() || !*chat_input_field_selected) { [INFO] [stdout] 920 | | *is_chatbox_open = false; [INFO] [stdout] ... | [INFO] [stdout] 924 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 917 ~ if *is_chatbox_open [INFO] [stdout] 918 ~ && get_keys_pressed().contains(&KeyCode::Enter) [INFO] [stdout] 919 | && (chat_input_buffer.is_empty() || !*chat_input_field_selected) { [INFO] [stdout] ... [INFO] [stdout] 922 | return [INFO] [stdout] 923 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ui.rs:938:44 [INFO] [stdout] | [INFO] [stdout] 938 | let mut displayed_selected_friend = if online_friends.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!online_friends.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: unneeded late initialization [INFO] [stdout] --> src/ui.rs:939:7 [INFO] [stdout] | [INFO] [stdout] 939 | let peer_username; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `peer_username` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 939 ~ [INFO] [stdout] 940 | let split: Vec<&str> = (*online_friends[*selected_friend]).split(":").collect(); [INFO] [stdout] 941 ~ let peer_username = if *split[0] == username { [INFO] [stdout] 942 ~ split[1] [INFO] [stdout] 943 | } else { [INFO] [stdout] 944 ~ split[0] [INFO] [stdout] 945 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/ui.rs:978:7 [INFO] [stdout] | [INFO] [stdout] 978 | let peer_username; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `peer_username` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 978 ~ [INFO] [stdout] 979 | let split: Vec<&str> = (*online_friends[*selected_friend]).split(":").collect(); [INFO] [stdout] 980 ~ let peer_username = if *split[0] == username { [INFO] [stdout] 981 ~ split[1] [INFO] [stdout] 982 | } else { [INFO] [stdout] 983 ~ split[0] [INFO] [stdout] 984 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:35:5 [INFO] [stdout] | [INFO] [stdout] 35 | / return Button { [INFO] [stdout] 36 | | position, [INFO] [stdout] 37 | | size, [INFO] [stdout] 38 | | text: text.to_string(), [INFO] [stdout] 39 | | font_size, [INFO] [stdout] 40 | | clickable: true, [INFO] [stdout] 41 | | } [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] 35 ~ Button { [INFO] [stdout] 36 + position, [INFO] [stdout] 37 + size, [INFO] [stdout] 38 + text: text.to_string(), [INFO] [stdout] 39 + font_size, [INFO] [stdout] 40 + clickable: true, [INFO] [stdout] 41 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | / if self.clickable { [INFO] [stdout] 55 | | if mouse.x > position.x && mouse.x < (position.x + size.x) { [INFO] [stdout] 56 | | if mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 57 | | graphics::draw_rectangle(position, size,GRAY); [INFO] [stdout] ... | [INFO] [stdout] 61 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 54 ~ if self.clickable [INFO] [stdout] 55 ~ && mouse.x > position.x && mouse.x < (position.x + size.x) { [INFO] [stdout] 56 | if mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] ... [INFO] [stdout] 59 | } [INFO] [stdout] 60 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:55:7 [INFO] [stdout] | [INFO] [stdout] 55 | / if mouse.x > position.x && mouse.x < (position.x + size.x) { [INFO] [stdout] 56 | | if mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 57 | | graphics::draw_rectangle(position, size,GRAY); [INFO] [stdout] 58 | | draw_text(text, position.x + 1.0*vh + 10.0, position.y + size.y * 0.65, font_size , BLACK); [INFO] [stdout] 59 | | } [INFO] [stdout] 60 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 55 ~ if mouse.x > position.x && mouse.x < (position.x + size.x) [INFO] [stdout] 56 ~ && mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 57 | graphics::draw_rectangle(position, size,GRAY); [INFO] [stdout] 58 | draw_text(text, position.x + 1.0*vh + 10.0, position.y + size.y * 0.65, font_size , BLACK); [INFO] [stdout] 59 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:72:5 [INFO] [stdout] | [INFO] [stdout] 72 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 72 - return false; [INFO] [stdout] 72 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ui.rs:1029:8 [INFO] [stdout] | [INFO] [stdout] 1029 | if formatted_messages.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!formatted_messages.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: the loop variable `m_index` is used to index `formatted_messages` [INFO] [stdout] --> src/ui.rs:1030:22 [INFO] [stdout] | [INFO] [stdout] 1030 | for m_index in *scroll_index..(*formatted_messages).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] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 1030 - for m_index in *scroll_index..(*formatted_messages).len() { [INFO] [stdout] 1030 + for (m_index, ) in formatted_messages.iter().enumerate().take((*formatted_messages).len()).skip(*scroll_index) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/ui.rs:1060:1 [INFO] [stdout] | [INFO] [stdout] 1060 | pub fn text_input(position: Vector2, size: Vector2, buffer: &mut String, active: &mut bool, font_size: f32, vh: f32, hideable: bool, show_password: &mut bool) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:65:5 [INFO] [stdout] | [INFO] [stdout] 65 | / if mouse.x > self.position.x && mouse.x < (self.position.x + self.size.x) { [INFO] [stdout] 66 | | if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 67 | | if is_mouse_button_down(MouseButton::Left) { [INFO] [stdout] 68 | | return true & self.clickable; [INFO] [stdout] ... | [INFO] [stdout] 71 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 65 ~ if mouse.x > self.position.x && mouse.x < (self.position.x + self.size.x) [INFO] [stdout] 66 ~ && mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 67 | if is_mouse_button_down(MouseButton::Left) { [INFO] [stdout] 68 | return true & self.clickable; [INFO] [stdout] 69 | } [INFO] [stdout] 70 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:66:7 [INFO] [stdout] | [INFO] [stdout] 66 | / if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 67 | | if is_mouse_button_down(MouseButton::Left) { [INFO] [stdout] 68 | | return true & self.clickable; [INFO] [stdout] 69 | | } [INFO] [stdout] 70 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 66 ~ if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) [INFO] [stdout] 67 ~ && is_mouse_button_down(MouseButton::Left) { [INFO] [stdout] 68 | return true & self.clickable; [INFO] [stdout] 69 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:83:5 [INFO] [stdout] | [INFO] [stdout] 83 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 83 - return false; [INFO] [stdout] 83 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:76:5 [INFO] [stdout] | [INFO] [stdout] 76 | / if mouse.x > self.position.x && mouse.x < (self.position.x + self.size.x) { [INFO] [stdout] 77 | | if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 78 | | if is_mouse_button_pressed(MouseButton::Left) { [INFO] [stdout] 79 | | return true & self.clickable; [INFO] [stdout] ... | [INFO] [stdout] 82 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 76 ~ if mouse.x > self.position.x && mouse.x < (self.position.x + self.size.x) [INFO] [stdout] 77 ~ && mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 78 | if is_mouse_button_pressed(MouseButton::Left) { [INFO] [stdout] 79 | return true & self.clickable; [INFO] [stdout] 80 | } [INFO] [stdout] 81 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:77:7 [INFO] [stdout] | [INFO] [stdout] 77 | / if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 78 | | if is_mouse_button_pressed(MouseButton::Left) { [INFO] [stdout] 79 | | return true & self.clickable; [INFO] [stdout] 80 | | } [INFO] [stdout] 81 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 77 ~ if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) [INFO] [stdout] 78 ~ && is_mouse_button_pressed(MouseButton::Left) { [INFO] [stdout] 79 | return true & self.clickable; [INFO] [stdout] 80 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:94:5 [INFO] [stdout] | [INFO] [stdout] 94 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 94 - return false; [INFO] [stdout] 94 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:87:5 [INFO] [stdout] | [INFO] [stdout] 87 | / if mouse.x > self.position.x && mouse.x < (self.position.x + self.size.x) { [INFO] [stdout] 88 | | if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 89 | | if is_mouse_button_released(MouseButton::Left) { [INFO] [stdout] 90 | | return true & self.clickable; [INFO] [stdout] ... | [INFO] [stdout] 93 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 87 ~ if mouse.x > self.position.x && mouse.x < (self.position.x + self.size.x) [INFO] [stdout] 88 ~ && mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 89 | if is_mouse_button_released(MouseButton::Left) { [INFO] [stdout] 90 | return true & self.clickable; [INFO] [stdout] 91 | } [INFO] [stdout] 92 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:88:7 [INFO] [stdout] | [INFO] [stdout] 88 | / if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) { [INFO] [stdout] 89 | | if is_mouse_button_released(MouseButton::Left) { [INFO] [stdout] 90 | | return true & self.clickable; [INFO] [stdout] 91 | | } [INFO] [stdout] 92 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 88 ~ if mouse.y > self.position.y && mouse.y < (self.position.y + self.size.y) [INFO] [stdout] 89 ~ && is_mouse_button_released(MouseButton::Left) { [INFO] [stdout] 90 | return true & self.clickable; [INFO] [stdout] 91 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:117:5 [INFO] [stdout] | [INFO] [stdout] 117 | / return Tabs { [INFO] [stdout] 118 | | position: Vector2::new(), [INFO] [stdout] 119 | | size: Vector2::new(), [INFO] [stdout] 120 | | tab_names: tab_names, [INFO] [stdout] 121 | | selected, [INFO] [stdout] 122 | | font_size, [INFO] [stdout] 123 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 117 ~ Tabs { [INFO] [stdout] 118 + position: Vector2::new(), [INFO] [stdout] 119 + size: Vector2::new(), [INFO] [stdout] 120 + tab_names: tab_names, [INFO] [stdout] 121 + selected, [INFO] [stdout] 122 + font_size, [INFO] [stdout] 123 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:1190:7 [INFO] [stdout] | [INFO] [stdout] 1190 | return password; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1190 - return password; [INFO] [stdout] 1190 + password [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:1194:7 [INFO] [stdout] | [INFO] [stdout] 1194 | return String::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1194 - return String::new(); [INFO] [stdout] 1194 + String::new() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:157:7 [INFO] [stdout] | [INFO] [stdout] 157 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 157 - return false; [INFO] [stdout] 157 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:146:7 [INFO] [stdout] | [INFO] [stdout] 146 | / if clickable { [INFO] [stdout] 147 | | if mouse.x > position.x && mouse.x < (position.x + size.x) { [INFO] [stdout] 148 | | if mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 149 | | graphics::draw_rectangle(position, size,GRAY); [INFO] [stdout] ... | [INFO] [stdout] 156 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 146 ~ if clickable [INFO] [stdout] 147 ~ && mouse.x > position.x && mouse.x < (position.x + size.x) { [INFO] [stdout] 148 | if mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] ... [INFO] [stdout] 154 | } [INFO] [stdout] 155 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:147:9 [INFO] [stdout] | [INFO] [stdout] 147 | / if mouse.x > position.x && mouse.x < (position.x + size.x) { [INFO] [stdout] 148 | | if mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 149 | | graphics::draw_rectangle(position, size,GRAY); [INFO] [stdout] 150 | | draw_text(text, position.x + 1.0 *vh + 10.0, position.y + size.y * 0.65, font_size , BLACK); [INFO] [stdout] ... | [INFO] [stdout] 155 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 147 ~ if mouse.x > position.x && mouse.x < (position.x + size.x) [INFO] [stdout] 148 ~ && mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 149 | graphics::draw_rectangle(position, size,GRAY); [INFO] [stdout] ... [INFO] [stdout] 153 | } [INFO] [stdout] 154 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression assigns a bool literal [INFO] [stdout] --> src/ui.rs:171:11 [INFO] [stdout] | [INFO] [stdout] 171 | / if x == i { [INFO] [stdout] 172 | | self.selected[x] = true; [INFO] [stdout] 173 | | } [INFO] [stdout] 174 | | else { [INFO] [stdout] 175 | | self.selected[x] = false; [INFO] [stdout] 176 | | } [INFO] [stdout] | |___________^ help: you can reduce it to: `self.selected[x] = x == i;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign [INFO] [stdout] = note: `#[warn(clippy::needless_bool_assign)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:188:5 [INFO] [stdout] | [INFO] [stdout] 188 | return 0; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 188 - return 0; [INFO] [stdout] 188 + 0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:216:3 [INFO] [stdout] | [INFO] [stdout] 216 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 216 - return false; [INFO] [stdout] 216 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Vector2` [INFO] [stdout] --> src/maths.rs:32:3 [INFO] [stdout] | [INFO] [stdout] 32 | / pub fn new() -> Vector2 { [INFO] [stdout] 33 | | return Vector2 {x: 0.0, y: 0.0}; [INFO] [stdout] 34 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 15 + impl Default for Vector2 { [INFO] [stdout] 16 + fn default() -> Self { [INFO] [stdout] 17 + Self::new() [INFO] [stdout] 18 + } [INFO] [stdout] 19 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | / return Vector2 { [INFO] [stdout] 22 | | x: self.x / magnitude, [INFO] [stdout] 23 | | y: self.y / magnitude, [INFO] [stdout] 24 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 21 ~ Vector2 { [INFO] [stdout] 22 + x: self.x / magnitude, [INFO] [stdout] 23 + y: self.y / magnitude, [INFO] [stdout] 24 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | return Vector2::distance(Vector2 { x: 0.0, y: 0.0 }, *self); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 27 - return Vector2::distance(Vector2 { x: 0.0, y: 0.0 }, *self); [INFO] [stdout] 27 + Vector2::distance(Vector2 { x: 0.0, y: 0.0 }, *self) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:207:3 [INFO] [stdout] | [INFO] [stdout] 207 | / if mouse.x > position.x && mouse.x < (position.x + size) { [INFO] [stdout] 208 | | if mouse.y > position.y && mouse.y < (position.y + size) { [INFO] [stdout] 209 | | graphics::draw_rectangle(position, Vector2 { x: size, y: size },Color { r: 0.05, g: 0.0, b: 0.1, a: 0.2 }); [INFO] [stdout] 210 | | if is_mouse_button_pressed(MouseButton::Left) { [INFO] [stdout] ... | [INFO] [stdout] 215 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 207 ~ if mouse.x > position.x && mouse.x < (position.x + size) [INFO] [stdout] 208 ~ && mouse.y > position.y && mouse.y < (position.y + size) { [INFO] [stdout] 209 | graphics::draw_rectangle(position, Vector2 { x: size, y: size },Color { r: 0.05, g: 0.0, b: 0.1, a: 0.2 }); [INFO] [stdout] ... [INFO] [stdout] 213 | } [INFO] [stdout] 214 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | return Vec2 { x: self.x, y: self.y }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - return Vec2 { x: self.x, y: self.y }; [INFO] [stdout] 30 + Vec2 { x: self.x, y: self.y } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | return Vector2 {x: 0.0, y: 0.0}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 33 - return Vector2 {x: 0.0, y: 0.0}; [INFO] [stdout] 33 + Vector2 {x: 0.0, y: 0.0} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | return f32::sqrt(f32::powi(vec1.x - vec2.x, 2) + f32::powi(vec1.y - vec2.y, 2)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 36 - return f32::sqrt(f32::powi(vec1.x - vec2.x, 2) + f32::powi(vec1.y - vec2.y, 2)) [INFO] [stdout] 36 + f32::sqrt(f32::powi(vec1.x - vec2.x, 2) + f32::powi(vec1.y - vec2.y, 2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/ui.rs:221:1 [INFO] [stdout] | [INFO] [stdout] 221 | pub fn slider(position: Vector2, size: Vector2, text: &str, font_size: f32, vh: f32, value: &mut f32, value_min: f32, value_max: f32) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 41 | / return Vector2 { [INFO] [stdout] 42 | | x: vec2.x - vec1.x, [INFO] [stdout] 43 | | y: vec2.y - vec1.y, [INFO] [stdout] 44 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 41 ~ Vector2 { [INFO] [stdout] 42 + x: vec2.x - vec1.x, [INFO] [stdout] 43 + y: vec2.y - vec1.y, [INFO] [stdout] 44 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:253:3 [INFO] [stdout] | [INFO] [stdout] 253 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 253 - return false; [INFO] [stdout] 253 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:47:5 [INFO] [stdout] | [INFO] [stdout] 47 | return Vector2 { x: vec2.x, y: vec2.y }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 47 - return Vector2 { x: vec2.x, y: vec2.y }; [INFO] [stdout] 47 + Vector2 { x: vec2.x, y: vec2.y } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/maths.rs:68:43 [INFO] [stdout] | [INFO] [stdout] 68 | fn add_assign(&mut self, other: Vector2) -> () { [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] --> src/maths.rs:77:43 [INFO] [stdout] | [INFO] [stdout] 77 | fn sub_assign(&mut self, other: Vector2) -> () { [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 `return` statement [INFO] [stdout] --> src/maths.rs:132:5 [INFO] [stdout] | [INFO] [stdout] 132 | return sign; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 132 - return sign; [INFO] [stdout] 132 + sign [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:239:3 [INFO] [stdout] | [INFO] [stdout] 239 | / if mouse.x > (position.x - margin) && mouse.x < (position.x + size.x + margin) { [INFO] [stdout] 240 | | if mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 241 | | if is_mouse_button_down(MouseButton::Left) { [INFO] [stdout] 242 | | *value = (mouse.x - position.x) / size.x * (value_max - value_min) + value_min; [INFO] [stdout] ... | [INFO] [stdout] 252 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 239 ~ if mouse.x > (position.x - margin) && mouse.x < (position.x + size.x + margin) [INFO] [stdout] 240 ~ && mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 241 | if is_mouse_button_down(MouseButton::Left) { [INFO] [stdout] ... [INFO] [stdout] 250 | } [INFO] [stdout] 251 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:240:5 [INFO] [stdout] | [INFO] [stdout] 240 | / if mouse.y > position.y && mouse.y < (position.y + size.y) { [INFO] [stdout] 241 | | if is_mouse_button_down(MouseButton::Left) { [INFO] [stdout] 242 | | *value = (mouse.x - position.x) / size.x * (value_max - value_min) + value_min; [INFO] [stdout] 243 | | if *value > value_max { [INFO] [stdout] ... | [INFO] [stdout] 251 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 240 ~ if mouse.y > position.y && mouse.y < (position.y + size.y) [INFO] [stdout] 241 ~ && is_mouse_button_down(MouseButton::Left) { [INFO] [stdout] 242 | *value = (mouse.x - position.x) / size.x * (value_max - value_min) + value_min; [INFO] [stdout] ... [INFO] [stdout] 249 | return true; [INFO] [stdout] 250 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:148:7 [INFO] [stdout] | [INFO] [stdout] 148 | return current; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 148 - return current; [INFO] [stdout] 148 + current [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u16` which implements the `Copy` trait [INFO] [stdout] --> src/maths.rs:146:21 [INFO] [stdout] | [INFO] [stdout] 146 | let current = self.clone(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*self` [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: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:203:3 [INFO] [stdout] | [INFO] [stdout] 203 | return (adjusted_raw_movement, adjusted_movement); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 203 - return (adjusted_raw_movement, adjusted_movement); [INFO] [stdout] 203 + (adjusted_raw_movement, adjusted_movement) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (10/7) [INFO] [stdout] --> src/ui.rs:265:1 [INFO] [stdout] | [INFO] [stdout] 265 | pub fn draw_ability_icon(position: Vector2, size: Vector2, ability_index: usize, squished: bool, progress: f32, vh: f32, vw: f32, font: &Font, character_descriptions: HashMap, character: Character) -> () { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/ui.rs:265:231 [INFO] [stdout] | [INFO] [stdout] 265 | ...er, CharacterDescription>, character: Character) -> () { [INFO] [stdout] | ^^^^^^ help: remove the `-> ()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_unit [INFO] [stdout] = note: `#[warn(clippy::unused_unit)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/maths.rs:206:1 [INFO] [stdout] | [INFO] [stdout] 206 | pub fn dashing_logic(mut is_dashing: bool, mut dashed_distance: f32, dash_direction: Vector2, delta_time: f64, char_dash_speed: f32, char_dash_distance: f32, game_objects: Vec, current_position: Vector2) -> (Vector2, f32, bool) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:241:3 [INFO] [stdout] | [INFO] [stdout] 241 | return (new_position, dashed_distance, is_dashing); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 241 - return (new_position, dashed_distance, is_dashing); [INFO] [stdout] 241 + (new_position, dashed_distance, is_dashing) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/ui.rs:308:118 [INFO] [stdout] | [INFO] [stdout] 308 | pub fn draw_player_info(position: Vector2, size: f32, player: ClientPlayer, font: &Font, vh: f32, settings: Settings) -> () { [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: doc list item overindented [INFO] [stdout] --> src/maths.rs:260:4 [INFO] [stdout] | [INFO] [stdout] 260 | /// = \frac{|bd - ac|}{\sqrt{b^2 + a^2}}$ [INFO] [stdout] | ^^^^^^^^^^ help: try using ` ` (4 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] = note: `#[warn(clippy::doc_overindented_list_items)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:291:3 [INFO] [stdout] | [INFO] [stdout] 291 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 291 - return false; [INFO] [stdout] 291 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting float literal to `f32` is unnecessary [INFO] [stdout] --> src/ui.rs:323:26 [INFO] [stdout] | [INFO] [stdout] 323 | Vector2 {x: (size * (100.0 as f32 / 100.0) * 2.0 ) * vh, y: (size * 0.25 ) * vh}, [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `100.0_f32` [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: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:308:3 [INFO] [stdout] | [INFO] [stdout] 308 | return apply_simple_bullet_logic_extra(players, characters, game_objects, o_index, true_delta_time, pierceing_shot, 255, 255, false, f32::INFINITY, f32::INFINITY); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 308 - return apply_simple_bullet_logic_extra(players, characters, game_objects, o_index, true_delta_time, pierceing_shot, 255, 255, false, f32::INFINITY, f32::INFINITY); [INFO] [stdout] 308 + apply_simple_bullet_logic_extra(players, characters, game_objects, o_index, true_delta_time, pierceing_shot, 255, 255, false, f32::INFINITY, f32::INFINITY) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:467:3 [INFO] [stdout] | [INFO] [stdout] 467 | return (menu_paused, wants_to_quit) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 467 - return (menu_paused, wants_to_quit) [INFO] [stdout] 467 + (menu_paused, wants_to_quit) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/maths.rs:369:10 [INFO] [stdout] | [INFO] [stdout] 369 | if !ricochet || (ricochet && bullet_data.hitpoints == 0){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 369 - if !ricochet || (ricochet && bullet_data.hitpoints == 0){ [INFO] [stdout] 369 + if !(ricochet && bullet_data.hitpoints != 0){ [INFO] [stdout] | [INFO] [stdout] 369 - if !ricochet || (ricochet && bullet_data.hitpoints == 0){ [INFO] [stdout] 369 + if !ricochet || bullet_data.hitpoints == 0{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (11/7) [INFO] [stdout] --> src/maths.rs:318:1 [INFO] [stdout] | [INFO] [stdout] 318 | / pub fn apply_simple_bullet_logic_extra( [INFO] [stdout] 319 | | mut players: MutexGuard>, [INFO] [stdout] 320 | | characters: HashMap, [INFO] [stdout] 321 | | mut game_objects: Vec, [INFO] [stdout] ... | [INFO] [stdout] 329 | | special_hit_radius: f32, [INFO] [stdout] 330 | | ) -> (MutexGuard>, Vec, bool) { [INFO] [stdout] | |___________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:533:3 [INFO] [stdout] | [INFO] [stdout] 533 | return (players, game_objects, hit); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 533 - return (players, game_objects, hit); [INFO] [stdout] 533 + (players, game_objects, hit) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/maths.rs:340:3 [INFO] [stdout] | [INFO] [stdout] 340 | let hit_radius: f32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `hit_radius` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 340 ~ [INFO] [stdout] 341 | [INFO] [stdout] 342 ~ let hit_radius: f32 = if special_hit_radius == f32::INFINITY { [INFO] [stdout] 343 ~ character_properties.primary_hit_radius [INFO] [stdout] 344 | } else { [INFO] [stdout] 345 ~ special_hit_radius [INFO] [stdout] 346 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/maths.rs:348:3 [INFO] [stdout] | [INFO] [stdout] 348 | let bullet_speed: f32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `bullet_speed` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 348 ~ [INFO] [stdout] 349 ~ let bullet_speed: f32 = if special_speed == f32::INFINITY { character_properties.primary_shot_speed} [INFO] [stdout] 350 ~ else {special_speed}; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/maths.rs:353:3 [INFO] [stdout] | [INFO] [stdout] 353 | let damage: u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `damage` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 353 ~ [INFO] [stdout] 354 ~ let damage: u8 = if special_damage == 255 { character_properties.primary_damage } [INFO] [stdout] 355 ~ else { special_damage }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/maths.rs:357:3 [INFO] [stdout] | [INFO] [stdout] 357 | let healing: u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `healing` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 357 ~ [INFO] [stdout] 358 ~ let healing: u8 = if special_damage == 255 { character_properties.primary_heal } [INFO] [stdout] 359 ~ else { special_healing }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ui.rs:420:44 [INFO] [stdout] | [INFO] [stdout] 420 | audio::set_volume(sfx_self_volume, &mut tracks.0); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `tracks.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ui.rs:421:45 [INFO] [stdout] | [INFO] [stdout] 421 | audio::set_volume(sfx_other_volume, &mut tracks.1); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `tracks.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ui.rs:422:41 [INFO] [stdout] | [INFO] [stdout] 422 | audio::set_volume(music_volume, &mut tracks.2); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `tracks.2` [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 `return` statement [INFO] [stdout] --> src/ui.rs:477:5 [INFO] [stdout] | [INFO] [stdout] 477 | return Vector2 { x: self.position.x + position.x, y: self.position.y + position.y } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 477 - return Vector2 { x: self.position.x + position.x, y: self.position.y + position.y } [INFO] [stdout] 477 + Vector2 { x: self.position.x + position.x, y: self.position.y + position.y } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:541:3 [INFO] [stdout] | [INFO] [stdout] 541 | / return (f64::sin(SystemTime::now() [INFO] [stdout] 542 | | .duration_since(SystemTime::UNIX_EPOCH) [INFO] [stdout] 543 | | .expect("idk clock error").as_nanos() as f64 [INFO] [stdout] 544 | | ) [INFO] [stdout] 545 | | + 1.0)/2.0; [INFO] [stdout] | |____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 541 ~ (f64::sin(SystemTime::now() [INFO] [stdout] 542 + .duration_since(SystemTime::UNIX_EPOCH) [INFO] [stdout] 543 + .expect("idk clock error").as_nanos() as f64 [INFO] [stdout] 544 + ) [INFO] [stdout] 545 ~ + 1.0)/2.0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this item has comments with 4 forward slashes (`////`). These look like doc comments, but they aren't [INFO] [stdout] --> src/const_params.rs:21:1 [INFO] [stdout] | [INFO] [stdout] 21 | / //// this is bs [INFO] [stdout] 22 | | ///// Any client sending packets faster than this will be ignored, as this could be a cheating attempt. [INFO] [stdout] 23 | | //pub const MAX_PACKET_INTERVAL: f64 = 1.0 / 30.0; [INFO] [stdout] 24 | | ///// A client sending packets slower than this will be ignored, as this could be a cheating attempt. [INFO] [stdout] 25 | | //pub const MIN_PACKET_INTERVAL: f64 = 1.0 / 9.0; [INFO] [stdout] 26 | | pub const PACKET_INTERVAL_ERROR_MARGIN: f64 = 0.01; [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#four_forward_slashes [INFO] [stdout] = note: `#[warn(clippy::four_forward_slashes)]` on by default [INFO] [stdout] help: make this a doc comment by removing one `/` [INFO] [stdout] | [INFO] [stdout] 21 - //// this is bs [INFO] [stdout] 22 - ///// Any client sending packets faster than this will be ignored, as this could be a cheating attempt. [INFO] [stdout] 21 + /// this is bs [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:497:5 [INFO] [stdout] | [INFO] [stdout] 497 | return Notification { start_time: Instant::now(), text: String::from(text), duration } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 497 - return Notification { start_time: Instant::now(), text: String::from(text), duration } [INFO] [stdout] 497 + Notification { start_time: Instant::now(), text: String::from(text), duration } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Camera` [INFO] [stdout] --> src/gamedata.rs:23:3 [INFO] [stdout] | [INFO] [stdout] 23 | / pub fn new() -> Camera { [INFO] [stdout] 24 | | return Camera { position: Vector2::new(), zoom: 1.0 }; [INFO] [stdout] 25 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 22 + impl Default for Camera { [INFO] [stdout] 23 + fn default() -> Self { [INFO] [stdout] 24 + Self::new() [INFO] [stdout] 25 + } [INFO] [stdout] 26 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | return Camera { position: Vector2::new(), zoom: 1.0 }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 24 - return Camera { position: Vector2::new(), zoom: 1.0 }; [INFO] [stdout] 24 + Camera { position: Vector2::new(), zoom: 1.0 } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Settings` [INFO] [stdout] --> src/ui.rs:519:3 [INFO] [stdout] | [INFO] [stdout] 519 | / pub fn new() -> Settings{ [INFO] [stdout] 520 | | return Settings { [INFO] [stdout] 521 | | camera_smoothing: true, [INFO] [stdout] 522 | | display_char_name_instead: true, [INFO] [stdout] ... | [INFO] [stdout] 532 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 518 + impl Default for Settings { [INFO] [stdout] 519 + fn default() -> Self { [INFO] [stdout] 520 + Self::new() [INFO] [stdout] 521 + } [INFO] [stdout] 522 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:520:5 [INFO] [stdout] | [INFO] [stdout] 520 | / return Settings { [INFO] [stdout] 521 | | camera_smoothing: true, [INFO] [stdout] 522 | | display_char_name_instead: true, [INFO] [stdout] 523 | | fullscreen: false, [INFO] [stdout] ... | [INFO] [stdout] 530 | | keybinds: KeybindSettings::new(), [INFO] [stdout] 531 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 520 ~ Settings { [INFO] [stdout] 521 + camera_smoothing: true, [INFO] [stdout] 522 + display_char_name_instead: true, [INFO] [stdout] 523 + fullscreen: false, [INFO] [stdout] 524 + saved_username: String::new(), [INFO] [stdout] 525 + store_credentials: false, [INFO] [stdout] 526 + master_volume: 80.0, [INFO] [stdout] 527 + music_volume: 100.0, [INFO] [stdout] 528 + sfx_self_volume: 100.0, [INFO] [stdout] 529 + sfx_other_volume: 50.0, [INFO] [stdout] 530 + keybinds: KeybindSettings::new(), [INFO] [stdout] 531 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:548:17 [INFO] [stdout] | [INFO] [stdout] 548 | return settings [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 548 - return settings [INFO] [stdout] 548 + settings [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:553:17 [INFO] [stdout] | [INFO] [stdout] 553 | return Settings::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 553 - return Settings::new(); [INFO] [stdout] 553 + Settings::new() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:566:13 [INFO] [stdout] | [INFO] [stdout] 566 | return Settings::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 566 - return Settings::new(); [INFO] [stdout] 566 + Settings::new() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:572:9 [INFO] [stdout] | [INFO] [stdout] 572 | return Settings::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 572 - return Settings::new(); [INFO] [stdout] 572 + Settings::new() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: file opened with `create`, but `truncate` behavior not defined [INFO] [stdout] --> src/ui.rs:538:8 [INFO] [stdout] | [INFO] [stdout] 538 | .create(true) [INFO] [stdout] | ^^^^^^^^^^^^- help: add: `.truncate(true)` [INFO] [stdout] | [INFO] [stdout] = help: if you intend to overwrite an existing file entirely, call `.truncate(true)` [INFO] [stdout] = help: if you instead know that you may want to keep some parts of the old file, call `.truncate(false)` [INFO] [stdout] = help: alternatively, use `.append(true)` to append to the file instead of overwriting it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options [INFO] [stdout] = note: `#[warn(clippy::suspicious_open_options)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/ui.rs:579:5 [INFO] [stdout] | [INFO] [stdout] 579 | / match settings_file { [INFO] [stdout] 580 | | Ok(mut file) => { [INFO] [stdout] 581 | | file.write_all(&bincode::serialize::(&self).expect("Serialization failure.")).expect("oops"); [INFO] [stdout] ... | [INFO] [stdout] 584 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 579 ~ if let Ok(mut file) = settings_file { [INFO] [stdout] 580 + file.write_all(&bincode::serialize::(&self).expect("Serialization failure.")).expect("oops"); [INFO] [stdout] 581 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ui.rs:581:56 [INFO] [stdout] | [INFO] [stdout] 581 | file.write_all(&bincode::serialize::(&self).expect("Serialization failure.")).expect("oops"); [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: you should consider adding a `Default` implementation for `ClientPlayer` [INFO] [stdout] --> src/gamedata.rs:195:3 [INFO] [stdout] | [INFO] [stdout] 195 | / pub fn new() -> ClientPlayer { [INFO] [stdout] 196 | | return ClientPlayer { [INFO] [stdout] 197 | | username: String::from("New User"), [INFO] [stdout] 198 | | health: 100, [INFO] [stdout] ... | [INFO] [stdout] 226 | | }; [INFO] [stdout] 227 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 88 + impl Default for ClientPlayer { [INFO] [stdout] 89 + fn default() -> Self { [INFO] [stdout] 90 + Self::new() [INFO] [stdout] 91 + } [INFO] [stdout] 92 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:90:5 [INFO] [stdout] | [INFO] [stdout] 90 | / return ClientPlayer { [INFO] [stdout] 91 | | username: other_player.username, [INFO] [stdout] 92 | | health: other_player.health, [INFO] [stdout] 93 | | position: other_player.position, [INFO] [stdout] ... | [INFO] [stdout] 119 | | passive_elapsed: 0.0, [INFO] [stdout] 120 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 90 ~ ClientPlayer { [INFO] [stdout] 91 + username: other_player.username, [INFO] [stdout] 92 + health: other_player.health, [INFO] [stdout] 93 + position: other_player.position, [INFO] [stdout] 94 + aim_direction: other_player.aim_direction, [INFO] [stdout] 95 + character: other_player.character, [INFO] [stdout] 96 + secondary_charge: other_player.secondary_charge, [INFO] [stdout] 97 + movement_direction: other_player.movement_direction, [INFO] [stdout] 98 + shooting_primary: other_player.shooting_primary, [INFO] [stdout] 99 + shooting_secondary: other_player.shooting_secondary, [INFO] [stdout] 100 + team: other_player.team, [INFO] [stdout] 101 + time_since_last_dash: other_player.time_since_last_dash, [INFO] [stdout] 102 + is_dead: other_player.is_dead, [INFO] [stdout] 103 + camera: other_player.camera, [INFO] [stdout] 104 + buffs: other_player.buffs, [INFO] [stdout] 105 + previous_positions: other_player.previous_positions, [INFO] [stdout] 106 + ping: 0, [INFO] [stdout] 107 + last_shot_time: 0.0, [INFO] [stdout] 108 + last_secondary_time: 0.0, [INFO] [stdout] 109 + dashing: false, [INFO] [stdout] 110 + is_dashing: false, [INFO] [stdout] 111 + dashed_distance: 0.0, [INFO] [stdout] 112 + stacks: other_player.stacks, [INFO] [stdout] 113 + interpolating: false, [INFO] [stdout] 114 + interpol_next: Vector2::new(), [INFO] [stdout] 115 + interpol_prev: Vector2::new(), [INFO] [stdout] 116 + used_primary: false, [INFO] [stdout] 117 + used_secondary: false, [INFO] [stdout] 118 + used_dash: false, [INFO] [stdout] 119 + passive_elapsed: 0.0, [INFO] [stdout] 120 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `KeybindSettings` [INFO] [stdout] --> src/ui.rs:605:3 [INFO] [stdout] | [INFO] [stdout] 605 | / pub fn new() -> KeybindSettings { [INFO] [stdout] 606 | | return KeybindSettings { [INFO] [stdout] 607 | | walk_up: (device_query::Keycode::W as u16, u16::MAX, 255, 255), [INFO] [stdout] 608 | | walk_down: (device_query::Keycode::S as u16, u16::MAX, 255, 255), [INFO] [stdout] ... | [INFO] [stdout] 617 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 604 + impl Default for KeybindSettings { [INFO] [stdout] 605 + fn default() -> Self { [INFO] [stdout] 606 + Self::new() [INFO] [stdout] 607 + } [INFO] [stdout] 608 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:606:5 [INFO] [stdout] | [INFO] [stdout] 606 | / return KeybindSettings { [INFO] [stdout] 607 | | walk_up: (device_query::Keycode::W as u16, u16::MAX, 255, 255), [INFO] [stdout] 608 | | walk_down: (device_query::Keycode::S as u16, u16::MAX, 255, 255), [INFO] [stdout] 609 | | walk_left: (device_query::Keycode::A as u16, u16::MAX, 255, 255), [INFO] [stdout] ... | [INFO] [stdout] 615 | | fullscreen: (device_query::Keycode::F11 as u16, u16::MAX, 255, 255), [INFO] [stdout] 616 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 606 ~ KeybindSettings { [INFO] [stdout] 607 + walk_up: (device_query::Keycode::W as u16, u16::MAX, 255, 255), [INFO] [stdout] 608 + walk_down: (device_query::Keycode::S as u16, u16::MAX, 255, 255), [INFO] [stdout] 609 + walk_left: (device_query::Keycode::A as u16, u16::MAX, 255, 255), [INFO] [stdout] 610 + walk_right: (device_query::Keycode::D as u16, u16::MAX, 255, 255), [INFO] [stdout] 611 + primary: (u16::MAX, u16::MAX, 1, 255), [INFO] [stdout] 612 + secondary: (u16::MAX, u16::MAX, rmb_index() as u8, 255), [INFO] [stdout] 613 + dash: (device_query::Keycode::Space as u16, u16::MAX, 255, 255), [INFO] [stdout] 614 + open_chat: (device_query::Keycode::Enter as u16, u16::MAX, 255, 255), [INFO] [stdout] 615 + fullscreen: (device_query::Keycode::F11 as u16, u16::MAX, 255, 255), [INFO] [stdout] 616 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gamedata.rs:134:25 [INFO] [stdout] | [INFO] [stdout] 134 | draw_image_relative(&texture, self.position.x -(size/2.0), self.position.y - ((size/2.0)* (8.0/5.0)), size, size * (8.0/5.0), v... [INFO] [stdout] | ^^^^^^^^ help: change this to: `texture` [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 `return` statement [INFO] [stdout] --> src/ui.rs:739:3 [INFO] [stdout] | [INFO] [stdout] 739 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 739 - return false; [INFO] [stdout] 739 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gamedata.rs:172:154 [INFO] [stdout] | [INFO] [stdout] 172 | ....x, self.position.y + health_counter_offset.y, &font, font_size, vh, camera.clone(), GREEN); [INFO] [stdout] | ^^^^^ help: change this to: `font` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gamedata.rs:175:163 [INFO] [stdout] | [INFO] [stdout] 175 | ... self.position.y + secondary_counter_offset.y, &font, font_size, vh, camera.clone(), ORANGE); [INFO] [stdout] | ^^^^^ help: change this to: `font` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gamedata.rs:190:339 [INFO] [stdout] | [INFO] [stdout] 190 | ...uff_offset.x, self.position.y + buff_offset.y, &font, font_size, vh, camera.clone(), SKYBLUE); [INFO] [stdout] | ^^^^^ help: change this to: `font` [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 `return` statement [INFO] [stdout] --> src/gamedata.rs:196:5 [INFO] [stdout] | [INFO] [stdout] 196 | / return ClientPlayer { [INFO] [stdout] 197 | | username: String::from("New User"), [INFO] [stdout] 198 | | health: 100, [INFO] [stdout] 199 | | position: Vector2::new(), [INFO] [stdout] ... | [INFO] [stdout] 225 | | passive_elapsed: 0.0, [INFO] [stdout] 226 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 196 ~ ClientPlayer { [INFO] [stdout] 197 + username: String::from("New User"), [INFO] [stdout] 198 + health: 100, [INFO] [stdout] 199 + position: Vector2::new(), [INFO] [stdout] 200 + aim_direction: Vector2::new(), [INFO] [stdout] 201 + character: Character::Hernani, [INFO] [stdout] 202 + secondary_charge: 100, [INFO] [stdout] 203 + movement_direction: Vector2::new(), [INFO] [stdout] 204 + shooting_primary: false, [INFO] [stdout] 205 + shooting_secondary: false, [INFO] [stdout] 206 + team: Team::Blue, [INFO] [stdout] 207 + time_since_last_dash: 0.0, [INFO] [stdout] 208 + is_dead: false, [INFO] [stdout] 209 + camera: Camera::new(), [INFO] [stdout] 210 + buffs: Vec::new(), [INFO] [stdout] 211 + previous_positions: Vec::new(), [INFO] [stdout] 212 + ping: 0, [INFO] [stdout] 213 + last_shot_time: 0.0, [INFO] [stdout] 214 + last_secondary_time: 0.0, [INFO] [stdout] 215 + dashing: false, [INFO] [stdout] 216 + is_dashing: false, [INFO] [stdout] 217 + dashed_distance: 0.0, [INFO] [stdout] 218 + stacks: 0, [INFO] [stdout] 219 + interpolating: false, [INFO] [stdout] 220 + interpol_next: Vector2::new(), [INFO] [stdout] 221 + interpol_prev: Vector2::new(), [INFO] [stdout] 222 + used_dash: true, [INFO] [stdout] 223 + used_primary: true, [INFO] [stdout] 224 + used_secondary: true, [INFO] [stdout] 225 + passive_elapsed: 0.0, [INFO] [stdout] 226 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:742:3 [INFO] [stdout] | [INFO] [stdout] 742 | / return match keycode { [INFO] [stdout] 743 | | 0 => "Key0".to_string(), [INFO] [stdout] 744 | | 1 => "Key1".to_string(), [INFO] [stdout] 745 | | 2 => "Key2".to_string(), [INFO] [stdout] ... | [INFO] [stdout] 854 | | _ => "???".to_string(), [INFO] [stdout] 855 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 742 ~ match keycode { [INFO] [stdout] 743 + 0 => "Key0".to_string(), [INFO] [stdout] 744 + 1 => "Key1".to_string(), [INFO] [stdout] 745 + 2 => "Key2".to_string(), [INFO] [stdout] 746 + 3 => "Key3".to_string(), [INFO] [stdout] 747 + 4 => "Key4".to_string(), [INFO] [stdout] 748 + 5 => "Key5".to_string(), [INFO] [stdout] 749 + 6 => "Key6".to_string(), [INFO] [stdout] 750 + 7 => "Key7".to_string(), [INFO] [stdout] 751 + 8 => "Key8".to_string(), [INFO] [stdout] 752 + 9 => "Key9".to_string(), [INFO] [stdout] 753 + 10 => "A".to_string(), [INFO] [stdout] 754 + 11 => "B".to_string(), [INFO] [stdout] 755 + 12 => "C".to_string(), [INFO] [stdout] 756 + 13 => "D".to_string(), [INFO] [stdout] 757 + 14 => "E".to_string(), [INFO] [stdout] 758 + 15 => "F".to_string(), [INFO] [stdout] 759 + 16 => "G".to_string(), [INFO] [stdout] 760 + 17 => "H".to_string(), [INFO] [stdout] 761 + 18 => "I".to_string(), [INFO] [stdout] 762 + 19 => "J".to_string(), [INFO] [stdout] 763 + 20 => "K".to_string(), [INFO] [stdout] 764 + 21 => "L".to_string(), [INFO] [stdout] 765 + 22 => "M".to_string(), [INFO] [stdout] 766 + 23 => "N".to_string(), [INFO] [stdout] 767 + 24 => "O".to_string(), [INFO] [stdout] 768 + 25 => "P".to_string(), [INFO] [stdout] 769 + 26 => "Q".to_string(), [INFO] [stdout] 770 + 27 => "R".to_string(), [INFO] [stdout] 771 + 28 => "S".to_string(), [INFO] [stdout] 772 + 29 => "T".to_string(), [INFO] [stdout] 773 + 30 => "U".to_string(), [INFO] [stdout] 774 + 31 => "V".to_string(), [INFO] [stdout] 775 + 32 => "W".to_string(), [INFO] [stdout] 776 + 33 => "X".to_string(), [INFO] [stdout] 777 + 34 => "Y".to_string(), [INFO] [stdout] 778 + 35 => "Z".to_string(), [INFO] [stdout] 779 + 36 => "F1".to_string(), [INFO] [stdout] 780 + 37 => "F2".to_string(), [INFO] [stdout] 781 + 38 => "F3".to_string(), [INFO] [stdout] 782 + 39 => "F4".to_string(), [INFO] [stdout] 783 + 40 => "F5".to_string(), [INFO] [stdout] 784 + 41 => "F6".to_string(), [INFO] [stdout] 785 + 42 => "F7".to_string(), [INFO] [stdout] 786 + 43 => "F8".to_string(), [INFO] [stdout] 787 + 44 => "F9".to_string(), [INFO] [stdout] 788 + 45 => "F10".to_string(), [INFO] [stdout] 789 + 46 => "F11".to_string(), [INFO] [stdout] 790 + 47 => "F12".to_string(), [INFO] [stdout] 791 + 48 => "F13".to_string(), [INFO] [stdout] 792 + 49 => "F14".to_string(), [INFO] [stdout] 793 + 50 => "F15".to_string(), [INFO] [stdout] 794 + 51 => "F16".to_string(), [INFO] [stdout] 795 + 52 => "F17".to_string(), [INFO] [stdout] 796 + 53 => "F18".to_string(), [INFO] [stdout] 797 + 54 => "F19".to_string(), [INFO] [stdout] 798 + 55 => "F20".to_string(), [INFO] [stdout] 799 + 56 => "Escape".to_string(), [INFO] [stdout] 800 + 57 => "Space".to_string(), [INFO] [stdout] 801 + 58 => "LControl".to_string(), [INFO] [stdout] 802 + 59 => "RControl".to_string(), [INFO] [stdout] 803 + 60 => "LShift".to_string(), [INFO] [stdout] 804 + 61 => "RShift".to_string(), [INFO] [stdout] 805 + 62 => "LAlt".to_string(), [INFO] [stdout] 806 + 63 => "RAlt".to_string(), [INFO] [stdout] 807 + 64 => "Command".to_string(), [INFO] [stdout] 808 + 65 => "LOption".to_string(), [INFO] [stdout] 809 + 66 => "ROption".to_string(), [INFO] [stdout] 810 + 67 => "LMeta".to_string(), [INFO] [stdout] 811 + 68 => "RMeta".to_string(), [INFO] [stdout] 812 + 69 => "Enter".to_string(), [INFO] [stdout] 813 + 70 => "Up".to_string(), [INFO] [stdout] 814 + 71 => "Down".to_string(), [INFO] [stdout] 815 + 72 => "Left".to_string(), [INFO] [stdout] 816 + 73 => "Right".to_string(), [INFO] [stdout] 817 + 74 => "Backspace".to_string(), [INFO] [stdout] 818 + 75 => "CapsLock".to_string(), [INFO] [stdout] 819 + 76 => "Tab".to_string(), [INFO] [stdout] 820 + 77 => "Home".to_string(), [INFO] [stdout] 821 + 78 => "End".to_string(), [INFO] [stdout] 822 + 79 => "PageUp".to_string(), [INFO] [stdout] 823 + 80 => "PageDown".to_string(), [INFO] [stdout] 824 + 81 => "Insert".to_string(), [INFO] [stdout] 825 + 82 => "Delete".to_string(), [INFO] [stdout] 826 + 83 => "Numpad0".to_string(), [INFO] [stdout] 827 + 84 => "Numpad1".to_string(), [INFO] [stdout] 828 + 85 => "Numpad2".to_string(), [INFO] [stdout] 829 + 86 => "Numpad3".to_string(), [INFO] [stdout] 830 + 87 => "Numpad4".to_string(), [INFO] [stdout] 831 + 88 => "Numpad5".to_string(), [INFO] [stdout] 832 + 89 => "Numpad6".to_string(), [INFO] [stdout] 833 + 90 => "Numpad7".to_string(), [INFO] [stdout] 834 + 91 => "Numpad8".to_string(), [INFO] [stdout] 835 + 92 => "Numpad9".to_string(), [INFO] [stdout] 836 + 93 => "NumpadSubtract".to_string(), [INFO] [stdout] 837 + 94 => "NumpadAdd".to_string(), [INFO] [stdout] 838 + 95 => "NumpadDivide".to_string(), [INFO] [stdout] 839 + 96 => "NumpadMultiply".to_string(), [INFO] [stdout] 840 + 97 => "NumpadEquals".to_string(), [INFO] [stdout] 841 + 98 => "NumpadEnter".to_string(), [INFO] [stdout] 842 + 99 => "NumpadDecimal".to_string(), [INFO] [stdout] 843 + 100 => "Grave".to_string(), [INFO] [stdout] 844 + 101 => "Minus".to_string(), [INFO] [stdout] 845 + 102 => "Equal".to_string(), [INFO] [stdout] 846 + 103 => "LeftBracket".to_string(), [INFO] [stdout] 847 + 104 => "RightBracket".to_string(), [INFO] [stdout] 848 + 105 => "BackSlash".to_string(), [INFO] [stdout] 849 + 106 => "Semicolon".to_string(), [INFO] [stdout] 850 + 107 => "Apostrophe".to_string(), [INFO] [stdout] 851 + 108 => "Comma".to_string(), [INFO] [stdout] 852 + 109 => "Dot".to_string(), [INFO] [stdout] 853 + 110 => "Slash".to_string(), [INFO] [stdout] 854 + _ => "???".to_string(), [INFO] [stdout] 855 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (14/7) [INFO] [stdout] --> src/ui.rs:860:1 [INFO] [stdout] | [INFO] [stdout] 860 | / pub fn chatbox( [INFO] [stdout] 861 | | position: Vector2, [INFO] [stdout] 862 | | size: Vector2, [INFO] [stdout] 863 | | friends: Vec<(String, FriendShipStatus, bool)>, [INFO] [stdout] ... | [INFO] [stdout] 874 | | timer: &mut Instant, [INFO] [stdout] 875 | | ) { [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/ui.rs:891:8 [INFO] [stdout] | [INFO] [stdout] 891 | && friend.2 == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `friend.2` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:908:3 [INFO] [stdout] | [INFO] [stdout] 908 | / if !*is_chatbox_open { [INFO] [stdout] 909 | | if get_keys_pressed().contains(&KeyCode::Enter) { [INFO] [stdout] 910 | | clear_input_queue(); [INFO] [stdout] 911 | | *is_chatbox_open = true; [INFO] [stdout] ... | [INFO] [stdout] 915 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 908 ~ if !*is_chatbox_open [INFO] [stdout] 909 ~ && get_keys_pressed().contains(&KeyCode::Enter) { [INFO] [stdout] 910 | clear_input_queue(); [INFO] [stdout] ... [INFO] [stdout] 913 | return [INFO] [stdout] 914 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui.rs:917:3 [INFO] [stdout] | [INFO] [stdout] 917 | / if *is_chatbox_open { [INFO] [stdout] 918 | | if get_keys_pressed().contains(&KeyCode::Enter) [INFO] [stdout] 919 | | && (chat_input_buffer.is_empty() || !*chat_input_field_selected) { [INFO] [stdout] 920 | | *is_chatbox_open = false; [INFO] [stdout] ... | [INFO] [stdout] 924 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 917 ~ if *is_chatbox_open [INFO] [stdout] 918 ~ && get_keys_pressed().contains(&KeyCode::Enter) [INFO] [stdout] 919 | && (chat_input_buffer.is_empty() || !*chat_input_field_selected) { [INFO] [stdout] ... [INFO] [stdout] 922 | return [INFO] [stdout] 923 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ui.rs:938:44 [INFO] [stdout] | [INFO] [stdout] 938 | let mut displayed_selected_friend = if online_friends.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!online_friends.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: unneeded late initialization [INFO] [stdout] --> src/ui.rs:939:7 [INFO] [stdout] | [INFO] [stdout] 939 | let peer_username; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `peer_username` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 939 ~ [INFO] [stdout] 940 | let split: Vec<&str> = (*online_friends[*selected_friend]).split(":").collect(); [INFO] [stdout] 941 ~ let peer_username = if *split[0] == username { [INFO] [stdout] 942 ~ split[1] [INFO] [stdout] 943 | } else { [INFO] [stdout] 944 ~ split[0] [INFO] [stdout] 945 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/ui.rs:978:7 [INFO] [stdout] | [INFO] [stdout] 978 | let peer_username; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `peer_username` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 978 ~ [INFO] [stdout] 979 | let split: Vec<&str> = (*online_friends[*selected_friend]).split(":").collect(); [INFO] [stdout] 980 ~ let peer_username = if *split[0] == username { [INFO] [stdout] 981 ~ split[1] [INFO] [stdout] 982 | } else { [INFO] [stdout] 983 ~ split[0] [INFO] [stdout] 984 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/ui.rs:1029:8 [INFO] [stdout] | [INFO] [stdout] 1029 | if formatted_messages.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!formatted_messages.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: the loop variable `m_index` is used to index `formatted_messages` [INFO] [stdout] --> src/ui.rs:1030:22 [INFO] [stdout] | [INFO] [stdout] 1030 | for m_index in *scroll_index..(*formatted_messages).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] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 1030 - for m_index in *scroll_index..(*formatted_messages).len() { [INFO] [stdout] 1030 + for (m_index, ) in formatted_messages.iter().enumerate().take((*formatted_messages).len()).skip(*scroll_index) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/ui.rs:1060:1 [INFO] [stdout] | [INFO] [stdout] 1060 | pub fn text_input(position: Vector2, size: Vector2, buffer: &mut String, active: &mut bool, font_size: f32, vh: f32, hideable: bool, show_password: &mut bool) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:1190:7 [INFO] [stdout] | [INFO] [stdout] 1190 | return password; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1190 - return password; [INFO] [stdout] 1190 + password [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/ui.rs:1194:7 [INFO] [stdout] | [INFO] [stdout] 1194 | return String::new(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1194 - return String::new(); [INFO] [stdout] 1194 + String::new() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Vector2` [INFO] [stdout] --> src/maths.rs:32:3 [INFO] [stdout] | [INFO] [stdout] 32 | / pub fn new() -> Vector2 { [INFO] [stdout] 33 | | return Vector2 {x: 0.0, y: 0.0}; [INFO] [stdout] 34 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 15 + impl Default for Vector2 { [INFO] [stdout] 16 + fn default() -> Self { [INFO] [stdout] 17 + Self::new() [INFO] [stdout] 18 + } [INFO] [stdout] 19 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | / return Vector2 { [INFO] [stdout] 22 | | x: self.x / magnitude, [INFO] [stdout] 23 | | y: self.y / magnitude, [INFO] [stdout] 24 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 21 ~ Vector2 { [INFO] [stdout] 22 + x: self.x / magnitude, [INFO] [stdout] 23 + y: self.y / magnitude, [INFO] [stdout] 24 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | return Vector2::distance(Vector2 { x: 0.0, y: 0.0 }, *self); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 27 - return Vector2::distance(Vector2 { x: 0.0, y: 0.0 }, *self); [INFO] [stdout] 27 + Vector2::distance(Vector2 { x: 0.0, y: 0.0 }, *self) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | return Vec2 { x: self.x, y: self.y }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - return Vec2 { x: self.x, y: self.y }; [INFO] [stdout] 30 + Vec2 { x: self.x, y: self.y } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:33:5 [INFO] [stdout] | [INFO] [stdout] 33 | return Vector2 {x: 0.0, y: 0.0}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 33 - return Vector2 {x: 0.0, y: 0.0}; [INFO] [stdout] 33 + Vector2 {x: 0.0, y: 0.0} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:36:5 [INFO] [stdout] | [INFO] [stdout] 36 | return f32::sqrt(f32::powi(vec1.x - vec2.x, 2) + f32::powi(vec1.y - vec2.y, 2)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 36 - return f32::sqrt(f32::powi(vec1.x - vec2.x, 2) + f32::powi(vec1.y - vec2.y, 2)) [INFO] [stdout] 36 + f32::sqrt(f32::powi(vec1.x - vec2.x, 2) + f32::powi(vec1.y - vec2.y, 2)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 41 | / return Vector2 { [INFO] [stdout] 42 | | x: vec2.x - vec1.x, [INFO] [stdout] 43 | | y: vec2.y - vec1.y, [INFO] [stdout] 44 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 41 ~ Vector2 { [INFO] [stdout] 42 + x: vec2.x - vec1.x, [INFO] [stdout] 43 + y: vec2.y - vec1.y, [INFO] [stdout] 44 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:47:5 [INFO] [stdout] | [INFO] [stdout] 47 | return Vector2 { x: vec2.x, y: vec2.y }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 47 - return Vector2 { x: vec2.x, y: vec2.y }; [INFO] [stdout] 47 + Vector2 { x: vec2.x, y: vec2.y } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/maths.rs:68:43 [INFO] [stdout] | [INFO] [stdout] 68 | fn add_assign(&mut self, other: Vector2) -> () { [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] --> src/maths.rs:77:43 [INFO] [stdout] | [INFO] [stdout] 77 | fn sub_assign(&mut self, other: Vector2) -> () { [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 `return` statement [INFO] [stdout] --> src/maths.rs:132:5 [INFO] [stdout] | [INFO] [stdout] 132 | return sign; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 132 - return sign; [INFO] [stdout] 132 + sign [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:148:7 [INFO] [stdout] | [INFO] [stdout] 148 | return current; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 148 - return current; [INFO] [stdout] 148 + current [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u16` which implements the `Copy` trait [INFO] [stdout] --> src/maths.rs:146:21 [INFO] [stdout] | [INFO] [stdout] 146 | let current = self.clone(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `*self` [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: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:203:3 [INFO] [stdout] | [INFO] [stdout] 203 | return (adjusted_raw_movement, adjusted_movement); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 203 - return (adjusted_raw_movement, adjusted_movement); [INFO] [stdout] 203 + (adjusted_raw_movement, adjusted_movement) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/maths.rs:206:1 [INFO] [stdout] | [INFO] [stdout] 206 | pub fn dashing_logic(mut is_dashing: bool, mut dashed_distance: f32, dash_direction: Vector2, delta_time: f64, char_dash_speed: f32, char_dash_distance: f32, game_objects: Vec, current_position: Vector2) -> (Vector2, f32, bool) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:241:3 [INFO] [stdout] | [INFO] [stdout] 241 | return (new_position, dashed_distance, is_dashing); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 241 - return (new_position, dashed_distance, is_dashing); [INFO] [stdout] 241 + (new_position, dashed_distance, is_dashing) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item overindented [INFO] [stdout] --> src/maths.rs:260:4 [INFO] [stdout] | [INFO] [stdout] 260 | /// = \frac{|bd - ac|}{\sqrt{b^2 + a^2}}$ [INFO] [stdout] | ^^^^^^^^^^ help: try using ` ` (4 spaces) [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items [INFO] [stdout] = note: `#[warn(clippy::doc_overindented_list_items)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:291:3 [INFO] [stdout] | [INFO] [stdout] 291 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 291 - return false; [INFO] [stdout] 291 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:308:3 [INFO] [stdout] | [INFO] [stdout] 308 | return apply_simple_bullet_logic_extra(players, characters, game_objects, o_index, true_delta_time, pierceing_shot, 255, 255, false, f32::INFINITY, f32::INFINITY); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 308 - return apply_simple_bullet_logic_extra(players, characters, game_objects, o_index, true_delta_time, pierceing_shot, 255, 255, false, f32::INFINITY, f32::INFINITY); [INFO] [stdout] 308 + apply_simple_bullet_logic_extra(players, characters, game_objects, o_index, true_delta_time, pierceing_shot, 255, 255, false, f32::INFINITY, f32::INFINITY) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/maths.rs:369:10 [INFO] [stdout] | [INFO] [stdout] 369 | if !ricochet || (ricochet && bullet_data.hitpoints == 0){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 369 - if !ricochet || (ricochet && bullet_data.hitpoints == 0){ [INFO] [stdout] 369 + if !(ricochet && bullet_data.hitpoints != 0){ [INFO] [stdout] | [INFO] [stdout] 369 - if !ricochet || (ricochet && bullet_data.hitpoints == 0){ [INFO] [stdout] 369 + if !ricochet || bullet_data.hitpoints == 0{ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (11/7) [INFO] [stdout] --> src/maths.rs:318:1 [INFO] [stdout] | [INFO] [stdout] 318 | / pub fn apply_simple_bullet_logic_extra( [INFO] [stdout] 319 | | mut players: MutexGuard>, [INFO] [stdout] 320 | | characters: HashMap, [INFO] [stdout] 321 | | mut game_objects: Vec, [INFO] [stdout] ... | [INFO] [stdout] 329 | | special_hit_radius: f32, [INFO] [stdout] 330 | | ) -> (MutexGuard>, Vec, bool) { [INFO] [stdout] | |___________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:533:3 [INFO] [stdout] | [INFO] [stdout] 533 | return (players, game_objects, hit); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 533 - return (players, game_objects, hit); [INFO] [stdout] 533 + (players, game_objects, hit) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/maths.rs:340:3 [INFO] [stdout] | [INFO] [stdout] 340 | let hit_radius: f32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `hit_radius` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 340 ~ [INFO] [stdout] 341 | [INFO] [stdout] 342 ~ let hit_radius: f32 = if special_hit_radius == f32::INFINITY { [INFO] [stdout] 343 ~ character_properties.primary_hit_radius [INFO] [stdout] 344 | } else { [INFO] [stdout] 345 ~ special_hit_radius [INFO] [stdout] 346 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/maths.rs:348:3 [INFO] [stdout] | [INFO] [stdout] 348 | let bullet_speed: f32; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `bullet_speed` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 348 ~ [INFO] [stdout] 349 ~ let bullet_speed: f32 = if special_speed == f32::INFINITY { character_properties.primary_shot_speed} [INFO] [stdout] 350 ~ else {special_speed}; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/maths.rs:353:3 [INFO] [stdout] | [INFO] [stdout] 353 | let damage: u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `damage` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 353 ~ [INFO] [stdout] 354 ~ let damage: u8 = if special_damage == 255 { character_properties.primary_damage } [INFO] [stdout] 355 ~ else { special_damage }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/maths.rs:357:3 [INFO] [stdout] | [INFO] [stdout] 357 | let healing: u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `healing` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 357 ~ [INFO] [stdout] 358 ~ let healing: u8 = if special_damage == 255 { character_properties.primary_heal } [INFO] [stdout] 359 ~ else { special_healing }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:307:3 [INFO] [stdout] | [INFO] [stdout] 307 | return port; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 307 - return port; [INFO] [stdout] 307 + port [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/maths.rs:541:3 [INFO] [stdout] | [INFO] [stdout] 541 | / return (f64::sin(SystemTime::now() [INFO] [stdout] 542 | | .duration_since(SystemTime::UNIX_EPOCH) [INFO] [stdout] 543 | | .expect("idk clock error").as_nanos() as f64 [INFO] [stdout] 544 | | ) [INFO] [stdout] 545 | | + 1.0)/2.0; [INFO] [stdout] | |____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 541 ~ (f64::sin(SystemTime::now() [INFO] [stdout] 542 + .duration_since(SystemTime::UNIX_EPOCH) [INFO] [stdout] 543 + .expect("idk clock error").as_nanos() as f64 [INFO] [stdout] 544 + ) [INFO] [stdout] 545 ~ + 1.0)/2.0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this item has comments with 4 forward slashes (`////`). These look like doc comments, but they aren't [INFO] [stdout] --> src/const_params.rs:21:1 [INFO] [stdout] | [INFO] [stdout] 21 | / //// this is bs [INFO] [stdout] 22 | | ///// Any client sending packets faster than this will be ignored, as this could be a cheating attempt. [INFO] [stdout] 23 | | //pub const MAX_PACKET_INTERVAL: f64 = 1.0 / 30.0; [INFO] [stdout] 24 | | ///// A client sending packets slower than this will be ignored, as this could be a cheating attempt. [INFO] [stdout] 25 | | //pub const MIN_PACKET_INTERVAL: f64 = 1.0 / 9.0; [INFO] [stdout] 26 | | pub const PACKET_INTERVAL_ERROR_MARGIN: f64 = 0.01; [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#four_forward_slashes [INFO] [stdout] = note: `#[warn(clippy::four_forward_slashes)]` on by default [INFO] [stdout] help: make this a doc comment by removing one `/` [INFO] [stdout] | [INFO] [stdout] 21 - //// this is bs [INFO] [stdout] 22 - ///// Any client sending packets faster than this will be ignored, as this could be a cheating attempt. [INFO] [stdout] 21 + /// this is bs [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/gamedata.rs:354:93 [INFO] [stdout] | [INFO] [stdout] 354 | pub fn damage(&mut self, mut dmg: u8, characters: HashMap) -> () { [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: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/gamedata.rs:359:5 [INFO] [stdout] | [INFO] [stdout] 359 | / match self.character { [INFO] [stdout] 360 | | Character::Raphaelle => { [INFO] [stdout] 361 | | self.buffs.push( [INFO] [stdout] 362 | | Buff { value: 6.0, duration: 0.5, buff_type: BuffType::Speed, direction: Vector2::new() } [INFO] [stdout] ... | [INFO] [stdout] 365 | | _ => {} [INFO] [stdout] 366 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 359 ~ if self.character == Character::Raphaelle { [INFO] [stdout] 360 + self.buffs.push( [INFO] [stdout] 361 + Buff { value: 6.0, duration: 0.5, buff_type: BuffType::Speed, direction: Vector2::new() } [INFO] [stdout] 362 + ); [INFO] [stdout] 363 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/gamedata.rs:379:88 [INFO] [stdout] | [INFO] [stdout] 379 | pub fn heal(&mut self, heal: u8, characters: HashMap) -> () { [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] --> src/gamedata.rs:391:43 [INFO] [stdout] | [INFO] [stdout] 391 | pub fn add_charge(&mut self, charge: u8) -> () { [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 `return` statement [INFO] [stdout] --> src/gamedata.rs:432:3 [INFO] [stdout] | [INFO] [stdout] 432 | return 0; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 432 - return 0; [INFO] [stdout] 432 + 0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `p_index` is used to index `players` [INFO] [stdout] --> src/gamedata.rs:426:18 [INFO] [stdout] | [INFO] [stdout] 426 | for p_index in 0..players.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] 426 - for p_index in 0..players.len() { [INFO] [stdout] 426 + for (p_index, ) in players.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Camera` [INFO] [stdout] --> src/gamedata.rs:23:3 [INFO] [stdout] | [INFO] [stdout] 23 | / pub fn new() -> Camera { [INFO] [stdout] 24 | | return Camera { position: Vector2::new(), zoom: 1.0 }; [INFO] [stdout] 25 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 22 + impl Default for Camera { [INFO] [stdout] 23 + fn default() -> Self { [INFO] [stdout] 24 + Self::new() [INFO] [stdout] 25 + } [INFO] [stdout] 26 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | return Camera { position: Vector2::new(), zoom: 1.0 }; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 24 - return Camera { position: Vector2::new(), zoom: 1.0 }; [INFO] [stdout] 24 + Camera { position: Vector2::new(), zoom: 1.0 } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `GameModeInfo` [INFO] [stdout] --> src/gamedata.rs:469:3 [INFO] [stdout] | [INFO] [stdout] 469 | / pub fn new() -> GameModeInfo { [INFO] [stdout] 470 | | return GameModeInfo { [INFO] [stdout] 471 | | time: 0, [INFO] [stdout] 472 | | rounds_won_blue: 0, [INFO] [stdout] ... | [INFO] [stdout] 480 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 468 + impl Default for GameModeInfo { [INFO] [stdout] 469 + fn default() -> Self { [INFO] [stdout] 470 + Self::new() [INFO] [stdout] 471 + } [INFO] [stdout] 472 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:470:5 [INFO] [stdout] | [INFO] [stdout] 470 | / return GameModeInfo { [INFO] [stdout] 471 | | time: 0, [INFO] [stdout] 472 | | rounds_won_blue: 0, [INFO] [stdout] 473 | | rounds_won_red: 0, [INFO] [stdout] ... | [INFO] [stdout] 478 | | game_active: false, [INFO] [stdout] 479 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 470 ~ GameModeInfo { [INFO] [stdout] 471 + time: 0, [INFO] [stdout] 472 + rounds_won_blue: 0, [INFO] [stdout] 473 + rounds_won_red: 0, [INFO] [stdout] 474 + total_red: 0, [INFO] [stdout] 475 + total_blue: 0, [INFO] [stdout] 476 + alive_red: 0, [INFO] [stdout] 477 + alive_blue: 0, [INFO] [stdout] 478 + game_active: false, [INFO] [stdout] 479 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:498:5 [INFO] [stdout] | [INFO] [stdout] 498 | / return match self { [INFO] [stdout] 499 | | Character::Cynewynn => String::from("Cynewynn"), [INFO] [stdout] 500 | | Character::Dummy => String::from("Dummy"), [INFO] [stdout] 501 | | Character::Elizabeth => String::from("Josey"), [INFO] [stdout] ... | [INFO] [stdout] 506 | | Character::Wiro => String::from("Wiro"), [INFO] [stdout] 507 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 498 ~ match self { [INFO] [stdout] 499 + Character::Cynewynn => String::from("Cynewynn"), [INFO] [stdout] 500 + Character::Dummy => String::from("Dummy"), [INFO] [stdout] 501 + Character::Elizabeth => String::from("Josey"), [INFO] [stdout] 502 + Character::Hernani => String::from("Hernani"), [INFO] [stdout] 503 + Character::Koldo => String::from("Koldo"), [INFO] [stdout] 504 + Character::Raphaelle => String::from("Raphaelle"), [INFO] [stdout] 505 + Character::Temerity => String::from("Temerity"), [INFO] [stdout] 506 + Character::Wiro => String::from("Wiro"), [INFO] [stdout] 507 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ClientPlayer` [INFO] [stdout] --> src/gamedata.rs:195:3 [INFO] [stdout] | [INFO] [stdout] 195 | / pub fn new() -> ClientPlayer { [INFO] [stdout] 196 | | return ClientPlayer { [INFO] [stdout] 197 | | username: String::from("New User"), [INFO] [stdout] 198 | | health: 100, [INFO] [stdout] ... | [INFO] [stdout] 226 | | }; [INFO] [stdout] 227 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 88 + impl Default for ClientPlayer { [INFO] [stdout] 89 + fn default() -> Self { [INFO] [stdout] 90 + Self::new() [INFO] [stdout] 91 + } [INFO] [stdout] 92 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:90:5 [INFO] [stdout] | [INFO] [stdout] 90 | / return ClientPlayer { [INFO] [stdout] 91 | | username: other_player.username, [INFO] [stdout] 92 | | health: other_player.health, [INFO] [stdout] 93 | | position: other_player.position, [INFO] [stdout] ... | [INFO] [stdout] 119 | | passive_elapsed: 0.0, [INFO] [stdout] 120 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 90 ~ ClientPlayer { [INFO] [stdout] 91 + username: other_player.username, [INFO] [stdout] 92 + health: other_player.health, [INFO] [stdout] 93 + position: other_player.position, [INFO] [stdout] 94 + aim_direction: other_player.aim_direction, [INFO] [stdout] 95 + character: other_player.character, [INFO] [stdout] 96 + secondary_charge: other_player.secondary_charge, [INFO] [stdout] 97 + movement_direction: other_player.movement_direction, [INFO] [stdout] 98 + shooting_primary: other_player.shooting_primary, [INFO] [stdout] 99 + shooting_secondary: other_player.shooting_secondary, [INFO] [stdout] 100 + team: other_player.team, [INFO] [stdout] 101 + time_since_last_dash: other_player.time_since_last_dash, [INFO] [stdout] 102 + is_dead: other_player.is_dead, [INFO] [stdout] 103 + camera: other_player.camera, [INFO] [stdout] 104 + buffs: other_player.buffs, [INFO] [stdout] 105 + previous_positions: other_player.previous_positions, [INFO] [stdout] 106 + ping: 0, [INFO] [stdout] 107 + last_shot_time: 0.0, [INFO] [stdout] 108 + last_secondary_time: 0.0, [INFO] [stdout] 109 + dashing: false, [INFO] [stdout] 110 + is_dashing: false, [INFO] [stdout] 111 + dashed_distance: 0.0, [INFO] [stdout] 112 + stacks: other_player.stacks, [INFO] [stdout] 113 + interpolating: false, [INFO] [stdout] 114 + interpol_next: Vector2::new(), [INFO] [stdout] 115 + interpol_prev: Vector2::new(), [INFO] [stdout] 116 + used_primary: false, [INFO] [stdout] 117 + used_secondary: false, [INFO] [stdout] 118 + used_dash: false, [INFO] [stdout] 119 + passive_elapsed: 0.0, [INFO] [stdout] 120 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gamedata.rs:134:25 [INFO] [stdout] | [INFO] [stdout] 134 | draw_image_relative(&texture, self.position.x -(size/2.0), self.position.y - ((size/2.0)* (8.0/5.0)), size, size * (8.0/5.0), v... [INFO] [stdout] | ^^^^^^^^ help: change this to: `texture` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gamedata.rs:172:154 [INFO] [stdout] | [INFO] [stdout] 172 | ....x, self.position.y + health_counter_offset.y, &font, font_size, vh, camera.clone(), GREEN); [INFO] [stdout] | ^^^^^ help: change this to: `font` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gamedata.rs:175:163 [INFO] [stdout] | [INFO] [stdout] 175 | ... self.position.y + secondary_counter_offset.y, &font, font_size, vh, camera.clone(), ORANGE); [INFO] [stdout] | ^^^^^ help: change this to: `font` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gamedata.rs:190:339 [INFO] [stdout] | [INFO] [stdout] 190 | ...uff_offset.x, self.position.y + buff_offset.y, &font, font_size, vh, camera.clone(), SKYBLUE); [INFO] [stdout] | ^^^^^ help: change this to: `font` [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 `return` statement [INFO] [stdout] --> src/gamedata.rs:196:5 [INFO] [stdout] | [INFO] [stdout] 196 | / return ClientPlayer { [INFO] [stdout] 197 | | username: String::from("New User"), [INFO] [stdout] 198 | | health: 100, [INFO] [stdout] 199 | | position: Vector2::new(), [INFO] [stdout] ... | [INFO] [stdout] 225 | | passive_elapsed: 0.0, [INFO] [stdout] 226 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 196 ~ ClientPlayer { [INFO] [stdout] 197 + username: String::from("New User"), [INFO] [stdout] 198 + health: 100, [INFO] [stdout] 199 + position: Vector2::new(), [INFO] [stdout] 200 + aim_direction: Vector2::new(), [INFO] [stdout] 201 + character: Character::Hernani, [INFO] [stdout] 202 + secondary_charge: 100, [INFO] [stdout] 203 + movement_direction: Vector2::new(), [INFO] [stdout] 204 + shooting_primary: false, [INFO] [stdout] 205 + shooting_secondary: false, [INFO] [stdout] 206 + team: Team::Blue, [INFO] [stdout] 207 + time_since_last_dash: 0.0, [INFO] [stdout] 208 + is_dead: false, [INFO] [stdout] 209 + camera: Camera::new(), [INFO] [stdout] 210 + buffs: Vec::new(), [INFO] [stdout] 211 + previous_positions: Vec::new(), [INFO] [stdout] 212 + ping: 0, [INFO] [stdout] 213 + last_shot_time: 0.0, [INFO] [stdout] 214 + last_secondary_time: 0.0, [INFO] [stdout] 215 + dashing: false, [INFO] [stdout] 216 + is_dashing: false, [INFO] [stdout] 217 + dashed_distance: 0.0, [INFO] [stdout] 218 + stacks: 0, [INFO] [stdout] 219 + interpolating: false, [INFO] [stdout] 220 + interpol_next: Vector2::new(), [INFO] [stdout] 221 + interpol_prev: Vector2::new(), [INFO] [stdout] 222 + used_dash: true, [INFO] [stdout] 223 + used_primary: true, [INFO] [stdout] 224 + used_secondary: true, [INFO] [stdout] 225 + passive_elapsed: 0.0, [INFO] [stdout] 226 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:580:3 [INFO] [stdout] | [INFO] [stdout] 580 | return characters; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 580 - return characters; [INFO] [stdout] 580 + characters [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:586:5 [INFO] [stdout] | [INFO] [stdout] 586 | / return CharacterProperties { [INFO] [stdout] 587 | | health: pkl_u8( find_parameter(&pkl, "health" ).unwrap()), [INFO] [stdout] 588 | | speed: pkl_f32(find_parameter(&pkl, "speed" ).unwrap())*TILE_SIZE, [INFO] [stdout] 589 | | primary_damage: pkl_u8( find_parameter(&pkl, "primary_damage" ).unwrap()), [INFO] [stdout] ... | [INFO] [stdout] 618 | | passive_cooldown: pkl_f32(find_parameter(&pkl, "passive_cooldown" ).unwrap()), [INFO] [stdout] 619 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 586 ~ CharacterProperties { [INFO] [stdout] 587 + health: pkl_u8( find_parameter(&pkl, "health" ).unwrap()), [INFO] [stdout] 588 + speed: pkl_f32(find_parameter(&pkl, "speed" ).unwrap())*TILE_SIZE, [INFO] [stdout] 589 + primary_damage: pkl_u8( find_parameter(&pkl, "primary_damage" ).unwrap()), [INFO] [stdout] 590 + primary_damage_2: pkl_u8( find_parameter(&pkl, "primary_damage_2" ).unwrap()), [INFO] [stdout] 591 + primary_heal: pkl_u8( find_parameter(&pkl, "primary_heal" ).unwrap()), [INFO] [stdout] 592 + primary_heal_2: pkl_u8( find_parameter(&pkl, "primary_heal_2" ).unwrap()), [INFO] [stdout] 593 + primary_lifesteal: pkl_u8( find_parameter(&pkl, "primary_lifesteal" ).unwrap()), [INFO] [stdout] 594 + primary_cooldown: pkl_f32(find_parameter(&pkl, "primary_cooldown" ).unwrap()), [INFO] [stdout] 595 + primary_cooldown_2: pkl_f32(find_parameter(&pkl, "primary_cooldown_2" ).unwrap()), [INFO] [stdout] 596 + primary_range: pkl_f32(find_parameter(&pkl, "primary_range" ).unwrap())*TILE_SIZE, [INFO] [stdout] 597 + primary_range_2: pkl_f32(find_parameter(&pkl, "primary_range_2" ).unwrap())*TILE_SIZE, [INFO] [stdout] 598 + primary_range_3: pkl_f32(find_parameter(&pkl, "primary_range_3" ).unwrap())*TILE_SIZE, [INFO] [stdout] 599 + primary_shot_speed: pkl_f32(find_parameter(&pkl, "primary_shot_speed" ).unwrap())*TILE_SIZE, [INFO] [stdout] 600 + primary_shot_speed_2: pkl_f32(find_parameter(&pkl, "primary_shot_speed_2" ).unwrap())*TILE_SIZE, [INFO] [stdout] 601 + primary_hit_radius: pkl_f32(find_parameter(&pkl, "primary_hit_radius" ).unwrap())*TILE_SIZE, [INFO] [stdout] 602 + primary_wall_hit_radius: pkl_f32(find_parameter(&pkl, "primary_wall_hit_radius" ).unwrap())*TILE_SIZE, [INFO] [stdout] 603 + wall_damage_multiplier: pkl_f32(find_parameter(&pkl, "wall_damage_multiplier" ).unwrap()), [INFO] [stdout] 604 + secondary_damage: pkl_u8( find_parameter(&pkl, "secondary_damage" ).unwrap()), [INFO] [stdout] 605 + secondary_heal: pkl_u8( find_parameter(&pkl, "secondary_heal" ).unwrap()), [INFO] [stdout] 606 + secondary_hit_charge: pkl_u8( find_parameter(&pkl, "secondary_hit_charge" ).unwrap()), [INFO] [stdout] 607 + secondary_heal_charge: pkl_u8( find_parameter(&pkl, "secondary_heal_charge" ).unwrap()), [INFO] [stdout] 608 + secondary_passive_charge: pkl_u8( find_parameter(&pkl, "secondary_passive_charge" ).unwrap()), [INFO] [stdout] 609 + secondary_cooldown: pkl_f32(find_parameter(&pkl, "secondary_cooldown" ).unwrap()), [INFO] [stdout] 610 + secondary_range: pkl_f32(find_parameter(&pkl, "secondary_range" ).unwrap())*TILE_SIZE, [INFO] [stdout] 611 + secondary_charge_use: pkl_u8( find_parameter(&pkl, "secondary_charge_use" ).unwrap()), [INFO] [stdout] 612 + dash_distance: pkl_f32(find_parameter(&pkl, "dash_distance" ).unwrap())*TILE_SIZE, [INFO] [stdout] 613 + dash_cooldown: pkl_f32(find_parameter(&pkl, "dash_cooldown" ).unwrap()), [INFO] [stdout] 614 + dash_damage_multiplier: pkl_f32(find_parameter(&pkl, "dash_damage_multiplier" ).unwrap()), [INFO] [stdout] 615 + dash_speed: pkl_f32(find_parameter(&pkl, "dash_speed" ).unwrap())*TILE_SIZE, [INFO] [stdout] 616 + passive_range: pkl_f32(find_parameter(&pkl, "passive_range" ).unwrap())*TILE_SIZE, [INFO] [stdout] 617 + passive_value: pkl_u8( find_parameter(&pkl, "passive_value" ).unwrap()), [INFO] [stdout] 618 + passive_cooldown: pkl_f32(find_parameter(&pkl, "passive_cooldown" ).unwrap()), [INFO] [stdout] 619 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:624:3 [INFO] [stdout] | [INFO] [stdout] 624 | / return match pkl_value { [INFO] [stdout] 625 | | PklValue::Integer(value) => value as u8, [INFO] [stdout] 626 | | _ => panic!("Pkl value parser could not parse that {:?}", pkl_value) [INFO] [stdout] 627 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 624 ~ match pkl_value { [INFO] [stdout] 625 + PklValue::Integer(value) => value as u8, [INFO] [stdout] 626 + _ => panic!("Pkl value parser could not parse that {:?}", pkl_value) [INFO] [stdout] 627 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:630:3 [INFO] [stdout] | [INFO] [stdout] 630 | / return match pkl_value { [INFO] [stdout] 631 | | PklValue::Float(value) => value as f32, [INFO] [stdout] 632 | | _ => panic!("Pkl value parser could not parse that {:?}", pkl_value) [INFO] [stdout] 633 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 630 ~ match pkl_value { [INFO] [stdout] 631 + PklValue::Float(value) => value as f32, [INFO] [stdout] 632 + _ => panic!("Pkl value parser could not parse that {:?}", pkl_value) [INFO] [stdout] 633 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:307:3 [INFO] [stdout] | [INFO] [stdout] 307 | return port; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 307 - return port; [INFO] [stdout] 307 + port [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/gamedata.rs:354:93 [INFO] [stdout] | [INFO] [stdout] 354 | pub fn damage(&mut self, mut dmg: u8, characters: HashMap) -> () { [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: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/gamedata.rs:359:5 [INFO] [stdout] | [INFO] [stdout] 359 | / match self.character { [INFO] [stdout] 360 | | Character::Raphaelle => { [INFO] [stdout] 361 | | self.buffs.push( [INFO] [stdout] 362 | | Buff { value: 6.0, duration: 0.5, buff_type: BuffType::Speed, direction: Vector2::new() } [INFO] [stdout] ... | [INFO] [stdout] 365 | | _ => {} [INFO] [stdout] 366 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 359 ~ if self.character == Character::Raphaelle { [INFO] [stdout] 360 + self.buffs.push( [INFO] [stdout] 361 + Buff { value: 6.0, duration: 0.5, buff_type: BuffType::Speed, direction: Vector2::new() } [INFO] [stdout] 362 + ); [INFO] [stdout] 363 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/gamedata.rs:379:88 [INFO] [stdout] | [INFO] [stdout] 379 | pub fn heal(&mut self, heal: u8, characters: HashMap) -> () { [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] --> src/gamedata.rs:391:43 [INFO] [stdout] | [INFO] [stdout] 391 | pub fn add_charge(&mut self, charge: u8) -> () { [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 `return` statement [INFO] [stdout] --> src/gamedata.rs:432:3 [INFO] [stdout] | [INFO] [stdout] 432 | return 0; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 432 - return 0; [INFO] [stdout] 432 + 0 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `p_index` is used to index `players` [INFO] [stdout] --> src/gamedata.rs:426:18 [INFO] [stdout] | [INFO] [stdout] 426 | for p_index in 0..players.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] 426 - for p_index in 0..players.len() { [INFO] [stdout] 426 + for (p_index, ) in players.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `GameModeInfo` [INFO] [stdout] --> src/gamedata.rs:469:3 [INFO] [stdout] | [INFO] [stdout] 469 | / pub fn new() -> GameModeInfo { [INFO] [stdout] 470 | | return GameModeInfo { [INFO] [stdout] 471 | | time: 0, [INFO] [stdout] 472 | | rounds_won_blue: 0, [INFO] [stdout] ... | [INFO] [stdout] 480 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 468 + impl Default for GameModeInfo { [INFO] [stdout] 469 + fn default() -> Self { [INFO] [stdout] 470 + Self::new() [INFO] [stdout] 471 + } [INFO] [stdout] 472 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:470:5 [INFO] [stdout] | [INFO] [stdout] 470 | / return GameModeInfo { [INFO] [stdout] 471 | | time: 0, [INFO] [stdout] 472 | | rounds_won_blue: 0, [INFO] [stdout] 473 | | rounds_won_red: 0, [INFO] [stdout] ... | [INFO] [stdout] 478 | | game_active: false, [INFO] [stdout] 479 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 470 ~ GameModeInfo { [INFO] [stdout] 471 + time: 0, [INFO] [stdout] 472 + rounds_won_blue: 0, [INFO] [stdout] 473 + rounds_won_red: 0, [INFO] [stdout] 474 + total_red: 0, [INFO] [stdout] 475 + total_blue: 0, [INFO] [stdout] 476 + alive_red: 0, [INFO] [stdout] 477 + alive_blue: 0, [INFO] [stdout] 478 + game_active: false, [INFO] [stdout] 479 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:738:9 [INFO] [stdout] | [INFO] [stdout] 738 | return data; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 738 - return data; [INFO] [stdout] 738 + data [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/gamedata.rs:745:3 [INFO] [stdout] | [INFO] [stdout] 745 | pub fn get_bullet_data_safe(&self) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] = note: `#[warn(clippy::result_unit_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:748:9 [INFO] [stdout] | [INFO] [stdout] 748 | return Ok(data); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 748 - return Ok(data); [INFO] [stdout] 748 + Ok(data) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:751:9 [INFO] [stdout] | [INFO] [stdout] 751 | return Err(()) [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 751 - return Err(()) [INFO] [stdout] 751 + Err(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:758:9 [INFO] [stdout] | [INFO] [stdout] 758 | return data; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 758 - return data; [INFO] [stdout] 758 + data [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:498:5 [INFO] [stdout] | [INFO] [stdout] 498 | / return match self { [INFO] [stdout] 499 | | Character::Cynewynn => String::from("Cynewynn"), [INFO] [stdout] 500 | | Character::Dummy => String::from("Dummy"), [INFO] [stdout] 501 | | Character::Elizabeth => String::from("Josey"), [INFO] [stdout] ... | [INFO] [stdout] 506 | | Character::Wiro => String::from("Wiro"), [INFO] [stdout] 507 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 498 ~ match self { [INFO] [stdout] 499 + Character::Cynewynn => String::from("Cynewynn"), [INFO] [stdout] 500 + Character::Dummy => String::from("Dummy"), [INFO] [stdout] 501 + Character::Elizabeth => String::from("Josey"), [INFO] [stdout] 502 + Character::Hernani => String::from("Hernani"), [INFO] [stdout] 503 + Character::Koldo => String::from("Koldo"), [INFO] [stdout] 504 + Character::Raphaelle => String::from("Raphaelle"), [INFO] [stdout] 505 + Character::Temerity => String::from("Temerity"), [INFO] [stdout] 506 + Character::Wiro => String::from("Wiro"), [INFO] [stdout] 507 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/gamedata.rs:765:3 [INFO] [stdout] | [INFO] [stdout] 765 | pub fn get_wall_data_safe(&self) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:768:9 [INFO] [stdout] | [INFO] [stdout] 768 | return Ok(data); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 768 - return Ok(data); [INFO] [stdout] 768 + Ok(data) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:771:9 [INFO] [stdout] | [INFO] [stdout] 771 | return Err(()) [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 771 - return Err(()) [INFO] [stdout] 771 + Err(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:823:3 [INFO] [stdout] | [INFO] [stdout] 823 | return map_to_return; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 823 - return map_to_return; [INFO] [stdout] 823 + map_to_return [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u16` which implements the `Copy` trait [INFO] [stdout] --> src/gamedata.rs:803:11 [INFO] [stdout] | [INFO] [stdout] 803 | id: id.clone(), [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:933:5 [INFO] [stdout] | [INFO] [stdout] 933 | return character_descriptions; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 933 - return character_descriptions; [INFO] [stdout] 933 + character_descriptions [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`f32` -> `f32`) [INFO] [stdout] --> src/gamedata.rs:886:197 [INFO] [stdout] | [INFO] [stdout] 886 | ...rate buff."), values: vec![character_properties[&character].secondary_cooldown as f32, character_properties[&character].secondar... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `character_properties[&character].secondary_cooldown` [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 (`f32` -> `f32`) [INFO] [stdout] --> src/gamedata.rs:920:191 [INFO] [stdout] | [INFO] [stdout] 920 | ...ec![character_properties[&character].passive_cooldown as f32, character_properties[&character].primary_range_2/TILE_SIZE, charac... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `character_properties[&character].passive_cooldown` [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: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:956:5 [INFO] [stdout] | [INFO] [stdout] 956 | return text; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 956 - return text; [INFO] [stdout] 956 + text [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/graphics.rs:56:3 [INFO] [stdout] | [INFO] [stdout] 56 | return game_object_tetures; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 56 - return game_object_tetures; [INFO] [stdout] 56 + game_object_tetures [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/graphics.rs:75:3 [INFO] [stdout] | [INFO] [stdout] 75 | return player_textures; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 75 - return player_textures; [INFO] [stdout] 75 + player_textures [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/graphics.rs:80:1 [INFO] [stdout] | [INFO] [stdout] 80 | pub fn draw_image(texture: &Texture2D, x: f32, y: f32, w: f32, h: f32, vh: f32, rotation: Vector2, color: Color) -> () { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/graphics.rs:80:113 [INFO] [stdout] | [INFO] [stdout] 80 | pub fn draw_image(texture: &Texture2D, x: f32, y: f32, w: f32, h: f32, vh: f32, rotation: Vector2, color: Color) -> () { [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: this function has too many arguments (9/7) [INFO] [stdout] --> src/graphics.rs:96:1 [INFO] [stdout] | [INFO] [stdout] 96 | pub fn draw_image_relative(texture: &Texture2D, x: f32, y: f32, w: f32, h: f32, vh: f32, camera: Camera, rotation: Vector2, color: Color) -> () { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/graphics.rs:96:138 [INFO] [stdout] | [INFO] [stdout] 96 | ... camera: Camera, rotation: Vector2, color: Color) -> () { [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: this function has too many arguments (8/7) [INFO] [stdout] --> src/graphics.rs:105:1 [INFO] [stdout] | [INFO] [stdout] 105 | pub fn draw_line_relative(x1: f32, y1: f32, x2: f32, y2: f32, thickness: f32, color: Color, camera: Camera, vh:f32) -> () { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/graphics.rs:105:116 [INFO] [stdout] | [INFO] [stdout] 105 | pub fn draw_line_relative(x1: f32, y1: f32, x2: f32, y2: f32, thickness: f32, color: Color, camera: Camera, vh:f32) -> () { [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] --> src/graphics.rs:112:103 [INFO] [stdout] | [INFO] [stdout] 112 | pub fn draw_rectangle_relative(x1: f32, y1: f32, w: f32, h: f32, color: Color, camera: Camera, vh:f32) -> () { [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: this function has too many arguments (8/7) [INFO] [stdout] --> src/graphics.rs:121:1 [INFO] [stdout] | [INFO] [stdout] 121 | pub fn draw_text_relative(text: &str, x: f32, y:f32, font: &Font, font_size: u16, vh: f32, camera: Camera, color: Color) -> () { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/graphics.rs:121:121 [INFO] [stdout] | [INFO] [stdout] 121 | pub fn draw_text_relative(text: &str, x: f32, y:f32, font: &Font, font_size: u16, vh: f32, camera: Camera, color: Color) -> () { [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] --> src/graphics.rs:127:107 [INFO] [stdout] | [INFO] [stdout] 127 | pub fn draw_lines(positions: Vec, camera: Camera, vh: f32, team: Team, y_offset: f32, alpha: f32) -> () { [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 `return` statement [INFO] [stdout] --> src/gamedata.rs:580:3 [INFO] [stdout] | [INFO] [stdout] 580 | return characters; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 580 - return characters; [INFO] [stdout] 580 + characters [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:586:5 [INFO] [stdout] | [INFO] [stdout] 586 | / return CharacterProperties { [INFO] [stdout] 587 | | health: pkl_u8( find_parameter(&pkl, "health" ).unwrap()), [INFO] [stdout] 588 | | speed: pkl_f32(find_parameter(&pkl, "speed" ).unwrap())*TILE_SIZE, [INFO] [stdout] 589 | | primary_damage: pkl_u8( find_parameter(&pkl, "primary_damage" ).unwrap()), [INFO] [stdout] ... | [INFO] [stdout] 618 | | passive_cooldown: pkl_f32(find_parameter(&pkl, "passive_cooldown" ).unwrap()), [INFO] [stdout] 619 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 586 ~ CharacterProperties { [INFO] [stdout] 587 + health: pkl_u8( find_parameter(&pkl, "health" ).unwrap()), [INFO] [stdout] 588 + speed: pkl_f32(find_parameter(&pkl, "speed" ).unwrap())*TILE_SIZE, [INFO] [stdout] 589 + primary_damage: pkl_u8( find_parameter(&pkl, "primary_damage" ).unwrap()), [INFO] [stdout] 590 + primary_damage_2: pkl_u8( find_parameter(&pkl, "primary_damage_2" ).unwrap()), [INFO] [stdout] 591 + primary_heal: pkl_u8( find_parameter(&pkl, "primary_heal" ).unwrap()), [INFO] [stdout] 592 + primary_heal_2: pkl_u8( find_parameter(&pkl, "primary_heal_2" ).unwrap()), [INFO] [stdout] 593 + primary_lifesteal: pkl_u8( find_parameter(&pkl, "primary_lifesteal" ).unwrap()), [INFO] [stdout] 594 + primary_cooldown: pkl_f32(find_parameter(&pkl, "primary_cooldown" ).unwrap()), [INFO] [stdout] 595 + primary_cooldown_2: pkl_f32(find_parameter(&pkl, "primary_cooldown_2" ).unwrap()), [INFO] [stdout] 596 + primary_range: pkl_f32(find_parameter(&pkl, "primary_range" ).unwrap())*TILE_SIZE, [INFO] [stdout] 597 + primary_range_2: pkl_f32(find_parameter(&pkl, "primary_range_2" ).unwrap())*TILE_SIZE, [INFO] [stdout] 598 + primary_range_3: pkl_f32(find_parameter(&pkl, "primary_range_3" ).unwrap())*TILE_SIZE, [INFO] [stdout] 599 + primary_shot_speed: pkl_f32(find_parameter(&pkl, "primary_shot_speed" ).unwrap())*TILE_SIZE, [INFO] [stdout] 600 + primary_shot_speed_2: pkl_f32(find_parameter(&pkl, "primary_shot_speed_2" ).unwrap())*TILE_SIZE, [INFO] [stdout] 601 + primary_hit_radius: pkl_f32(find_parameter(&pkl, "primary_hit_radius" ).unwrap())*TILE_SIZE, [INFO] [stdout] 602 + primary_wall_hit_radius: pkl_f32(find_parameter(&pkl, "primary_wall_hit_radius" ).unwrap())*TILE_SIZE, [INFO] [stdout] 603 + wall_damage_multiplier: pkl_f32(find_parameter(&pkl, "wall_damage_multiplier" ).unwrap()), [INFO] [stdout] 604 + secondary_damage: pkl_u8( find_parameter(&pkl, "secondary_damage" ).unwrap()), [INFO] [stdout] 605 + secondary_heal: pkl_u8( find_parameter(&pkl, "secondary_heal" ).unwrap()), [INFO] [stdout] 606 + secondary_hit_charge: pkl_u8( find_parameter(&pkl, "secondary_hit_charge" ).unwrap()), [INFO] [stdout] 607 + secondary_heal_charge: pkl_u8( find_parameter(&pkl, "secondary_heal_charge" ).unwrap()), [INFO] [stdout] 608 + secondary_passive_charge: pkl_u8( find_parameter(&pkl, "secondary_passive_charge" ).unwrap()), [INFO] [stdout] 609 + secondary_cooldown: pkl_f32(find_parameter(&pkl, "secondary_cooldown" ).unwrap()), [INFO] [stdout] 610 + secondary_range: pkl_f32(find_parameter(&pkl, "secondary_range" ).unwrap())*TILE_SIZE, [INFO] [stdout] 611 + secondary_charge_use: pkl_u8( find_parameter(&pkl, "secondary_charge_use" ).unwrap()), [INFO] [stdout] 612 + dash_distance: pkl_f32(find_parameter(&pkl, "dash_distance" ).unwrap())*TILE_SIZE, [INFO] [stdout] 613 + dash_cooldown: pkl_f32(find_parameter(&pkl, "dash_cooldown" ).unwrap()), [INFO] [stdout] 614 + dash_damage_multiplier: pkl_f32(find_parameter(&pkl, "dash_damage_multiplier" ).unwrap()), [INFO] [stdout] 615 + dash_speed: pkl_f32(find_parameter(&pkl, "dash_speed" ).unwrap())*TILE_SIZE, [INFO] [stdout] 616 + passive_range: pkl_f32(find_parameter(&pkl, "passive_range" ).unwrap())*TILE_SIZE, [INFO] [stdout] 617 + passive_value: pkl_u8( find_parameter(&pkl, "passive_value" ).unwrap()), [INFO] [stdout] 618 + passive_cooldown: pkl_f32(find_parameter(&pkl, "passive_cooldown" ).unwrap()), [INFO] [stdout] 619 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gameserver.rs:128:62 [INFO] [stdout] | [INFO] [stdout] 128 | let recv_nonce = match bincode::deserialize::(&recv_nonce){ [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `recv_nonce` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gameserver.rs:141:46 [INFO] [stdout] | [INFO] [stdout] 141 | let key = GenericArray::from_slice(&players[p_index].cipher_key.as_slice()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `players[p_index].cipher_key.as_slice()` [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 `return` statement [INFO] [stdout] --> src/gamedata.rs:624:3 [INFO] [stdout] | [INFO] [stdout] 624 | / return match pkl_value { [INFO] [stdout] 625 | | PklValue::Integer(value) => value as u8, [INFO] [stdout] 626 | | _ => panic!("Pkl value parser could not parse that {:?}", pkl_value) [INFO] [stdout] 627 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 624 ~ match pkl_value { [INFO] [stdout] 625 + PklValue::Integer(value) => value as u8, [INFO] [stdout] 626 + _ => panic!("Pkl value parser could not parse that {:?}", pkl_value) [INFO] [stdout] 627 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gameserver.rs:144:49 [INFO] [stdout] | [INFO] [stdout] 144 | let deciphered = match cipher.decrypt(&formatted_nonce, data[4..].as_ref()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `formatted_nonce` [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 `return` statement [INFO] [stdout] --> src/gamedata.rs:630:3 [INFO] [stdout] | [INFO] [stdout] 630 | / return match pkl_value { [INFO] [stdout] 631 | | PklValue::Float(value) => value as f32, [INFO] [stdout] 632 | | _ => panic!("Pkl value parser could not parse that {:?}", pkl_value) [INFO] [stdout] 633 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 630 ~ match pkl_value { [INFO] [stdout] 631 + PklValue::Float(value) => value as f32, [INFO] [stdout] 632 + _ => panic!("Pkl value parser could not parse that {:?}", pkl_value) [INFO] [stdout] 633 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Vector2` which implements the `Copy` trait [INFO] [stdout] --> src/gameserver.rs:177:35 [INFO] [stdout] | [INFO] [stdout] 177 | let previous_position = player.position.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `player.position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/gameserver.rs:198:19 [INFO] [stdout] | [INFO] [stdout] 198 | / if distance < wallride_initiation_distance [INFO] [stdout] 199 | | && WALL_TYPES.contains(&game_object.object_type) { [INFO] [stdout] 200 | | if distance < shortest_distance { [INFO] [stdout] 201 | | closest_pos = game_object.position; [INFO] [stdout] ... | [INFO] [stdout] 204 | | } [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 199 ~ && WALL_TYPES.contains(&game_object.object_type) [INFO] [stdout] 200 ~ && distance < shortest_distance { [INFO] [stdout] 201 | closest_pos = game_object.position; [INFO] [stdout] 202 | shortest_distance = distance; [INFO] [stdout] 203 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/gameserver.rs:377:19 [INFO] [stdout] | [INFO] [stdout] 377 | / if WALL_TYPES.contains(&game_object.object_type) { [INFO] [stdout] 378 | | if distance < shortest_distance { [INFO] [stdout] 379 | | closest_pos = game_object.position; [INFO] [stdout] 380 | | shortest_distance = distance; [INFO] [stdout] 381 | | } [INFO] [stdout] 382 | | } [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 377 ~ if WALL_TYPES.contains(&game_object.object_type) [INFO] [stdout] 378 ~ && distance < shortest_distance { [INFO] [stdout] 379 | closest_pos = game_object.position; [INFO] [stdout] 380 | shortest_distance = distance; [INFO] [stdout] 381 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gameserver.rs:585:48 [INFO] [stdout] | [INFO] [stdout] 585 | let cipher = ChaCha20Poly1305::new(&key); [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gameserver.rs:586:43 [INFO] [stdout] | [INFO] [stdout] 586 | let ciphered = cipher.encrypt(&formatted_nonce, serialized_packet.as_ref()).expect("shit"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `formatted_nonce` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gameserver.rs:610:57 [INFO] [stdout] | [INFO] [stdout] 610 | let nonce = match bincode::deserialize::(&nonce){ [INFO] [stdout] | ^^^^^^ help: change this to: `nonce` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gameserver.rs:620:46 [INFO] [stdout] | [INFO] [stdout] 620 | let key = GenericArray::from_slice(&players[p_index].cipher_key.as_slice()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `players[p_index].cipher_key.as_slice()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gameserver.rs:623:53 [INFO] [stdout] | [INFO] [stdout] 623 | /*let deciphered =*/ match cipher.decrypt(&nonce, data[4..].as_ref()) { [INFO] [stdout] | ^^^^^^ help: change this to: `nonce` [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 late initialization [INFO] [stdout] --> src/gameserver.rs:694:5 [INFO] [stdout] | [INFO] [stdout] 694 | let true_delta_time: f64; // does not need to be mutable, since in both branches the value is assigned. [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `true_delta_time` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 694 ~ // does not need to be mutable, since in both branches the value is assigned. [INFO] [stdout] 695 ~ let true_delta_time: f64 = if delta_time > desired_delta_time { [INFO] [stdout] 696 ~ delta_time [INFO] [stdout] 697 | } else { [INFO] [stdout] 698 ~ desired_delta_time [INFO] [stdout] 699 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/gameserver.rs:758:12 [INFO] [stdout] | [INFO] [stdout] 758 | if gamemode_info.game_active == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!gamemode_info.game_active` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/gameserver.rs:882:9 [INFO] [stdout] | [INFO] [stdout] 882 | / if is_practice { [INFO] [stdout] 883 | | if players[p_index].death_timer_start.elapsed().as_secs_f32() > 1.0 { [INFO] [stdout] 884 | | players[p_index].is_dead = false; [INFO] [stdout] 885 | | } [INFO] [stdout] 886 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 882 ~ if is_practice [INFO] [stdout] 883 ~ && players[p_index].death_timer_start.elapsed().as_secs_f32() > 1.0 { [INFO] [stdout] 884 | players[p_index].is_dead = false; [INFO] [stdout] 885 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Team` which implements the `Copy` trait [INFO] [stdout] --> src/gameserver.rs:891:32 [INFO] [stdout] | [INFO] [stdout] 891 | let player_team_copy = players[p_index].team.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `players[p_index].team` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Vector2` which implements the `Copy` trait [INFO] [stdout] --> src/gameserver.rs:922:35 [INFO] [stdout] | [INFO] [stdout] 922 | let position: Vector2 = players[p_index].position.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `players[p_index].position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/gameserver.rs:932:7 [INFO] [stdout] | [INFO] [stdout] 932 | / if tick { [INFO] [stdout] 933 | | if players[p_index].character == Character::Temerity { [INFO] [stdout] 934 | | for o_index in 0..game_objects.len() { [INFO] [stdout] 935 | | if WALL_TYPES.contains(&game_objects[o_index].object_type) { [INFO] [stdout] ... | [INFO] [stdout] 950 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 932 ~ if tick [INFO] [stdout] 933 ~ && players[p_index].character == Character::Temerity { [INFO] [stdout] 934 | for o_index in 0..game_objects.len() { [INFO] [stdout] ... [INFO] [stdout] 948 | } [INFO] [stdout] 949 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/gameserver.rs:997:11 [INFO] [stdout] | [INFO] [stdout] 997 | / if game_objects[o_index].object_type == GameObjectType::ElizabethProjectileGround { [INFO] [stdout] 998 | | if game_objects[o_index].get_bullet_data().owner_username == players[p_index].username { [INFO] [stdout] 999 | | objects_to_consider.push(o_index); [INFO] [stdout] 1000 | | } [INFO] [stdout] 1001 | | } [INFO] [stdout] | |___________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 997 ~ if game_objects[o_index].object_type == GameObjectType::ElizabethProjectileGround [INFO] [stdout] 998 ~ && game_objects[o_index].get_bullet_data().owner_username == players[p_index].username { [INFO] [stdout] 999 | objects_to_consider.push(o_index); [INFO] [stdout] 1000 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:738:9 [INFO] [stdout] | [INFO] [stdout] 738 | return data; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 738 - return data; [INFO] [stdout] 738 + data [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/gameserver.rs:1018:7 [INFO] [stdout] | [INFO] [stdout] 1018 | / if players[p_index].character == Character::Wiro { [INFO] [stdout] 1019 | | if !players[p_index].shooting_secondary [INFO] [stdout] 1020 | | || players[p_index].secondary_cast_time.elapsed().as_secs_f32() < character.secondary_cooldown [INFO] [stdout] 1021 | | || players[p_index].secondary_charge == 0 { [INFO] [stdout] ... | [INFO] [stdout] 1041 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1018 ~ if players[p_index].character == Character::Wiro [INFO] [stdout] 1019 ~ && (!players[p_index].shooting_secondary [INFO] [stdout] 1020 | || players[p_index].secondary_cast_time.elapsed().as_secs_f32() < character.secondary_cooldown [INFO] [stdout] 1021 ~ || players[p_index].secondary_charge == 0) { [INFO] [stdout] 1022 | for victim_index in 0..players.len() { [INFO] [stdout] ... [INFO] [stdout] 1039 | } [INFO] [stdout] 1040 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/gamedata.rs:745:3 [INFO] [stdout] | [INFO] [stdout] 745 | pub fn get_bullet_data_safe(&self) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] = note: `#[warn(clippy::result_unit_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:748:9 [INFO] [stdout] | [INFO] [stdout] 748 | return Ok(data); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 748 - return Ok(data); [INFO] [stdout] 748 + Ok(data) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:751:9 [INFO] [stdout] | [INFO] [stdout] 751 | return Err(()) [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 751 - return Err(()) [INFO] [stdout] 751 + Err(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:758:9 [INFO] [stdout] | [INFO] [stdout] 758 | return data; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 758 - return data; [INFO] [stdout] 758 + data [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/gamedata.rs:765:3 [INFO] [stdout] | [INFO] [stdout] 765 | pub fn get_wall_data_safe(&self) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:768:9 [INFO] [stdout] | [INFO] [stdout] 768 | return Ok(data); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 768 - return Ok(data); [INFO] [stdout] 768 + Ok(data) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:771:9 [INFO] [stdout] | [INFO] [stdout] 771 | return Err(()) [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 771 - return Err(()) [INFO] [stdout] 771 + Err(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:823:3 [INFO] [stdout] | [INFO] [stdout] 823 | return map_to_return; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 823 - return map_to_return; [INFO] [stdout] 823 + map_to_return [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u16` which implements the `Copy` trait [INFO] [stdout] --> src/gamedata.rs:803:11 [INFO] [stdout] | [INFO] [stdout] 803 | id: id.clone(), [INFO] [stdout] | ^^^^^^^^^^ help: try dereferencing it: `*id` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/gameserver.rs:1344:21 [INFO] [stdout] | [INFO] [stdout] 1344 | / ... if game_object.position.x == desired_placement_position.x && game_object.position.y == desired_placement_position.y { [INFO] [stdout] 1345 | | ... if index == 0 { [INFO] [stdout] 1346 | | ... // if the center wall can't be placed, give up. [INFO] [stdout] 1347 | | ... break; [INFO] [stdout] 1348 | | ... } [INFO] [stdout] 1349 | | ... wall_can_be_placed = false; [INFO] [stdout] 1350 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1343 ~ GameObjectType::HernaniWall | GameObjectType::UnbreakableWall | GameObjectType::Wall [INFO] [stdout] 1344 ~ if game_object.position.x == desired_placement_position.x && game_object.position.y == desired_placement_position.y => { [INFO] [stdout] 1345 | if index == 0 { [INFO] [stdout] ... [INFO] [stdout] 1349 | wall_can_be_placed = false; [INFO] [stdout] 1350 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:933:5 [INFO] [stdout] | [INFO] [stdout] 933 | return character_descriptions; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 933 - return character_descriptions; [INFO] [stdout] 933 + character_descriptions [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/gameserver.rs:1524:9 [INFO] [stdout] | [INFO] [stdout] 1524 | / match players[p_index].character { [INFO] [stdout] 1525 | | Character::Wiro => { [INFO] [stdout] 1526 | | for o_index in 0..game_objects.len() { [INFO] [stdout] ... | [INFO] [stdout] 1536 | | _ => {} [INFO] [stdout] 1537 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1524 ~ if players[p_index].character == Character::Wiro { [INFO] [stdout] 1525 + for o_index in 0..game_objects.len() { [INFO] [stdout] 1526 + // if it's a shield, and it's ours [INFO] [stdout] 1527 + if game_objects[o_index].object_type == GameObjectType::WiroShield [INFO] [stdout] 1528 + && game_objects[o_index].get_bullet_data().owner_username == players[p_index].username { [INFO] [stdout] 1529 + game_objects[o_index].to_be_deleted = true; [INFO] [stdout] 1530 + players[p_index].secondary_cast_time = Instant::now(); [INFO] [stdout] 1531 + break; [INFO] [stdout] 1532 + } [INFO] [stdout] 1533 + } [INFO] [stdout] 1534 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting float literal to `f32` is unnecessary [INFO] [stdout] --> src/gameserver.rs:1549:20 [INFO] [stdout] | [INFO] [stdout] 1549 | orb_timer += 1.0 as f32; [INFO] [stdout] | ^^^^^^^^^^ help: try: `1.0_f32` [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 (`f32` -> `f32`) [INFO] [stdout] --> src/gamedata.rs:886:197 [INFO] [stdout] | [INFO] [stdout] 886 | ...rate buff."), values: vec![character_properties[&character].secondary_cooldown as f32, character_properties[&character].secondar... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `character_properties[&character].secondary_cooldown` [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 (`f32` -> `f32`) [INFO] [stdout] --> src/gamedata.rs:920:191 [INFO] [stdout] | [INFO] [stdout] 920 | ...ec![character_properties[&character].passive_cooldown as f32, character_properties[&character].primary_range_2/TILE_SIZE, charac... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `character_properties[&character].passive_cooldown` [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: unneeded `return` statement [INFO] [stdout] --> src/gamedata.rs:956:5 [INFO] [stdout] | [INFO] [stdout] 956 | return text; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 956 - return text; [INFO] [stdout] 956 + text [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/graphics.rs:56:3 [INFO] [stdout] | [INFO] [stdout] 56 | return game_object_tetures; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 56 - return game_object_tetures; [INFO] [stdout] 56 + game_object_tetures [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/graphics.rs:75:3 [INFO] [stdout] | [INFO] [stdout] 75 | return player_textures; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 75 - return player_textures; [INFO] [stdout] 75 + player_textures [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/gameserver.rs:1735:17 [INFO] [stdout] | [INFO] [stdout] 1735 | / match game_objects[o_index_2].get_bullet_data_safe() { [INFO] [stdout] 1736 | | Ok(bullet_data) => { [INFO] [stdout] 1737 | | if bullet_data.hit_players.contains(&p_index) [INFO] [stdout] 1738 | | && o_index_2 != o_index { [INFO] [stdout] ... | [INFO] [stdout] 1746 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1735 ~ if let Ok(bullet_data) = game_objects[o_index_2].get_bullet_data_safe() { [INFO] [stdout] 1736 + if bullet_data.hit_players.contains(&p_index) [INFO] [stdout] 1737 + && o_index_2 != o_index { [INFO] [stdout] 1738 + was_already_hit = true; [INFO] [stdout] 1739 + break; [INFO] [stdout] 1740 + } [INFO] [stdout] 1741 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (8/7) [INFO] [stdout] --> src/graphics.rs:80:1 [INFO] [stdout] | [INFO] [stdout] 80 | pub fn draw_image(texture: &Texture2D, x: f32, y: f32, w: f32, h: f32, vh: f32, rotation: Vector2, color: Color) -> () { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/gameserver.rs:1778:13 [INFO] [stdout] | [INFO] [stdout] 1778 | / if player.team != owner_team [INFO] [stdout] 1779 | | && Vector2::distance(object_pos, player.position) < range { [INFO] [stdout] 1780 | | if players[owner].secondary_cast_time.elapsed().as_secs_f32() > cooldown { [INFO] [stdout] ... | [INFO] [stdout] 1802 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1779 ~ && Vector2::distance(object_pos, player.position) < range [INFO] [stdout] 1780 ~ && players[owner].secondary_cast_time.elapsed().as_secs_f32() > cooldown { [INFO] [stdout] 1781 | // shoot [INFO] [stdout] ... [INFO] [stdout] 1800 | players[owner].secondary_cast_time = Instant::now(); [INFO] [stdout] 1801 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/graphics.rs:80:113 [INFO] [stdout] | [INFO] [stdout] 80 | pub fn draw_image(texture: &Texture2D, x: f32, y: f32, w: f32, h: f32, vh: f32, rotation: Vector2, color: Color) -> () { [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: this function has too many arguments (9/7) [INFO] [stdout] --> src/graphics.rs:96:1 [INFO] [stdout] | [INFO] [stdout] 96 | pub fn draw_image_relative(texture: &Texture2D, x: f32, y: f32, w: f32, h: f32, vh: f32, camera: Camera, rotation: Vector2, color: Color) -> () { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/graphics.rs:96:138 [INFO] [stdout] | [INFO] [stdout] 96 | ... camera: Camera, rotation: Vector2, color: Color) -> () { [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: this function has too many arguments (8/7) [INFO] [stdout] --> src/graphics.rs:105:1 [INFO] [stdout] | [INFO] [stdout] 105 | pub fn draw_line_relative(x1: f32, y1: f32, x2: f32, y2: f32, thickness: f32, color: Color, camera: Camera, vh:f32) -> () { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/graphics.rs:105:116 [INFO] [stdout] | [INFO] [stdout] 105 | pub fn draw_line_relative(x1: f32, y1: f32, x2: f32, y2: f32, thickness: f32, color: Color, camera: Camera, vh:f32) -> () { [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] --> src/graphics.rs:112:103 [INFO] [stdout] | [INFO] [stdout] 112 | pub fn draw_rectangle_relative(x1: f32, y1: f32, w: f32, h: f32, color: Color, camera: Camera, vh:f32) -> () { [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: this function has too many arguments (8/7) [INFO] [stdout] --> src/graphics.rs:121:1 [INFO] [stdout] | [INFO] [stdout] 121 | pub fn draw_text_relative(text: &str, x: f32, y:f32, font: &Font, font_size: u16, vh: f32, camera: Camera, color: Color) -> () { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/graphics.rs:121:121 [INFO] [stdout] | [INFO] [stdout] 121 | pub fn draw_text_relative(text: &str, x: f32, y:f32, font: &Font, font_size: u16, vh: f32, camera: Camera, color: Color) -> () { [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] --> src/graphics.rs:127:107 [INFO] [stdout] | [INFO] [stdout] 127 | pub fn draw_lines(positions: Vec, camera: Camera, vh: f32, team: Team, y_offset: f32, alpha: f32) -> () { [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 late initialization [INFO] [stdout] --> src/gameserver.rs:1914:11 [INFO] [stdout] | [INFO] [stdout] 1914 | let damage: u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `damage` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 1914 ~ [INFO] [stdout] 1915 ~ let damage: u8 = if distance_traveled > characters[&Character::Wiro].primary_range_2 { [INFO] [stdout] 1916 ~ characters[&Character::Wiro].primary_damage_2 [INFO] [stdout] 1917 | } else { [INFO] [stdout] 1918 ~ characters[&Character::Wiro].primary_damage [INFO] [stdout] 1919 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/gameserver.rs:2032:11 [INFO] [stdout] | [INFO] [stdout] 2032 | / match game_objects[o_index].get_wall_data_safe() { [INFO] [stdout] 2033 | | Ok(mut wall_data) => { [INFO] [stdout] 2034 | | wall_data.lifetime -= true_delta_time as f32; [INFO] [stdout] 2035 | | game_objects[o_index].extra_data = ObjectData::WallData(wall_data); [INFO] [stdout] ... | [INFO] [stdout] 2043 | | } [INFO] [stdout] | |___________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 2032 ~ if let Ok(mut wall_data) = game_objects[o_index].get_wall_data_safe() { [INFO] [stdout] 2033 + wall_data.lifetime -= true_delta_time as f32; [INFO] [stdout] 2034 + game_objects[o_index].extra_data = ObjectData::WallData(wall_data); [INFO] [stdout] 2035 + if game_objects[o_index].get_wall_data().lifetime < 0.0 { [INFO] [stdout] 2036 + game_objects[o_index].to_be_deleted = true; [INFO] [stdout] 2037 + } [INFO] [stdout] 2038 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/gameserver.rs:2051:10 [INFO] [stdout] | [INFO] [stdout] 2051 | if game_object.to_be_deleted == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `game_object.to_be_deleted` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/gameserver.rs:2080:13 [INFO] [stdout] | [INFO] [stdout] 2080 | / if game_object.get_bullet_data().hit_players.is_empty() { [INFO] [stdout] 2081 | | let owner_index = index_by_username(&game_object.get_bullet_data().owner_username,players.clone()); [INFO] [stdout] 2082 | | players[owner_index].stacks = 0; [INFO] [stdout] 2083 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 2079 ~ GameObjectType::TemerityRocket [INFO] [stdout] 2080 ~ if game_object.get_bullet_data().hit_players.is_empty() => { [INFO] [stdout] 2081 | let owner_index = index_by_username(&game_object.get_bullet_data().owner_username,players.clone()); [INFO] [stdout] 2082 | players[owner_index].stacks = 0; [INFO] [stdout] 2083 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/gameserver.rs:2086:13 [INFO] [stdout] | [INFO] [stdout] 2086 | / if game_object.get_bullet_data().hit_players.is_empty() { [INFO] [stdout] 2087 | | let owner_index = index_by_username(&game_object.get_bullet_data().owner_username, players.clone()); [INFO] [stdout] 2088 | | let distance = players[owner_index].position - game_object.position; [INFO] [stdout] 2089 | | if distance.magnitude() < characters[&Character::Koldo].primary_range_3 { [INFO] [stdout] ... | [INFO] [stdout] 2099 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 2085 ~ GameObjectType::KoldoCannonBall | GameObjectType::KoldoCannonBallEmpowered | GameObjectType::KoldoCannonBallEmpoweredUltimate [INFO] [stdout] 2086 ~ if game_object.get_bullet_data().hit_players.is_empty() => { [INFO] [stdout] 2087 | let owner_index = index_by_username(&game_object.get_bullet_data().owner_username, players.clone()); [INFO] [stdout] ... [INFO] [stdout] 2098 | } [INFO] [stdout] 2099 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gameserver.rs:128:62 [INFO] [stdout] | [INFO] [stdout] 128 | let recv_nonce = match bincode::deserialize::(&recv_nonce){ [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `recv_nonce` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gameserver.rs:141:46 [INFO] [stdout] | [INFO] [stdout] 141 | let key = GenericArray::from_slice(&players[p_index].cipher_key.as_slice()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `players[p_index].cipher_key.as_slice()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gameserver.rs:144:49 [INFO] [stdout] | [INFO] [stdout] 144 | let deciphered = match cipher.decrypt(&formatted_nonce, data[4..].as_ref()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `formatted_nonce` [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 `Vector2` which implements the `Copy` trait [INFO] [stdout] --> src/gameserver.rs:177:35 [INFO] [stdout] | [INFO] [stdout] 177 | let previous_position = player.position.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `player.position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/gameserver.rs:198:19 [INFO] [stdout] | [INFO] [stdout] 198 | / if distance < wallride_initiation_distance [INFO] [stdout] 199 | | && WALL_TYPES.contains(&game_object.object_type) { [INFO] [stdout] 200 | | if distance < shortest_distance { [INFO] [stdout] 201 | | closest_pos = game_object.position; [INFO] [stdout] ... | [INFO] [stdout] 204 | | } [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 199 ~ && WALL_TYPES.contains(&game_object.object_type) [INFO] [stdout] 200 ~ && distance < shortest_distance { [INFO] [stdout] 201 | closest_pos = game_object.position; [INFO] [stdout] 202 | shortest_distance = distance; [INFO] [stdout] 203 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/gameserver.rs:377:19 [INFO] [stdout] | [INFO] [stdout] 377 | / if WALL_TYPES.contains(&game_object.object_type) { [INFO] [stdout] 378 | | if distance < shortest_distance { [INFO] [stdout] 379 | | closest_pos = game_object.position; [INFO] [stdout] 380 | | shortest_distance = distance; [INFO] [stdout] 381 | | } [INFO] [stdout] 382 | | } [INFO] [stdout] | |___________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 377 ~ if WALL_TYPES.contains(&game_object.object_type) [INFO] [stdout] 378 ~ && distance < shortest_distance { [INFO] [stdout] 379 | closest_pos = game_object.position; [INFO] [stdout] 380 | shortest_distance = distance; [INFO] [stdout] 381 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/mothership_common.rs:44:1 [INFO] [stdout] | [INFO] [stdout] 44 | / pub enum ServerToClient { [INFO] [stdout] 45 | | MatchAssignment(MatchAssignmentData), [INFO] [stdout] 46 | | RegisterResponse1(RegistrationResponse), [INFO] [stdout] | | ----------------------------------------------------------- the second-largest variant contains at least 320 bytes [INFO] [stdout] 47 | | RegisterSuccessful, [INFO] [stdout] 48 | | LoginResponse1(CredentialResponse), [INFO] [stdout] | | ------------------------------------------------------ the largest variant contains at least 576 bytes [INFO] [stdout] ... | [INFO] [stdout] 71 | | GameServerCrashApology, [INFO] [stdout] 72 | | } [INFO] [stdout] | |_^ the entire enum is at least 592 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] = note: `#[warn(clippy::large_enum_variant)]` on by default [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 48 - LoginResponse1(CredentialResponse), [INFO] [stdout] 48 + LoginResponse1(Box>), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gameserver.rs:585:48 [INFO] [stdout] | [INFO] [stdout] 585 | let cipher = ChaCha20Poly1305::new(&key); [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gameserver.rs:586:43 [INFO] [stdout] | [INFO] [stdout] 586 | let ciphered = cipher.encrypt(&formatted_nonce, serialized_packet.as_ref()).expect("shit"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `formatted_nonce` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gameserver.rs:610:57 [INFO] [stdout] | [INFO] [stdout] 610 | let nonce = match bincode::deserialize::(&nonce){ [INFO] [stdout] | ^^^^^^ help: change this to: `nonce` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gameserver.rs:620:46 [INFO] [stdout] | [INFO] [stdout] 620 | let key = GenericArray::from_slice(&players[p_index].cipher_key.as_slice()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `players[p_index].cipher_key.as_slice()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/gameserver.rs:623:53 [INFO] [stdout] | [INFO] [stdout] 623 | /*let deciphered =*/ match cipher.decrypt(&nonce, data[4..].as_ref()) { [INFO] [stdout] | ^^^^^^ help: change this to: `nonce` [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 late initialization [INFO] [stdout] --> src/gameserver.rs:694:5 [INFO] [stdout] | [INFO] [stdout] 694 | let true_delta_time: f64; // does not need to be mutable, since in both branches the value is assigned. [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `true_delta_time` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 694 ~ // does not need to be mutable, since in both branches the value is assigned. [INFO] [stdout] 695 ~ let true_delta_time: f64 = if delta_time > desired_delta_time { [INFO] [stdout] 696 ~ delta_time [INFO] [stdout] 697 | } else { [INFO] [stdout] 698 ~ desired_delta_time [INFO] [stdout] 699 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/gameserver.rs:758:12 [INFO] [stdout] | [INFO] [stdout] 758 | if gamemode_info.game_active == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!gamemode_info.game_active` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/gameserver.rs:882:9 [INFO] [stdout] | [INFO] [stdout] 882 | / if is_practice { [INFO] [stdout] 883 | | if players[p_index].death_timer_start.elapsed().as_secs_f32() > 1.0 { [INFO] [stdout] 884 | | players[p_index].is_dead = false; [INFO] [stdout] 885 | | } [INFO] [stdout] 886 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 882 ~ if is_practice [INFO] [stdout] 883 ~ && players[p_index].death_timer_start.elapsed().as_secs_f32() > 1.0 { [INFO] [stdout] 884 | players[p_index].is_dead = false; [INFO] [stdout] 885 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Team` which implements the `Copy` trait [INFO] [stdout] --> src/gameserver.rs:891:32 [INFO] [stdout] | [INFO] [stdout] 891 | let player_team_copy = players[p_index].team.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `players[p_index].team` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Vector2` which implements the `Copy` trait [INFO] [stdout] --> src/gameserver.rs:922:35 [INFO] [stdout] | [INFO] [stdout] 922 | let position: Vector2 = players[p_index].position.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `players[p_index].position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/gameserver.rs:932:7 [INFO] [stdout] | [INFO] [stdout] 932 | / if tick { [INFO] [stdout] 933 | | if players[p_index].character == Character::Temerity { [INFO] [stdout] 934 | | for o_index in 0..game_objects.len() { [INFO] [stdout] 935 | | if WALL_TYPES.contains(&game_objects[o_index].object_type) { [INFO] [stdout] ... | [INFO] [stdout] 950 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 932 ~ if tick [INFO] [stdout] 933 ~ && players[p_index].character == Character::Temerity { [INFO] [stdout] 934 | for o_index in 0..game_objects.len() { [INFO] [stdout] ... [INFO] [stdout] 948 | } [INFO] [stdout] 949 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/gameserver.rs:997:11 [INFO] [stdout] | [INFO] [stdout] 997 | / if game_objects[o_index].object_type == GameObjectType::ElizabethProjectileGround { [INFO] [stdout] 998 | | if game_objects[o_index].get_bullet_data().owner_username == players[p_index].username { [INFO] [stdout] 999 | | objects_to_consider.push(o_index); [INFO] [stdout] 1000 | | } [INFO] [stdout] 1001 | | } [INFO] [stdout] | |___________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 997 ~ if game_objects[o_index].object_type == GameObjectType::ElizabethProjectileGround [INFO] [stdout] 998 ~ && game_objects[o_index].get_bullet_data().owner_username == players[p_index].username { [INFO] [stdout] 999 | objects_to_consider.push(o_index); [INFO] [stdout] 1000 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/gameserver.rs:1018:7 [INFO] [stdout] | [INFO] [stdout] 1018 | / if players[p_index].character == Character::Wiro { [INFO] [stdout] 1019 | | if !players[p_index].shooting_secondary [INFO] [stdout] 1020 | | || players[p_index].secondary_cast_time.elapsed().as_secs_f32() < character.secondary_cooldown [INFO] [stdout] 1021 | | || players[p_index].secondary_charge == 0 { [INFO] [stdout] ... | [INFO] [stdout] 1041 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1018 ~ if players[p_index].character == Character::Wiro [INFO] [stdout] 1019 ~ && (!players[p_index].shooting_secondary [INFO] [stdout] 1020 | || players[p_index].secondary_cast_time.elapsed().as_secs_f32() < character.secondary_cooldown [INFO] [stdout] 1021 ~ || players[p_index].secondary_charge == 0) { [INFO] [stdout] 1022 | for victim_index in 0..players.len() { [INFO] [stdout] ... [INFO] [stdout] 1039 | } [INFO] [stdout] 1040 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `PlayerStatistics` [INFO] [stdout] --> src/mothership_common.rs:91:3 [INFO] [stdout] | [INFO] [stdout] 91 | / pub fn new() -> PlayerStatistics { [INFO] [stdout] 92 | | return PlayerStatistics { [INFO] [stdout] 93 | | wins: 0, [INFO] [stdout] 94 | | }; [INFO] [stdout] 95 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 90 + impl Default for PlayerStatistics { [INFO] [stdout] 91 + fn default() -> Self { [INFO] [stdout] 92 + Self::new() [INFO] [stdout] 93 + } [INFO] [stdout] 94 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/gameserver.rs:1344:21 [INFO] [stdout] | [INFO] [stdout] 1344 | / ... if game_object.position.x == desired_placement_position.x && game_object.position.y == desired_placement_position.y { [INFO] [stdout] 1345 | | ... if index == 0 { [INFO] [stdout] 1346 | | ... // if the center wall can't be placed, give up. [INFO] [stdout] 1347 | | ... break; [INFO] [stdout] 1348 | | ... } [INFO] [stdout] 1349 | | ... wall_can_be_placed = false; [INFO] [stdout] 1350 | | ... } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1343 ~ GameObjectType::HernaniWall | GameObjectType::UnbreakableWall | GameObjectType::Wall [INFO] [stdout] 1344 ~ if game_object.position.x == desired_placement_position.x && game_object.position.y == desired_placement_position.y => { [INFO] [stdout] 1345 | if index == 0 { [INFO] [stdout] ... [INFO] [stdout] 1349 | wall_can_be_placed = false; [INFO] [stdout] 1350 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/mothership_common.rs:92:5 [INFO] [stdout] | [INFO] [stdout] 92 | / return PlayerStatistics { [INFO] [stdout] 93 | | wins: 0, [INFO] [stdout] 94 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 92 ~ PlayerStatistics { [INFO] [stdout] 93 + wins: 0, [INFO] [stdout] 94 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/gameserver.rs:1524:9 [INFO] [stdout] | [INFO] [stdout] 1524 | / match players[p_index].character { [INFO] [stdout] 1525 | | Character::Wiro => { [INFO] [stdout] 1526 | | for o_index in 0..game_objects.len() { [INFO] [stdout] ... | [INFO] [stdout] 1536 | | _ => {} [INFO] [stdout] 1537 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1524 ~ if players[p_index].character == Character::Wiro { [INFO] [stdout] 1525 + for o_index in 0..game_objects.len() { [INFO] [stdout] 1526 + // if it's a shield, and it's ours [INFO] [stdout] 1527 + if game_objects[o_index].object_type == GameObjectType::WiroShield [INFO] [stdout] 1528 + && game_objects[o_index].get_bullet_data().owner_username == players[p_index].username { [INFO] [stdout] 1529 + game_objects[o_index].to_be_deleted = true; [INFO] [stdout] 1530 + players[p_index].secondary_cast_time = Instant::now(); [INFO] [stdout] 1531 + break; [INFO] [stdout] 1532 + } [INFO] [stdout] 1533 + } [INFO] [stdout] 1534 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting float literal to `f32` is unnecessary [INFO] [stdout] --> src/gameserver.rs:1549:20 [INFO] [stdout] | [INFO] [stdout] 1549 | orb_timer += 1.0 as f32; [INFO] [stdout] | ^^^^^^^^^^ help: try: `1.0_f32` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/gameserver.rs:1735:17 [INFO] [stdout] | [INFO] [stdout] 1735 | / match game_objects[o_index_2].get_bullet_data_safe() { [INFO] [stdout] 1736 | | Ok(bullet_data) => { [INFO] [stdout] 1737 | | if bullet_data.hit_players.contains(&p_index) [INFO] [stdout] 1738 | | && o_index_2 != o_index { [INFO] [stdout] ... | [INFO] [stdout] 1746 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1735 ~ if let Ok(bullet_data) = game_objects[o_index_2].get_bullet_data_safe() { [INFO] [stdout] 1736 + if bullet_data.hit_players.contains(&p_index) [INFO] [stdout] 1737 + && o_index_2 != o_index { [INFO] [stdout] 1738 + was_already_hit = true; [INFO] [stdout] 1739 + break; [INFO] [stdout] 1740 + } [INFO] [stdout] 1741 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/gameserver.rs:1778:13 [INFO] [stdout] | [INFO] [stdout] 1778 | / if player.team != owner_team [INFO] [stdout] 1779 | | && Vector2::distance(object_pos, player.position) < range { [INFO] [stdout] 1780 | | if players[owner].secondary_cast_time.elapsed().as_secs_f32() > cooldown { [INFO] [stdout] ... | [INFO] [stdout] 1802 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1779 ~ && Vector2::distance(object_pos, player.position) < range [INFO] [stdout] 1780 ~ && players[owner].secondary_cast_time.elapsed().as_secs_f32() > cooldown { [INFO] [stdout] 1781 | // shoot [INFO] [stdout] ... [INFO] [stdout] 1800 | players[owner].secondary_cast_time = Instant::now(); [INFO] [stdout] 1801 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/gameserver.rs:1914:11 [INFO] [stdout] | [INFO] [stdout] 1914 | let damage: u8; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `damage` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 1914 ~ [INFO] [stdout] 1915 ~ let damage: u8 = if distance_traveled > characters[&Character::Wiro].primary_range_2 { [INFO] [stdout] 1916 ~ characters[&Character::Wiro].primary_damage_2 [INFO] [stdout] 1917 | } else { [INFO] [stdout] 1918 ~ characters[&Character::Wiro].primary_damage [INFO] [stdout] 1919 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/gameserver.rs:2032:11 [INFO] [stdout] | [INFO] [stdout] 2032 | / match game_objects[o_index].get_wall_data_safe() { [INFO] [stdout] 2033 | | Ok(mut wall_data) => { [INFO] [stdout] 2034 | | wall_data.lifetime -= true_delta_time as f32; [INFO] [stdout] 2035 | | game_objects[o_index].extra_data = ObjectData::WallData(wall_data); [INFO] [stdout] ... | [INFO] [stdout] 2043 | | } [INFO] [stdout] | |___________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 2032 ~ if let Ok(mut wall_data) = game_objects[o_index].get_wall_data_safe() { [INFO] [stdout] 2033 + wall_data.lifetime -= true_delta_time as f32; [INFO] [stdout] 2034 + game_objects[o_index].extra_data = ObjectData::WallData(wall_data); [INFO] [stdout] 2035 + if game_objects[o_index].get_wall_data().lifetime < 0.0 { [INFO] [stdout] 2036 + game_objects[o_index].to_be_deleted = true; [INFO] [stdout] 2037 + } [INFO] [stdout] 2038 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/gameserver.rs:2051:10 [INFO] [stdout] | [INFO] [stdout] 2051 | if game_object.to_be_deleted == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `game_object.to_be_deleted` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/gameserver.rs:2080:13 [INFO] [stdout] | [INFO] [stdout] 2080 | / if game_object.get_bullet_data().hit_players.is_empty() { [INFO] [stdout] 2081 | | let owner_index = index_by_username(&game_object.get_bullet_data().owner_username,players.clone()); [INFO] [stdout] 2082 | | players[owner_index].stacks = 0; [INFO] [stdout] 2083 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 2079 ~ GameObjectType::TemerityRocket [INFO] [stdout] 2080 ~ if game_object.get_bullet_data().hit_players.is_empty() => { [INFO] [stdout] 2081 | let owner_index = index_by_username(&game_object.get_bullet_data().owner_username,players.clone()); [INFO] [stdout] 2082 | players[owner_index].stacks = 0; [INFO] [stdout] 2083 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/mothership_common.rs:185:1 [INFO] [stdout] | [INFO] [stdout] 185 | / pub enum PlayerMessage { [INFO] [stdout] 186 | | /// This thread must stop now. [INFO] [stdout] 187 | | ForceDisconnect, [INFO] [stdout] | | --------------- the second-largest variant carries no data at all [INFO] [stdout] 188 | | SendPacket(ServerToClientPacket), [INFO] [stdout] | | -------------------------------- the largest variant contains at least 592 bytes [INFO] [stdout] 189 | | } [INFO] [stdout] | |_^ the entire enum is at least 592 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 188 - SendPacket(ServerToClientPacket), [INFO] [stdout] 188 + SendPacket(Box), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/gameserver.rs:2086:13 [INFO] [stdout] | [INFO] [stdout] 2086 | / if game_object.get_bullet_data().hit_players.is_empty() { [INFO] [stdout] 2087 | | let owner_index = index_by_username(&game_object.get_bullet_data().owner_username, players.clone()); [INFO] [stdout] 2088 | | let distance = players[owner_index].position - game_object.position; [INFO] [stdout] 2089 | | if distance.magnitude() < characters[&Character::Koldo].primary_range_3 { [INFO] [stdout] ... | [INFO] [stdout] 2099 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 2085 ~ GameObjectType::KoldoCannonBall | GameObjectType::KoldoCannonBallEmpowered | GameObjectType::KoldoCannonBallEmpoweredUltimate [INFO] [stdout] 2086 ~ if game_object.get_bullet_data().hit_players.is_empty() => { [INFO] [stdout] 2087 | let owner_index = index_by_username(&game_object.get_bullet_data().owner_username, players.clone()); [INFO] [stdout] ... [INFO] [stdout] 2098 | } [INFO] [stdout] 2099 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/database.rs:14:59 [INFO] [stdout] | [INFO] [stdout] 14 | pub fn get_player(database: &Database, username: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 160 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `redb::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] = note: `#[warn(clippy::result_large_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | return Ok(data); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 22 - return Ok(data); [INFO] [stdout] 22 + Ok(data) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | return Err(redb::Error::PreviousIo); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 26 - return Err(redb::Error::PreviousIo); [INFO] [stdout] 26 + Err(redb::Error::PreviousIo) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | return Err(redb::Error::PreviousIo); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - return Err(redb::Error::PreviousIo); [INFO] [stdout] 30 + Err(redb::Error::PreviousIo) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/database.rs:36:91 [INFO] [stdout] | [INFO] [stdout] 36 | pub fn create_player(database: &mut Database, username: &str, player_data: PlayerData) -> Result<(), Error>{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 160 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `redb::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:53:3 [INFO] [stdout] | [INFO] [stdout] 53 | return Ok(()); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 53 - return Ok(()); [INFO] [stdout] 53 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/database.rs:56:63 [INFO] [stdout] | [INFO] [stdout] 56 | pub fn username_taken(database: &Database, username: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 160 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `redb::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:65:3 [INFO] [stdout] | [INFO] [stdout] 65 | return Ok(taken); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 65 - return Ok(taken); [INFO] [stdout] 65 + Ok(taken) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/database.rs:71:18 [INFO] [stdout] | [INFO] [stdout] 71 | pub fn load() -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 160 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `redb::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:74:3 [INFO] [stdout] | [INFO] [stdout] 74 | return Ok(database); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 74 - return Ok(database); [INFO] [stdout] 74 + Ok(database) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/database.rs:77:31 [INFO] [stdout] | [INFO] [stdout] 77 | pub fn load_server_setup() -> Result, Error> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 160 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `redb::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:97:5 [INFO] [stdout] | [INFO] [stdout] 97 | return Ok(server_setup); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 97 - return Ok(server_setup); [INFO] [stdout] 97 + Ok(server_setup) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:105:5 [INFO] [stdout] | [INFO] [stdout] 105 | return Ok(server_setup); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 105 - return Ok(server_setup); [INFO] [stdout] 105 + Ok(server_setup) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/database.rs:78:3 [INFO] [stdout] | [INFO] [stdout] 78 | let file_exists: bool; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `file_exists` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 78 ~ [INFO] [stdout] 79 ~ let file_exists: bool = match fs::exists(SERVER_SETUP_LOCATION) { [INFO] [stdout] 80 | Ok(exists) => { [INFO] [stdout] 81 ~ exists [INFO] [stdout] 82 | } [INFO] [stdout] 83 | Err(_err) => { [INFO] [stdout] 84 ~ false [INFO] [stdout] 85 | } [INFO] [stdout] 86 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:119:5 [INFO] [stdout] | [INFO] [stdout] 119 | / return PlayerData { [INFO] [stdout] 120 | | password_hash, [INFO] [stdout] 121 | | wins: 0, [INFO] [stdout] 122 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 119 ~ PlayerData { [INFO] [stdout] 120 + password_hash, [INFO] [stdout] 121 + wins: 0, [INFO] [stdout] 122 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:134:5 [INFO] [stdout] | [INFO] [stdout] 134 | return format!("{}:{}", username_b, username_a); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 134 - return format!("{}:{}", username_b, username_a); [INFO] [stdout] 134 + format!("{}:{}", username_b, username_a) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:136:5 [INFO] [stdout] | [INFO] [stdout] 136 | return format!("{}:{}", username_a, username_b); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 136 - return format!("{}:{}", username_a, username_b); [INFO] [stdout] 136 + format!("{}:{}", username_a, username_b) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:152:5 [INFO] [stdout] | [INFO] [stdout] 152 | / return match num { [INFO] [stdout] 153 | | 0 => FriendShipStatus::Friends, [INFO] [stdout] 154 | | 1 => FriendShipStatus::PendingForA, [INFO] [stdout] 155 | | 2 => FriendShipStatus::PendingForB, [INFO] [stdout] 156 | | _ => FriendShipStatus::Blocked, [INFO] [stdout] 157 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 152 ~ match num { [INFO] [stdout] 153 + 0 => FriendShipStatus::Friends, [INFO] [stdout] 154 + 1 => FriendShipStatus::PendingForA, [INFO] [stdout] 155 + 2 => FriendShipStatus::PendingForB, [INFO] [stdout] 156 + _ => FriendShipStatus::Blocked, [INFO] [stdout] 157 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:162:5 [INFO] [stdout] | [INFO] [stdout] 162 | return FriendShipStatus::PendingForA; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 162 - return FriendShipStatus::PendingForA; [INFO] [stdout] 162 + FriendShipStatus::PendingForA [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:164:5 [INFO] [stdout] | [INFO] [stdout] 164 | return FriendShipStatus:: PendingForB; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 164 - return FriendShipStatus:: PendingForB; [INFO] [stdout] 164 + FriendShipStatus:: PendingForB [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/database.rs:168:123 [INFO] [stdout] | [INFO] [stdout] 168 | ...dship_status: FriendShipStatus) -> Result<(), Error> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 160 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `redb::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:177:3 [INFO] [stdout] | [INFO] [stdout] 177 | return Ok(()); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 177 - return Ok(()); [INFO] [stdout] 177 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/database.rs:180:86 [INFO] [stdout] | [INFO] [stdout] 180 | pub fn get_friend_status(database: &Database, username_a: &str, username_b: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 160 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `redb::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:203:3 [INFO] [stdout] | [INFO] [stdout] 203 | return Err(Error::Corrupted(String::from("norelation"))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 203 - return Err(Error::Corrupted(String::from("norelation"))); [INFO] [stdout] 203 + Err(Error::Corrupted(String::from("norelation"))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/database.rs:206:64 [INFO] [stdout] | [INFO] [stdout] 206 | pub fn get_status_list(database: &Database, username: &str) -> Result, Error> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 160 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `redb::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:223:3 [INFO] [stdout] | [INFO] [stdout] 223 | return Ok(friendship_statuses); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 223 - return Ok(friendship_statuses); [INFO] [stdout] 223 + Ok(friendship_statuses) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/mothership_common.rs:44:1 [INFO] [stdout] | [INFO] [stdout] 44 | / pub enum ServerToClient { [INFO] [stdout] 45 | | MatchAssignment(MatchAssignmentData), [INFO] [stdout] 46 | | RegisterResponse1(RegistrationResponse), [INFO] [stdout] | | ----------------------------------------------------------- the second-largest variant contains at least 320 bytes [INFO] [stdout] 47 | | RegisterSuccessful, [INFO] [stdout] 48 | | LoginResponse1(CredentialResponse), [INFO] [stdout] | | ------------------------------------------------------ the largest variant contains at least 576 bytes [INFO] [stdout] ... | [INFO] [stdout] 71 | | GameServerCrashApology, [INFO] [stdout] 72 | | } [INFO] [stdout] | |_^ the entire enum is at least 592 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] = note: `#[warn(clippy::large_enum_variant)]` on by default [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 48 - LoginResponse1(CredentialResponse), [INFO] [stdout] 48 + LoginResponse1(Box>), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:238:3 [INFO] [stdout] | [INFO] [stdout] 238 | return peer_username.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 238 - return peer_username.to_string(); [INFO] [stdout] 238 + peer_username.to_string() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/database.rs:231:3 [INFO] [stdout] | [INFO] [stdout] 231 | let peer_username; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `peer_username` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 231 ~ [INFO] [stdout] 232 | let split: Vec<&str> = friend_couple.split(":").collect(); [INFO] [stdout] 233 ~ let peer_username = if *split[0] == *username { [INFO] [stdout] 234 ~ split[1] [INFO] [stdout] 235 | } else { [INFO] [stdout] 236 ~ split[0] [INFO] [stdout] 237 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/filter.rs:7:3 [INFO] [stdout] | [INFO] [stdout] 7 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 7 - return true; [INFO] [stdout] 7 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/filter.rs:22:3 [INFO] [stdout] | [INFO] [stdout] 22 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 22 - return true; [INFO] [stdout] 22 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/network.rs:27:3 [INFO] [stdout] | [INFO] [stdout] 27 | return Ok(encoded_packet); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 27 - return Ok(encoded_packet); [INFO] [stdout] 27 + Ok(encoded_packet) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/network.rs:57:3 [INFO] [stdout] | [INFO] [stdout] 57 | return Ok(encoded_packet); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 57 - return Ok(encoded_packet); [INFO] [stdout] 57 + Ok(encoded_packet) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/network.rs:44:38 [INFO] [stdout] | [INFO] [stdout] 44 | let cipher = ChaCha20Poly1305::new(&key); [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/network.rs:47:33 [INFO] [stdout] | [INFO] [stdout] 47 | let ciphered = cipher.encrypt(&formatted_nonce, serialized_packet.as_ref()).expect("shit"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `formatted_nonce` [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 `return` statement [INFO] [stdout] --> src/network.rs:86:3 [INFO] [stdout] | [INFO] [stdout] 86 | return Ok(decoded_packets); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 86 - return Ok(decoded_packets); [INFO] [stdout] 86 + Ok(decoded_packets) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/network.rs:145:3 [INFO] [stdout] | [INFO] [stdout] 145 | return Ok(decoded_packets); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 145 - return Ok(decoded_packets); [INFO] [stdout] 145 + Ok(decoded_packets) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/network.rs:108:56 [INFO] [stdout] | [INFO] [stdout] 108 | let recv_nonce = match bincode::deserialize::(&recv_nonce){ [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `recv_nonce` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/network.rs:127:45 [INFO] [stdout] | [INFO] [stdout] 127 | let deciphered = match cipher.decrypt(&nonce_formatted, data_to_decode.as_ref()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `nonce_formatted` [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 `return` statement [INFO] [stdout] --> src/network.rs:201:3 [INFO] [stdout] | [INFO] [stdout] 201 | return server_ip [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 201 - return server_ip [INFO] [stdout] 201 + server_ip [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/game.rs:22:3 [INFO] [stdout] | [INFO] [stdout] 22 | return 3; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 22 - return 3; [INFO] [stdout] 22 + 3 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (13/7) [INFO] [stdout] --> src/game.rs:29:1 [INFO] [stdout] | [INFO] [stdout] 29 | pub async fn game(server_ip: String, cha...bool, game_id: u128, settings_tabs: &mut ui::Tabs) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/game.rs:155:9 [INFO] [stdout] | [INFO] [stdout] 155 | let new_settings = main_settings.lock().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/game.rs:759:18 [INFO] [stdout] | [INFO] [stdout] 759 | next_frame().await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] = note: `#[warn(clippy::await_holding_lock)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/game.rs:177:9 [INFO] [stdout] | [INFO] [stdout] 177 | let killall: MutexGuard = kill_all_threads.lock().unwrap(); [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/game.rs:759:18 [INFO] [stdout] | [INFO] [stdout] 759 | next_frame().await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/game.rs:213:9 [INFO] [stdout] | [INFO] [stdout] 213 | let mut game_objects: MutexGuard> = game_objects.lock().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/game.rs:759:18 [INFO] [stdout] | [INFO] [stdout] 759 | next_frame().await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/game.rs:214:9 [INFO] [stdout] | [INFO] [stdout] 214 | let mut other_players: MutexGuard> = other_players.lock().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/game.rs:759:18 [INFO] [stdout] | [INFO] [stdout] 759 | next_frame().await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/game.rs:215:9 [INFO] [stdout] | [INFO] [stdout] 215 | let mut player: MutexGuard = player.lock().unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/game.rs:759:18 [INFO] [stdout] | [INFO] [stdout] 759 | next_frame().await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/game.rs:323:9 [INFO] [stdout] | [INFO] [stdout] 323 | let keyboard_mode: MutexGuard = keyboard_mode.lock().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/game.rs:759:18 [INFO] [stdout] | [INFO] [stdout] 759 | next_frame().await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/game.rs:559:9 [INFO] [stdout] | [INFO] [stdout] 559 | let gamemode_info_main = gamemode_info.lock().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/game.rs:759:18 [INFO] [stdout] | [INFO] [stdout] 759 | next_frame().await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/game.rs:89:20 [INFO] [stdout] | [INFO] [stdout] 89 | let sound_queue: Arc>> = Arc::new(Mutex::new(sound_queue)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/game.rs:345:5 [INFO] [stdout] | [INFO] [stdout] 345 | / if player.camera.zoom < 0.5 { [INFO] [stdout] 346 | | player.camera.zoom = 0.5 [INFO] [stdout] 347 | | } [INFO] [stdout] 348 | | if player.camera.zoom > 2.0 { [INFO] [stdout] 349 | | player.camera.zoom = 2.0 [INFO] [stdout] 350 | | } [INFO] [stdout] | |_____^ help: replace with clamp: `player.camera.zoom = player.camera.zoom.clamp(0.5, 2.0);` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `PlayerStatistics` [INFO] [stdout] --> src/mothership_common.rs:91:3 [INFO] [stdout] | [INFO] [stdout] 91 | / pub fn new() -> PlayerStatistics { [INFO] [stdout] 92 | | return PlayerStatistics { [INFO] [stdout] 93 | | wins: 0, [INFO] [stdout] 94 | | }; [INFO] [stdout] 95 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 90 + impl Default for PlayerStatistics { [INFO] [stdout] 91 + fn default() -> Self { [INFO] [stdout] 92 + Self::new() [INFO] [stdout] 93 + } [INFO] [stdout] 94 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/mothership_common.rs:92:5 [INFO] [stdout] | [INFO] [stdout] 92 | / return PlayerStatistics { [INFO] [stdout] 93 | | wins: 0, [INFO] [stdout] 94 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 92 ~ PlayerStatistics { [INFO] [stdout] 93 + wins: 0, [INFO] [stdout] 94 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:222:7 [INFO] [stdout] | [INFO] [stdout] 222 | / match game_object.get_bullet_data_safe() { [INFO] [stdout] 223 | | Ok(bullet_data) => { [INFO] [stdout] 224 | | let speed: f32 = match game_object.object_type { [INFO] [stdout] 225 | | GameObjectType::RaphaelleBullet => character_properties[&Character::Raphaelle].primary_shot_speed, [INFO] [stdout] ... | [INFO] [stdout] 242 | | Err(()) => {} [INFO] [stdout] 243 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 222 ~ if let Ok(bullet_data) = game_object.get_bullet_data_safe() { [INFO] [stdout] 223 + let speed: f32 = match game_object.object_type { [INFO] [stdout] 224 + GameObjectType::RaphaelleBullet => character_properties[&Character::Raphaelle].primary_shot_speed, [INFO] [stdout] 225 + GameObjectType::RaphaelleBulletEmpowered => character_properties[&Character::Raphaelle].primary_shot_speed, [INFO] [stdout] 226 + GameObjectType::HernaniBullet => character_properties[&Character::Hernani].primary_shot_speed, [INFO] [stdout] 227 + GameObjectType::CynewynnSword => character_properties[&Character::Cynewynn].primary_shot_speed, [INFO] [stdout] 228 + GameObjectType::ElizabethProjectileRicochet => character_properties[&Character::Elizabeth].primary_shot_speed, [INFO] [stdout] 229 + GameObjectType::ElizabethProjectileGroundRecalled => character_properties[&Character::Elizabeth].primary_shot_speed, [INFO] [stdout] 230 + GameObjectType::WiroGunShot => character_properties[&Character::Wiro].primary_shot_speed, [INFO] [stdout] 231 + GameObjectType::TemerityRocket => character_properties[&Character::Temerity].primary_shot_speed, [INFO] [stdout] 232 + GameObjectType::KoldoCannonBall => character_properties[&Character::Koldo].primary_shot_speed, [INFO] [stdout] 233 + GameObjectType::KoldoCannonBallEmpowered => character_properties[&Character::Koldo].primary_shot_speed, [INFO] [stdout] 234 + GameObjectType::KoldoCannonBallEmpoweredUltimate => character_properties[&Character::Koldo].primary_shot_speed, [INFO] [stdout] 235 + _ => 0.0, [INFO] [stdout] 236 + }; [INFO] [stdout] 237 + [INFO] [stdout] 238 + game_object.position.x += speed * bullet_data.direction.x * get_frame_time(); [INFO] [stdout] 239 + game_object.position.y += speed * bullet_data.direction.y * get_frame_time(); [INFO] [stdout] 240 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Vec2` which implements the `Copy` trait [INFO] [stdout] --> src/game.rs:324:52 [INFO] [stdout] | [INFO] [stdout] 324 | let mut aim_direction: Vector2 = Vector2::from(mouse_position.clone()) - player_copy.position; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `mouse_position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `game_object_index` is only used to index `game_objects_copy` [INFO] [stdout] --> src/game.rs:369:30 [INFO] [stdout] | [INFO] [stdout] 369 | for game_object_index in 0..game_objects_copy.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 [INFO] [stdout] | [INFO] [stdout] 369 - for game_object_index in 0..game_objects_copy.len() { [INFO] [stdout] 369 + for in &mut game_objects_copy { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/game.rs:454:5 [INFO] [stdout] | [INFO] [stdout] 454 | / if player_copy.character == Character::Koldo { [INFO] [stdout] 455 | | if player_copy.passive_elapsed > character_properties[&Character::Koldo].passive_cooldown [INFO] [stdout] 456 | | || player_copy.stacks > 0 { [INFO] [stdout] 457 | | range = character_properties[&Character::Koldo].primary_range_2 * player_copy.camera.zoom; [INFO] [stdout] 458 | | } [INFO] [stdout] 459 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 454 ~ if player_copy.character == Character::Koldo [INFO] [stdout] 455 ~ && (player_copy.passive_elapsed > character_properties[&Character::Koldo].passive_cooldown [INFO] [stdout] 456 ~ || player_copy.stacks > 0) { [INFO] [stdout] 457 | range = character_properties[&Character::Koldo].primary_range_2 * player_copy.camera.zoom; [INFO] [stdout] 458 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Vec2` which implements the `Copy` trait [INFO] [stdout] --> src/game.rs:464:90 [INFO] [stdout] | [INFO] [stdout] 464 | ...y.position, Vector2::from(mouse_position.clone())) * player_copy.camera.zoom; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `mouse_position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/game.rs:532:14 [INFO] [stdout] | [INFO] [stdout] 532 | && (player.is_dead & player_2.is_dead) == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(player.is_dead & player_2.is_dead)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/game.rs:601:5 [INFO] [stdout] | [INFO] [stdout] 601 | / if character == Character::Wiro { [INFO] [stdout] 602 | | if player_copy.last_secondary_time < character_properties[&Character::Wiro].secondary_cooldown { [INFO] [stdout] 603 | | secondary_cooldown = player_copy.last_secondary_time / character_properties[&Character::Wiro].secondary_cooldown; [INFO] [stdout] 604 | | } [INFO] [stdout] 605 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 601 ~ if character == Character::Wiro [INFO] [stdout] 602 ~ && player_copy.last_secondary_time < character_properties[&Character::Wiro].secondary_cooldown { [INFO] [stdout] 603 | secondary_cooldown = player_copy.last_secondary_time / character_properties[&Character::Wiro].secondary_cooldown; [INFO] [stdout] 604 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: large size difference between variants [INFO] [stdout] --> src/mothership_common.rs:185:1 [INFO] [stdout] | [INFO] [stdout] 185 | / pub enum PlayerMessage { [INFO] [stdout] 186 | | /// This thread must stop now. [INFO] [stdout] 187 | | ForceDisconnect, [INFO] [stdout] | | --------------- the second-largest variant carries no data at all [INFO] [stdout] 188 | | SendPacket(ServerToClientPacket), [INFO] [stdout] | | -------------------------------- the largest variant contains at least 592 bytes [INFO] [stdout] 189 | | } [INFO] [stdout] | |_^ the entire enum is at least 592 bytes [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant [INFO] [stdout] help: consider boxing the large fields or introducing indirection in some other way to reduce the total size of the enum [INFO] [stdout] | [INFO] [stdout] 188 - SendPacket(ServerToClientPacket), [INFO] [stdout] 188 + SendPacket(Box), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/game.rs:642:17 [INFO] [stdout] | [INFO] [stdout] 642 | draw_text(format!("Not connected to server").as_str(), 20.0, 80.0, 40.0, RED); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Not connected to server".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/database.rs:14:59 [INFO] [stdout] | [INFO] [stdout] 14 | pub fn get_player(database: &Database, username: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 160 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `redb::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] = note: `#[warn(clippy::result_large_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | return Ok(data); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 22 - return Ok(data); [INFO] [stdout] 22 + Ok(data) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | return Err(redb::Error::PreviousIo); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 26 - return Err(redb::Error::PreviousIo); [INFO] [stdout] 26 + Err(redb::Error::PreviousIo) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | return Err(redb::Error::PreviousIo); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 30 - return Err(redb::Error::PreviousIo); [INFO] [stdout] 30 + Err(redb::Error::PreviousIo) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:682:121 [INFO] [stdout] | [INFO] [stdout] 682 | ...en].to_vec(), cipher_key.clone(), &mut main_last_nonce); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `main_last_nonce` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/game.rs:703:17 [INFO] [stdout] | [INFO] [stdout] 703 | / if data.game_id == game_id { [INFO] [stdout] 704 | | game_ended = true; [INFO] [stdout] 705 | | // wait a bit to give the player time to process what happened. [INFO] [stdout] 706 | | game_ended_timer = Instant::now(); [INFO] [stdout] 707 | | winning_team = data.winning_team; [INFO] [stdout] 708 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 701 ~ ServerToClient::MatchEnded(data) [INFO] [stdout] 702 | // make sure that this game end packet is indeed from this game, and not another one. [INFO] [stdout] 703 ~ if data.game_id == game_id => { [INFO] [stdout] 704 | game_ended = true; [INFO] [stdout] ... [INFO] [stdout] 707 | winning_team = data.winning_team; [INFO] [stdout] 708 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/database.rs:36:91 [INFO] [stdout] | [INFO] [stdout] 36 | pub fn create_player(database: &mut Database, username: &str, player_data: PlayerData) -> Result<(), Error>{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 160 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `redb::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:53:3 [INFO] [stdout] | [INFO] [stdout] 53 | return Ok(()); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 53 - return Ok(()); [INFO] [stdout] 53 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/database.rs:56:63 [INFO] [stdout] | [INFO] [stdout] 56 | pub fn username_taken(database: &Database, username: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 160 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `redb::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:65:3 [INFO] [stdout] | [INFO] [stdout] 65 | return Ok(taken); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 65 - return Ok(taken); [INFO] [stdout] 65 + Ok(taken) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/game.rs:771:410 [INFO] [stdout] | [INFO] [stdout] 771 | ...ex>, server_ip: String, sound_queue: Arc>>, settings: Arc>) -> () { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/database.rs:71:18 [INFO] [stdout] | [INFO] [stdout] 71 | pub fn load() -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 160 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `redb::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:74:3 [INFO] [stdout] | [INFO] [stdout] 74 | return Ok(database); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 74 - return Ok(database); [INFO] [stdout] 74 + Ok(database) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (14/7) [INFO] [stdout] --> src/game.rs:771:1 [INFO] [stdout] | [INFO] [stdout] 771 | fn input_listener_network_sender(playe...ck, f32)>>>, settings: Arc>) -> () { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/game.rs:771:484 [INFO] [stdout] | [INFO] [stdout] 771 | ...oTrack, f32)>>>, settings: Arc>) -> () { [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: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/database.rs:77:31 [INFO] [stdout] | [INFO] [stdout] 77 | pub fn load_server_setup() -> Result, Error> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 160 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `redb::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:97:5 [INFO] [stdout] | [INFO] [stdout] 97 | return Ok(server_setup); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 97 - return Ok(server_setup); [INFO] [stdout] 97 + Ok(server_setup) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:105:5 [INFO] [stdout] | [INFO] [stdout] 105 | return Ok(server_setup); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 105 - return Ok(server_setup); [INFO] [stdout] 105 + Ok(server_setup) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/database.rs:78:3 [INFO] [stdout] | [INFO] [stdout] 78 | let file_exists: bool; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `file_exists` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 78 ~ [INFO] [stdout] 79 ~ let file_exists: bool = match fs::exists(SERVER_SETUP_LOCATION) { [INFO] [stdout] 80 | Ok(exists) => { [INFO] [stdout] 81 ~ exists [INFO] [stdout] 82 | } [INFO] [stdout] 83 | Err(_err) => { [INFO] [stdout] 84 ~ false [INFO] [stdout] 85 | } [INFO] [stdout] 86 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:846:60 [INFO] [stdout] | [INFO] [stdout] 846 | let recv_nonce = match bincode::deserialize::(&recv_nonce){ [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `recv_nonce` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:860:44 [INFO] [stdout] | [INFO] [stdout] 860 | let key = GenericArray::from_slice(&key.as_slice()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `key.as_slice()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:863:47 [INFO] [stdout] | [INFO] [stdout] 863 | let deciphered = match cipher.decrypt(&formatted_nonce, data[4..].as_ref()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `formatted_nonce` [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 `return` statement [INFO] [stdout] --> src/database.rs:119:5 [INFO] [stdout] | [INFO] [stdout] 119 | / return PlayerData { [INFO] [stdout] 120 | | password_hash, [INFO] [stdout] 121 | | wins: 0, [INFO] [stdout] 122 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 119 ~ PlayerData { [INFO] [stdout] 120 + password_hash, [INFO] [stdout] 121 + wins: 0, [INFO] [stdout] 122 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:134:5 [INFO] [stdout] | [INFO] [stdout] 134 | return format!("{}:{}", username_b, username_a); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 134 - return format!("{}:{}", username_b, username_a); [INFO] [stdout] 134 + format!("{}:{}", username_b, username_a) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:136:5 [INFO] [stdout] | [INFO] [stdout] 136 | return format!("{}:{}", username_a, username_b); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 136 - return format!("{}:{}", username_a, username_b); [INFO] [stdout] 136 + format!("{}:{}", username_a, username_b) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/game.rs:1008:11 [INFO] [stdout] | [INFO] [stdout] 1008 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1008 - return false; [INFO] [stdout] 1008 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:1072:7 [INFO] [stdout] | [INFO] [stdout] 1072 | / match gamepad.axis_data(Axis::RightStickX) { [INFO] [stdout] 1073 | | Some(axis_data) => { [INFO] [stdout] 1074 | | aim_vector.x = axis_data.value(); [INFO] [stdout] 1075 | | } _ => {} [INFO] [stdout] 1076 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1072 ~ if let Some(axis_data) = gamepad.axis_data(Axis::RightStickX) { [INFO] [stdout] 1073 + aim_vector.x = axis_data.value(); [INFO] [stdout] 1074 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:1077:7 [INFO] [stdout] | [INFO] [stdout] 1077 | / match gamepad.axis_data(Axis::RightStickY) { [INFO] [stdout] 1078 | | Some(axis_data) => { [INFO] [stdout] 1079 | | aim_vector.y = -axis_data.value(); [INFO] [stdout] 1080 | | } _ => {} [INFO] [stdout] 1081 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1077 ~ if let Some(axis_data) = gamepad.axis_data(Axis::RightStickY) { [INFO] [stdout] 1078 + aim_vector.y = -axis_data.value(); [INFO] [stdout] 1079 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:1084:7 [INFO] [stdout] | [INFO] [stdout] 1084 | / match gamepad.axis_data(Axis::LeftStickX) { [INFO] [stdout] 1085 | | Some(axis_data) => { [INFO] [stdout] 1086 | | // crazy rounding shenanigans to round to closest multiple of 0.2 [INFO] [stdout] 1087 | | movement_vector.x = ((axis_data.value() * 5.0).round() as i32) as f32 / 5.0; [INFO] [stdout] 1088 | | } _ => {} [INFO] [stdout] 1089 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1084 ~ if let Some(axis_data) = gamepad.axis_data(Axis::LeftStickX) { [INFO] [stdout] 1085 + // crazy rounding shenanigans to round to closest multiple of 0.2 [INFO] [stdout] 1086 + movement_vector.x = ((axis_data.value() * 5.0).round() as i32) as f32 / 5.0; [INFO] [stdout] 1087 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:1090:7 [INFO] [stdout] | [INFO] [stdout] 1090 | / match gamepad.axis_data(Axis::LeftStickY) { [INFO] [stdout] 1091 | | Some(axis_data) => { [INFO] [stdout] 1092 | | movement_vector.y = ((-axis_data.value() * 5.0).round() as i32) as f32 / 5.0; [INFO] [stdout] ... | [INFO] [stdout] 1095 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1090 ~ if let Some(axis_data) = gamepad.axis_data(Axis::LeftStickY) { [INFO] [stdout] 1091 + movement_vector.y = ((-axis_data.value() * 5.0).round() as i32) as f32 / 5.0; [INFO] [stdout] 1092 + // println!("{}", axis_data.value()); [INFO] [stdout] 1093 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:1098:7 [INFO] [stdout] | [INFO] [stdout] 1098 | / match gamepad.button_data(Button::RightTrigger2) { [INFO] [stdout] 1099 | | Some(button_data) => { [INFO] [stdout] 1100 | | if button_data.value() > 0.2 { [INFO] [stdout] 1101 | | shooting_primary = true; [INFO] [stdout] ... | [INFO] [stdout] 1106 | | } _ => {} [INFO] [stdout] 1107 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1098 ~ if let Some(button_data) = gamepad.button_data(Button::RightTrigger2) { [INFO] [stdout] 1099 + if button_data.value() > 0.2 { [INFO] [stdout] 1100 + shooting_primary = true; [INFO] [stdout] 1101 + keyboard_mode = false; [INFO] [stdout] 1102 + } else { [INFO] [stdout] 1103 + shooting_primary = false; [INFO] [stdout] 1104 + } [INFO] [stdout] 1105 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:1108:7 [INFO] [stdout] | [INFO] [stdout] 1108 | / match gamepad.button_data(Button::LeftTrigger2) { [INFO] [stdout] 1109 | | Some(button_data) => { [INFO] [stdout] 1110 | | if button_data.value() > 0.2 { [INFO] [stdout] 1111 | | shooting_secondary = true; [INFO] [stdout] ... | [INFO] [stdout] 1116 | | } _ => {} [INFO] [stdout] 1117 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1108 ~ if let Some(button_data) = gamepad.button_data(Button::LeftTrigger2) { [INFO] [stdout] 1109 + if button_data.value() > 0.2 { [INFO] [stdout] 1110 + shooting_secondary = true; [INFO] [stdout] 1111 + keyboard_mode = false; [INFO] [stdout] 1112 + } else { [INFO] [stdout] 1113 + shooting_secondary = false; [INFO] [stdout] 1114 + } [INFO] [stdout] 1115 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:152:5 [INFO] [stdout] | [INFO] [stdout] 152 | / return match num { [INFO] [stdout] 153 | | 0 => FriendShipStatus::Friends, [INFO] [stdout] 154 | | 1 => FriendShipStatus::PendingForA, [INFO] [stdout] 155 | | 2 => FriendShipStatus::PendingForB, [INFO] [stdout] 156 | | _ => FriendShipStatus::Blocked, [INFO] [stdout] 157 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 152 ~ match num { [INFO] [stdout] 153 + 0 => FriendShipStatus::Friends, [INFO] [stdout] 154 + 1 => FriendShipStatus::PendingForA, [INFO] [stdout] 155 + 2 => FriendShipStatus::PendingForB, [INFO] [stdout] 156 + _ => FriendShipStatus::Blocked, [INFO] [stdout] 157 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:162:5 [INFO] [stdout] | [INFO] [stdout] 162 | return FriendShipStatus::PendingForA; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 162 - return FriendShipStatus::PendingForA; [INFO] [stdout] 162 + FriendShipStatus::PendingForA [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:164:5 [INFO] [stdout] | [INFO] [stdout] 164 | return FriendShipStatus:: PendingForB; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 164 - return FriendShipStatus:: PendingForB; [INFO] [stdout] 164 + FriendShipStatus:: PendingForB [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/database.rs:168:123 [INFO] [stdout] | [INFO] [stdout] 168 | ...dship_status: FriendShipStatus) -> Result<(), Error> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 160 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `redb::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:177:3 [INFO] [stdout] | [INFO] [stdout] 177 | return Ok(()); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 177 - return Ok(()); [INFO] [stdout] 177 + Ok(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/game.rs:1120:11 [INFO] [stdout] | [INFO] [stdout] 1120 | / if button_data.value() > 0.0 { [INFO] [stdout] 1121 | | dashing = true; [INFO] [stdout] 1122 | | keyboard_mode = false; [INFO] [stdout] 1123 | | } [INFO] [stdout] | |___________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1119 ~ Some(button_data) [INFO] [stdout] 1120 ~ if button_data.value() > 0.0 => { [INFO] [stdout] 1121 | dashing = true; [INFO] [stdout] 1122 | keyboard_mode = false; [INFO] [stdout] 1123 ~ } _ => {} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:1118:7 [INFO] [stdout] | [INFO] [stdout] 1118 | / match gamepad.button_data(Button::South) { [INFO] [stdout] 1119 | | Some(button_data) => { [INFO] [stdout] 1120 | | if button_data.value() > 0.0 { [INFO] [stdout] 1121 | | dashing = true; [INFO] [stdout] ... | [INFO] [stdout] 1124 | | } _ => {} [INFO] [stdout] 1125 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1118 ~ if let Some(button_data) = gamepad.button_data(Button::South) { [INFO] [stdout] 1119 + if button_data.value() > 0.0 { [INFO] [stdout] 1120 + dashing = true; [INFO] [stdout] 1121 + keyboard_mode = false; [INFO] [stdout] 1122 + } [INFO] [stdout] 1123 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/database.rs:180:86 [INFO] [stdout] | [INFO] [stdout] 180 | pub fn get_friend_status(database: &Database, username_a: &str, username_b: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 160 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `redb::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/game.rs:1128:11 [INFO] [stdout] | [INFO] [stdout] 1128 | / if button_data.value() > 0.0 { [INFO] [stdout] 1129 | | dashing = true; [INFO] [stdout] 1130 | | keyboard_mode = false; [INFO] [stdout] 1131 | | } [INFO] [stdout] | |___________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1127 ~ Some(button_data) [INFO] [stdout] 1128 ~ if button_data.value() > 0.0 => { [INFO] [stdout] 1129 | dashing = true; [INFO] [stdout] 1130 | keyboard_mode = false; [INFO] [stdout] 1131 ~ } _ => {} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:203:3 [INFO] [stdout] | [INFO] [stdout] 203 | return Err(Error::Corrupted(String::from("norelation"))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 203 - return Err(Error::Corrupted(String::from("norelation"))); [INFO] [stdout] 203 + Err(Error::Corrupted(String::from("norelation"))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:1126:7 [INFO] [stdout] | [INFO] [stdout] 1126 | / match gamepad.button_data(Button::LeftTrigger) { [INFO] [stdout] 1127 | | Some(button_data) => { [INFO] [stdout] 1128 | | if button_data.value() > 0.0 { [INFO] [stdout] 1129 | | dashing = true; [INFO] [stdout] ... | [INFO] [stdout] 1132 | | } _ => {} [INFO] [stdout] 1133 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1126 ~ if let Some(button_data) = gamepad.button_data(Button::LeftTrigger) { [INFO] [stdout] 1127 + if button_data.value() > 0.0 { [INFO] [stdout] 1128 + dashing = true; [INFO] [stdout] 1129 + keyboard_mode = false; [INFO] [stdout] 1130 + } [INFO] [stdout] 1131 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the `Err`-variant returned from this function is very large [INFO] [stdout] --> src/database.rs:206:64 [INFO] [stdout] | [INFO] [stdout] 206 | pub fn get_status_list(database: &Database, username: &str) -> Result, Error> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 160 bytes [INFO] [stdout] | [INFO] [stdout] = help: try reducing the size of `redb::Error`, for example by boxing large elements or replacing it with `Box` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_large_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:223:3 [INFO] [stdout] | [INFO] [stdout] 223 | return Ok(friendship_statuses); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 223 - return Ok(friendship_statuses); [INFO] [stdout] 223 + Ok(friendship_statuses) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/database.rs:238:3 [INFO] [stdout] | [INFO] [stdout] 238 | return peer_username.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 238 - return peer_username.to_string(); [INFO] [stdout] 238 + peer_username.to_string() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/database.rs:231:3 [INFO] [stdout] | [INFO] [stdout] 231 | let peer_username; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `peer_username` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 231 ~ [INFO] [stdout] 232 | let split: Vec<&str> = friend_couple.split(":").collect(); [INFO] [stdout] 233 ~ let peer_username = if *split[0] == *username { [INFO] [stdout] 234 ~ split[1] [INFO] [stdout] 235 | } else { [INFO] [stdout] 236 ~ split[0] [INFO] [stdout] 237 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/filter.rs:7:3 [INFO] [stdout] | [INFO] [stdout] 7 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 7 - return true; [INFO] [stdout] 7 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/filter.rs:22:3 [INFO] [stdout] | [INFO] [stdout] 22 | return true; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 22 - return true; [INFO] [stdout] 22 + true [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/game.rs:1225:7 [INFO] [stdout] | [INFO] [stdout] 1225 | let speed: Vector2; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `speed` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 1225 ~ [INFO] [stdout] 1226 ~ let speed: Vector2 = if distance.magnitude() == 0.0 { [INFO] [stdout] 1227 | // this is only true on the first "frame". [INFO] [stdout] 1228 | // this measure helps reduce the percieved lag from the character standing still [INFO] [stdout] 1229 | // before it obtains its second interpolation position. [INFO] [stdout] 1230 ~ player.movement_direction * (character_properties[&player.character].dash_speed / 2.0) * delta_time [INFO] [stdout] 1231 | } else { [INFO] [stdout] 1232 | // this runs the rest of the time [INFO] [stdout] 1233 | let period = PACKET_INTERVAL; [INFO] [stdout] 1234 ~ distance / period [INFO] [stdout] 1235 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/game.rs:1239:7 [INFO] [stdout] | [INFO] [stdout] 1239 | / if dashing && !player.is_dashing && !player.is_dead && movement_vector_raw.magnitude() != 0.0 { [INFO] [stdout] 1240 | | if player.time_since_last_dash > character_properties[&player.character].dash_cooldown { [INFO] [stdout] 1241 | | match player.character { [INFO] [stdout] 1242 | | Character::Temerity => { [INFO] [stdout] ... | [INFO] [stdout] 1249 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1239 ~ if dashing && !player.is_dashing && !player.is_dead && movement_vector_raw.magnitude() != 0.0 [INFO] [stdout] 1240 ~ && player.time_since_last_dash > character_properties[&player.character].dash_cooldown { [INFO] [stdout] 1241 | match player.character { [INFO] [stdout] ... [INFO] [stdout] 1247 | } [INFO] [stdout] 1248 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/network.rs:27:3 [INFO] [stdout] | [INFO] [stdout] 27 | return Ok(encoded_packet); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 27 - return Ok(encoded_packet); [INFO] [stdout] 27 + Ok(encoded_packet) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/network.rs:57:3 [INFO] [stdout] | [INFO] [stdout] 57 | return Ok(encoded_packet); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 57 - return Ok(encoded_packet); [INFO] [stdout] 57 + Ok(encoded_packet) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/network.rs:44:38 [INFO] [stdout] | [INFO] [stdout] 44 | let cipher = ChaCha20Poly1305::new(&key); [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/network.rs:47:33 [INFO] [stdout] | [INFO] [stdout] 47 | let ciphered = cipher.encrypt(&formatted_nonce, serialized_packet.as_ref()).expect("shit"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `formatted_nonce` [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 `return` statement [INFO] [stdout] --> src/network.rs:86:3 [INFO] [stdout] | [INFO] [stdout] 86 | return Ok(decoded_packets); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 86 - return Ok(decoded_packets); [INFO] [stdout] 86 + Ok(decoded_packets) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/game.rs:1284:10 [INFO] [stdout] | [INFO] [stdout] 1284 | if player.is_dead == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!player.is_dead` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:1332:42 [INFO] [stdout] | [INFO] [stdout] 1332 | let cipher = ChaCha20Poly1305::new(&key); [INFO] [stdout] | ^^^^ help: change this to: `key` [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 `return` statement [INFO] [stdout] --> src/network.rs:145:3 [INFO] [stdout] | [INFO] [stdout] 145 | return Ok(decoded_packets); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 145 - return Ok(decoded_packets); [INFO] [stdout] 145 + Ok(decoded_packets) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:1333:37 [INFO] [stdout] | [INFO] [stdout] 1333 | let ciphered = cipher.encrypt(&formatted_nonce, serialized_packet.as_ref()).expect("shit"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `formatted_nonce` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/network.rs:108:56 [INFO] [stdout] | [INFO] [stdout] 108 | let recv_nonce = match bincode::deserialize::(&recv_nonce){ [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `recv_nonce` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/network.rs:127:45 [INFO] [stdout] | [INFO] [stdout] 127 | let deciphered = match cipher.decrypt(&nonce_formatted, data_to_decode.as_ref()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `nonce_formatted` [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 `return` statement [INFO] [stdout] --> src/network.rs:201:3 [INFO] [stdout] | [INFO] [stdout] 201 | return server_ip [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 201 - return server_ip [INFO] [stdout] 201 + server_ip [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/game.rs:1401:3 [INFO] [stdout] | [INFO] [stdout] 1401 | return tiles; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1401 - return tiles; [INFO] [stdout] 1401 + tiles [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/game.rs:1440:3 [INFO] [stdout] | [INFO] [stdout] 1440 | return [&sorted_objects_layer_1[0..sorted_objects_layer_1.len()], &sorted_objects_layer_2[0..sorted_objects_layer_2.len()]].concat(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1440 - return [&sorted_objects_layer_1[0..sorted_objects_layer_1.len()], &sorted_objects_layer_2[0..sorted_objects_layer_2.len()]].concat(); [INFO] [stdout] 1440 + [&sorted_objects_layer_1[0..sorted_objects_layer_1.len()], &sorted_objects_layer_2[0..sorted_objects_layer_2.len()]].concat() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `index` is used to index `unsorted_objects` [INFO] [stdout] --> src/game.rs:1418:18 [INFO] [stdout] | [INFO] [stdout] 1418 | for index in 0..unsorted_objects.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] 1418 - for index in 0..unsorted_objects.len() { [INFO] [stdout] 1418 + for (index, ) in unsorted_objects.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/gamedata.rs:189:11 [INFO] [stdout] | [INFO] [stdout] 189 | if !vec![BuffType::Impulse].contains(&buff.buff_type) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[BuffType::Impulse]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/gameserver.rs:446:18 [INFO] [stdout] | [INFO] [stdout] 446 | if vec![BuffType::Speed, BuffType::WiroSpeed].contains(&player.buffs[b_index].buff_type) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[BuffType::Speed, BuffType::WiroSpeed]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/game.rs:22:3 [INFO] [stdout] | [INFO] [stdout] 22 | return 3; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 22 - return 3; [INFO] [stdout] 22 + 3 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/game.rs:410:28 [INFO] [stdout] | [INFO] [stdout] 410 | let shaded_objects = vec![GameObjectType::RaphaelleBullet, [INFO] [stdout] | ____________________________^ [INFO] [stdout] 411 | | GameObjectType::RaphaelleBulletEmpowered, [INFO] [stdout] 412 | | GameObjectType::HernaniBullet, [INFO] [stdout] 413 | | GameObjectType::CynewynnSword, [INFO] [stdout] 414 | | GameObjectType::CenterOrb, [INFO] [stdout] 415 | | GameObjectType::ElizabethProjectileRicochet, [INFO] [stdout] 416 | | ]; [INFO] [stdout] | |_____________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 410 ~ let shaded_objects = [GameObjectType::RaphaelleBullet, [INFO] [stdout] 411 + GameObjectType::RaphaelleBulletEmpowered, [INFO] [stdout] 412 + GameObjectType::HernaniBullet, [INFO] [stdout] 413 + GameObjectType::CynewynnSword, [INFO] [stdout] 414 + GameObjectType::CenterOrb, [INFO] [stdout] 415 ~ GameObjectType::ElizabethProjectileRicochet]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (13/7) [INFO] [stdout] --> src/game.rs:29:1 [INFO] [stdout] | [INFO] [stdout] 29 | pub async fn game(server_ip: String, cha...bool, game_id: u128, settings_tabs: &mut ui::Tabs) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/game.rs:1269:12 [INFO] [stdout] | [INFO] [stdout] 1269 | if vec![BuffType::Speed, BuffType::WiroSpeed].contains(&buff.buff_type) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[BuffType::Speed, BuffType::WiroSpeed]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/game.rs:1368:22 [INFO] [stdout] | [INFO] [stdout] 1368 | let bright_tiles = vec![GameObjectType::Grass1Bright, [INFO] [stdout] | ______________________^ [INFO] [stdout] 1369 | | GameObjectType::Grass2Bright, [INFO] [stdout] 1370 | | GameObjectType::Grass3Bright, [INFO] [stdout] 1371 | | GameObjectType::Grass4Bright, [INFO] [stdout] 1372 | | GameObjectType::Grass5Bright, [INFO] [stdout] 1373 | | GameObjectType::Grass6Bright, [INFO] [stdout] 1374 | | GameObjectType::Grass7Bright, ]; [INFO] [stdout] | |______________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 1368 ~ let bright_tiles = [GameObjectType::Grass1Bright, [INFO] [stdout] 1369 + GameObjectType::Grass2Bright, [INFO] [stdout] 1370 + GameObjectType::Grass3Bright, [INFO] [stdout] 1371 + GameObjectType::Grass4Bright, [INFO] [stdout] 1372 + GameObjectType::Grass5Bright, [INFO] [stdout] 1373 + GameObjectType::Grass6Bright, [INFO] [stdout] 1374 ~ GameObjectType::Grass7Bright]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/game.rs:1375:20 [INFO] [stdout] | [INFO] [stdout] 1375 | let dark_tiles = vec![GameObjectType::Grass1, [INFO] [stdout] | ____________________^ [INFO] [stdout] 1376 | | GameObjectType::Grass2, [INFO] [stdout] 1377 | | GameObjectType::Grass3, [INFO] [stdout] 1378 | | GameObjectType::Grass4, [INFO] [stdout] 1379 | | GameObjectType::Grass5, [INFO] [stdout] 1380 | | GameObjectType::Grass6, [INFO] [stdout] 1381 | | GameObjectType::Grass7, ]; [INFO] [stdout] | |________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 1375 ~ let dark_tiles = [GameObjectType::Grass1, [INFO] [stdout] 1376 + GameObjectType::Grass2, [INFO] [stdout] 1377 + GameObjectType::Grass3, [INFO] [stdout] 1378 + GameObjectType::Grass4, [INFO] [stdout] 1379 + GameObjectType::Grass5, [INFO] [stdout] 1380 + GameObjectType::Grass6, [INFO] [stdout] 1381 ~ GameObjectType::Grass7]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/game.rs:155:9 [INFO] [stdout] | [INFO] [stdout] 155 | let new_settings = main_settings.lock().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/game.rs:759:18 [INFO] [stdout] | [INFO] [stdout] 759 | next_frame().await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] = note: `#[warn(clippy::await_holding_lock)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/game.rs:177:9 [INFO] [stdout] | [INFO] [stdout] 177 | let killall: MutexGuard = kill_all_threads.lock().unwrap(); [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/game.rs:759:18 [INFO] [stdout] | [INFO] [stdout] 759 | next_frame().await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/game.rs:213:9 [INFO] [stdout] | [INFO] [stdout] 213 | let mut game_objects: MutexGuard> = game_objects.lock().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/game.rs:759:18 [INFO] [stdout] | [INFO] [stdout] 759 | next_frame().await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/game.rs:214:9 [INFO] [stdout] | [INFO] [stdout] 214 | let mut other_players: MutexGuard> = other_players.lock().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/game.rs:759:18 [INFO] [stdout] | [INFO] [stdout] 759 | next_frame().await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/game.rs:215:9 [INFO] [stdout] | [INFO] [stdout] 215 | let mut player: MutexGuard = player.lock().unwrap(); [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/game.rs:759:18 [INFO] [stdout] | [INFO] [stdout] 759 | next_frame().await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/game.rs:323:9 [INFO] [stdout] | [INFO] [stdout] 323 | let keyboard_mode: MutexGuard = keyboard_mode.lock().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/game.rs:759:18 [INFO] [stdout] | [INFO] [stdout] 759 | next_frame().await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `MutexGuard` is held across an await point [INFO] [stdout] --> src/game.rs:559:9 [INFO] [stdout] | [INFO] [stdout] 559 | let gamemode_info_main = gamemode_info.lock().unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling `await` [INFO] [stdout] note: these are all the await points this lock is held through [INFO] [stdout] --> src/game.rs:759:18 [INFO] [stdout] | [INFO] [stdout] 759 | next_frame().await; [INFO] [stdout] | ^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/game.rs:89:20 [INFO] [stdout] | [INFO] [stdout] 89 | let sound_queue: Arc>> = Arc::new(Mutex::new(sound_queue)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: clamp-like pattern without using clamp function [INFO] [stdout] --> src/game.rs:345:5 [INFO] [stdout] | [INFO] [stdout] 345 | / if player.camera.zoom < 0.5 { [INFO] [stdout] 346 | | player.camera.zoom = 0.5 [INFO] [stdout] 347 | | } [INFO] [stdout] 348 | | if player.camera.zoom > 2.0 { [INFO] [stdout] 349 | | player.camera.zoom = 2.0 [INFO] [stdout] 350 | | } [INFO] [stdout] | |_____^ help: replace with clamp: `player.camera.zoom = player.camera.zoom.clamp(0.5, 2.0);` [INFO] [stdout] | [INFO] [stdout] = note: clamp will panic if max < min, min.is_nan(), or max.is_nan() [INFO] [stdout] = note: clamp returns NaN if the input is NaN [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_clamp [INFO] [stdout] = note: `#[warn(clippy::manual_clamp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:222:7 [INFO] [stdout] | [INFO] [stdout] 222 | / match game_object.get_bullet_data_safe() { [INFO] [stdout] 223 | | Ok(bullet_data) => { [INFO] [stdout] 224 | | let speed: f32 = match game_object.object_type { [INFO] [stdout] 225 | | GameObjectType::RaphaelleBullet => character_properties[&Character::Raphaelle].primary_shot_speed, [INFO] [stdout] ... | [INFO] [stdout] 242 | | Err(()) => {} [INFO] [stdout] 243 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 222 ~ if let Ok(bullet_data) = game_object.get_bullet_data_safe() { [INFO] [stdout] 223 + let speed: f32 = match game_object.object_type { [INFO] [stdout] 224 + GameObjectType::RaphaelleBullet => character_properties[&Character::Raphaelle].primary_shot_speed, [INFO] [stdout] 225 + GameObjectType::RaphaelleBulletEmpowered => character_properties[&Character::Raphaelle].primary_shot_speed, [INFO] [stdout] 226 + GameObjectType::HernaniBullet => character_properties[&Character::Hernani].primary_shot_speed, [INFO] [stdout] 227 + GameObjectType::CynewynnSword => character_properties[&Character::Cynewynn].primary_shot_speed, [INFO] [stdout] 228 + GameObjectType::ElizabethProjectileRicochet => character_properties[&Character::Elizabeth].primary_shot_speed, [INFO] [stdout] 229 + GameObjectType::ElizabethProjectileGroundRecalled => character_properties[&Character::Elizabeth].primary_shot_speed, [INFO] [stdout] 230 + GameObjectType::WiroGunShot => character_properties[&Character::Wiro].primary_shot_speed, [INFO] [stdout] 231 + GameObjectType::TemerityRocket => character_properties[&Character::Temerity].primary_shot_speed, [INFO] [stdout] 232 + GameObjectType::KoldoCannonBall => character_properties[&Character::Koldo].primary_shot_speed, [INFO] [stdout] 233 + GameObjectType::KoldoCannonBallEmpowered => character_properties[&Character::Koldo].primary_shot_speed, [INFO] [stdout] 234 + GameObjectType::KoldoCannonBallEmpoweredUltimate => character_properties[&Character::Koldo].primary_shot_speed, [INFO] [stdout] 235 + _ => 0.0, [INFO] [stdout] 236 + }; [INFO] [stdout] 237 + [INFO] [stdout] 238 + game_object.position.x += speed * bullet_data.direction.x * get_frame_time(); [INFO] [stdout] 239 + game_object.position.y += speed * bullet_data.direction.y * get_frame_time(); [INFO] [stdout] 240 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Vec2` which implements the `Copy` trait [INFO] [stdout] --> src/game.rs:324:52 [INFO] [stdout] | [INFO] [stdout] 324 | let mut aim_direction: Vector2 = Vector2::from(mouse_position.clone()) - player_copy.position; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `mouse_position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `game_object_index` is only used to index `game_objects_copy` [INFO] [stdout] --> src/game.rs:369:30 [INFO] [stdout] | [INFO] [stdout] 369 | for game_object_index in 0..game_objects_copy.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 [INFO] [stdout] | [INFO] [stdout] 369 - for game_object_index in 0..game_objects_copy.len() { [INFO] [stdout] 369 + for in &mut game_objects_copy { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/game.rs:454:5 [INFO] [stdout] | [INFO] [stdout] 454 | / if player_copy.character == Character::Koldo { [INFO] [stdout] 455 | | if player_copy.passive_elapsed > character_properties[&Character::Koldo].passive_cooldown [INFO] [stdout] 456 | | || player_copy.stacks > 0 { [INFO] [stdout] 457 | | range = character_properties[&Character::Koldo].primary_range_2 * player_copy.camera.zoom; [INFO] [stdout] 458 | | } [INFO] [stdout] 459 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 454 ~ if player_copy.character == Character::Koldo [INFO] [stdout] 455 ~ && (player_copy.passive_elapsed > character_properties[&Character::Koldo].passive_cooldown [INFO] [stdout] 456 ~ || player_copy.stacks > 0) { [INFO] [stdout] 457 | range = character_properties[&Character::Koldo].primary_range_2 * player_copy.camera.zoom; [INFO] [stdout] 458 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Vec2` which implements the `Copy` trait [INFO] [stdout] --> src/game.rs:464:90 [INFO] [stdout] | [INFO] [stdout] 464 | ...y.position, Vector2::from(mouse_position.clone())) * player_copy.camera.zoom; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `mouse_position` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/game.rs:532:14 [INFO] [stdout] | [INFO] [stdout] 532 | && (player.is_dead & player_2.is_dead) == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!(player.is_dead & player_2.is_dead)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/game.rs:601:5 [INFO] [stdout] | [INFO] [stdout] 601 | / if character == Character::Wiro { [INFO] [stdout] 602 | | if player_copy.last_secondary_time < character_properties[&Character::Wiro].secondary_cooldown { [INFO] [stdout] 603 | | secondary_cooldown = player_copy.last_secondary_time / character_properties[&Character::Wiro].secondary_cooldown; [INFO] [stdout] 604 | | } [INFO] [stdout] 605 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 601 ~ if character == Character::Wiro [INFO] [stdout] 602 ~ && player_copy.last_secondary_time < character_properties[&Character::Wiro].secondary_cooldown { [INFO] [stdout] 603 | secondary_cooldown = player_copy.last_secondary_time / character_properties[&Character::Wiro].secondary_cooldown; [INFO] [stdout] 604 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/game.rs:642:17 [INFO] [stdout] | [INFO] [stdout] 642 | draw_text(format!("Not connected to server").as_str(), 20.0, 80.0, 40.0, RED); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Not connected to server".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:682:121 [INFO] [stdout] | [INFO] [stdout] 682 | ...en].to_vec(), cipher_key.clone(), &mut main_last_nonce); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `main_last_nonce` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/game.rs:703:17 [INFO] [stdout] | [INFO] [stdout] 703 | / if data.game_id == game_id { [INFO] [stdout] 704 | | game_ended = true; [INFO] [stdout] 705 | | // wait a bit to give the player time to process what happened. [INFO] [stdout] 706 | | game_ended_timer = Instant::now(); [INFO] [stdout] 707 | | winning_team = data.winning_team; [INFO] [stdout] 708 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 701 ~ ServerToClient::MatchEnded(data) [INFO] [stdout] 702 | // make sure that this game end packet is indeed from this game, and not another one. [INFO] [stdout] 703 ~ if data.game_id == game_id => { [INFO] [stdout] 704 | game_ended = true; [INFO] [stdout] ... [INFO] [stdout] 707 | winning_team = data.winning_team; [INFO] [stdout] 708 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/game.rs:771:410 [INFO] [stdout] | [INFO] [stdout] 771 | ...ex>, server_ip: String, sound_queue: Arc>>, settings: Arc>) -> () { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (14/7) [INFO] [stdout] --> src/game.rs:771:1 [INFO] [stdout] | [INFO] [stdout] 771 | fn input_listener_network_sender(playe...ck, f32)>>>, settings: Arc>) -> () { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded unit return type [INFO] [stdout] --> src/game.rs:771:484 [INFO] [stdout] | [INFO] [stdout] 771 | ...oTrack, f32)>>>, settings: Arc>) -> () { [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:846:60 [INFO] [stdout] | [INFO] [stdout] 846 | let recv_nonce = match bincode::deserialize::(&recv_nonce){ [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `recv_nonce` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:860:44 [INFO] [stdout] | [INFO] [stdout] 860 | let key = GenericArray::from_slice(&key.as_slice()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `key.as_slice()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:863:47 [INFO] [stdout] | [INFO] [stdout] 863 | let deciphered = match cipher.decrypt(&formatted_nonce, data[4..].as_ref()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `formatted_nonce` [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 `return` statement [INFO] [stdout] --> src/game.rs:1008:11 [INFO] [stdout] | [INFO] [stdout] 1008 | return false; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1008 - return false; [INFO] [stdout] 1008 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:1072:7 [INFO] [stdout] | [INFO] [stdout] 1072 | / match gamepad.axis_data(Axis::RightStickX) { [INFO] [stdout] 1073 | | Some(axis_data) => { [INFO] [stdout] 1074 | | aim_vector.x = axis_data.value(); [INFO] [stdout] 1075 | | } _ => {} [INFO] [stdout] 1076 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1072 ~ if let Some(axis_data) = gamepad.axis_data(Axis::RightStickX) { [INFO] [stdout] 1073 + aim_vector.x = axis_data.value(); [INFO] [stdout] 1074 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:1077:7 [INFO] [stdout] | [INFO] [stdout] 1077 | / match gamepad.axis_data(Axis::RightStickY) { [INFO] [stdout] 1078 | | Some(axis_data) => { [INFO] [stdout] 1079 | | aim_vector.y = -axis_data.value(); [INFO] [stdout] 1080 | | } _ => {} [INFO] [stdout] 1081 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1077 ~ if let Some(axis_data) = gamepad.axis_data(Axis::RightStickY) { [INFO] [stdout] 1078 + aim_vector.y = -axis_data.value(); [INFO] [stdout] 1079 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:1084:7 [INFO] [stdout] | [INFO] [stdout] 1084 | / match gamepad.axis_data(Axis::LeftStickX) { [INFO] [stdout] 1085 | | Some(axis_data) => { [INFO] [stdout] 1086 | | // crazy rounding shenanigans to round to closest multiple of 0.2 [INFO] [stdout] 1087 | | movement_vector.x = ((axis_data.value() * 5.0).round() as i32) as f32 / 5.0; [INFO] [stdout] 1088 | | } _ => {} [INFO] [stdout] 1089 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1084 ~ if let Some(axis_data) = gamepad.axis_data(Axis::LeftStickX) { [INFO] [stdout] 1085 + // crazy rounding shenanigans to round to closest multiple of 0.2 [INFO] [stdout] 1086 + movement_vector.x = ((axis_data.value() * 5.0).round() as i32) as f32 / 5.0; [INFO] [stdout] 1087 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:1090:7 [INFO] [stdout] | [INFO] [stdout] 1090 | / match gamepad.axis_data(Axis::LeftStickY) { [INFO] [stdout] 1091 | | Some(axis_data) => { [INFO] [stdout] 1092 | | movement_vector.y = ((-axis_data.value() * 5.0).round() as i32) as f32 / 5.0; [INFO] [stdout] ... | [INFO] [stdout] 1095 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1090 ~ if let Some(axis_data) = gamepad.axis_data(Axis::LeftStickY) { [INFO] [stdout] 1091 + movement_vector.y = ((-axis_data.value() * 5.0).round() as i32) as f32 / 5.0; [INFO] [stdout] 1092 + // println!("{}", axis_data.value()); [INFO] [stdout] 1093 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:1098:7 [INFO] [stdout] | [INFO] [stdout] 1098 | / match gamepad.button_data(Button::RightTrigger2) { [INFO] [stdout] 1099 | | Some(button_data) => { [INFO] [stdout] 1100 | | if button_data.value() > 0.2 { [INFO] [stdout] 1101 | | shooting_primary = true; [INFO] [stdout] ... | [INFO] [stdout] 1106 | | } _ => {} [INFO] [stdout] 1107 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1098 ~ if let Some(button_data) = gamepad.button_data(Button::RightTrigger2) { [INFO] [stdout] 1099 + if button_data.value() > 0.2 { [INFO] [stdout] 1100 + shooting_primary = true; [INFO] [stdout] 1101 + keyboard_mode = false; [INFO] [stdout] 1102 + } else { [INFO] [stdout] 1103 + shooting_primary = false; [INFO] [stdout] 1104 + } [INFO] [stdout] 1105 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:1108:7 [INFO] [stdout] | [INFO] [stdout] 1108 | / match gamepad.button_data(Button::LeftTrigger2) { [INFO] [stdout] 1109 | | Some(button_data) => { [INFO] [stdout] 1110 | | if button_data.value() > 0.2 { [INFO] [stdout] 1111 | | shooting_secondary = true; [INFO] [stdout] ... | [INFO] [stdout] 1116 | | } _ => {} [INFO] [stdout] 1117 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1108 ~ if let Some(button_data) = gamepad.button_data(Button::LeftTrigger2) { [INFO] [stdout] 1109 + if button_data.value() > 0.2 { [INFO] [stdout] 1110 + shooting_secondary = true; [INFO] [stdout] 1111 + keyboard_mode = false; [INFO] [stdout] 1112 + } else { [INFO] [stdout] 1113 + shooting_secondary = false; [INFO] [stdout] 1114 + } [INFO] [stdout] 1115 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/game.rs:1120:11 [INFO] [stdout] | [INFO] [stdout] 1120 | / if button_data.value() > 0.0 { [INFO] [stdout] 1121 | | dashing = true; [INFO] [stdout] 1122 | | keyboard_mode = false; [INFO] [stdout] 1123 | | } [INFO] [stdout] | |___________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1119 ~ Some(button_data) [INFO] [stdout] 1120 ~ if button_data.value() > 0.0 => { [INFO] [stdout] 1121 | dashing = true; [INFO] [stdout] 1122 | keyboard_mode = false; [INFO] [stdout] 1123 ~ } _ => {} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:1118:7 [INFO] [stdout] | [INFO] [stdout] 1118 | / match gamepad.button_data(Button::South) { [INFO] [stdout] 1119 | | Some(button_data) => { [INFO] [stdout] 1120 | | if button_data.value() > 0.0 { [INFO] [stdout] 1121 | | dashing = true; [INFO] [stdout] ... | [INFO] [stdout] 1124 | | } _ => {} [INFO] [stdout] 1125 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1118 ~ if let Some(button_data) = gamepad.button_data(Button::South) { [INFO] [stdout] 1119 + if button_data.value() > 0.0 { [INFO] [stdout] 1120 + dashing = true; [INFO] [stdout] 1121 + keyboard_mode = false; [INFO] [stdout] 1122 + } [INFO] [stdout] 1123 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/game.rs:1128:11 [INFO] [stdout] | [INFO] [stdout] 1128 | / if button_data.value() > 0.0 { [INFO] [stdout] 1129 | | dashing = true; [INFO] [stdout] 1130 | | keyboard_mode = false; [INFO] [stdout] 1131 | | } [INFO] [stdout] | |___________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1127 ~ Some(button_data) [INFO] [stdout] 1128 ~ if button_data.value() > 0.0 => { [INFO] [stdout] 1129 | dashing = true; [INFO] [stdout] 1130 | keyboard_mode = false; [INFO] [stdout] 1131 ~ } _ => {} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/game.rs:1126:7 [INFO] [stdout] | [INFO] [stdout] 1126 | / match gamepad.button_data(Button::LeftTrigger) { [INFO] [stdout] 1127 | | Some(button_data) => { [INFO] [stdout] 1128 | | if button_data.value() > 0.0 { [INFO] [stdout] 1129 | | dashing = true; [INFO] [stdout] ... | [INFO] [stdout] 1132 | | } _ => {} [INFO] [stdout] 1133 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 1126 ~ if let Some(button_data) = gamepad.button_data(Button::LeftTrigger) { [INFO] [stdout] 1127 + if button_data.value() > 0.0 { [INFO] [stdout] 1128 + dashing = true; [INFO] [stdout] 1129 + keyboard_mode = false; [INFO] [stdout] 1130 + } [INFO] [stdout] 1131 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/game.rs:1225:7 [INFO] [stdout] | [INFO] [stdout] 1225 | let speed: Vector2; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `speed` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 1225 ~ [INFO] [stdout] 1226 ~ let speed: Vector2 = if distance.magnitude() == 0.0 { [INFO] [stdout] 1227 | // this is only true on the first "frame". [INFO] [stdout] 1228 | // this measure helps reduce the percieved lag from the character standing still [INFO] [stdout] 1229 | // before it obtains its second interpolation position. [INFO] [stdout] 1230 ~ player.movement_direction * (character_properties[&player.character].dash_speed / 2.0) * delta_time [INFO] [stdout] 1231 | } else { [INFO] [stdout] 1232 | // this runs the rest of the time [INFO] [stdout] 1233 | let period = PACKET_INTERVAL; [INFO] [stdout] 1234 ~ distance / period [INFO] [stdout] 1235 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/game.rs:1239:7 [INFO] [stdout] | [INFO] [stdout] 1239 | / if dashing && !player.is_dashing && !player.is_dead && movement_vector_raw.magnitude() != 0.0 { [INFO] [stdout] 1240 | | if player.time_since_last_dash > character_properties[&player.character].dash_cooldown { [INFO] [stdout] 1241 | | match player.character { [INFO] [stdout] 1242 | | Character::Temerity => { [INFO] [stdout] ... | [INFO] [stdout] 1249 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1239 ~ if dashing && !player.is_dashing && !player.is_dead && movement_vector_raw.magnitude() != 0.0 [INFO] [stdout] 1240 ~ && player.time_since_last_dash > character_properties[&player.character].dash_cooldown { [INFO] [stdout] 1241 | match player.character { [INFO] [stdout] ... [INFO] [stdout] 1247 | } [INFO] [stdout] 1248 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/game.rs:1284:10 [INFO] [stdout] | [INFO] [stdout] 1284 | if player.is_dead == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!player.is_dead` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:1332:42 [INFO] [stdout] | [INFO] [stdout] 1332 | let cipher = ChaCha20Poly1305::new(&key); [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/game.rs:1333:37 [INFO] [stdout] | [INFO] [stdout] 1333 | let ciphered = cipher.encrypt(&formatted_nonce, serialized_packet.as_ref()).expect("shit"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `formatted_nonce` [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 `return` statement [INFO] [stdout] --> src/game.rs:1401:3 [INFO] [stdout] | [INFO] [stdout] 1401 | return tiles; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1401 - return tiles; [INFO] [stdout] 1401 + tiles [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/game.rs:1440:3 [INFO] [stdout] | [INFO] [stdout] 1440 | return [&sorted_objects_layer_1[0..sorted_objects_layer_1.len()], &sorted_objects_layer_2[0..sorted_objects_layer_2.len()]].concat(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 1440 - return [&sorted_objects_layer_1[0..sorted_objects_layer_1.len()], &sorted_objects_layer_2[0..sorted_objects_layer_2.len()]].concat(); [INFO] [stdout] 1440 + [&sorted_objects_layer_1[0..sorted_objects_layer_1.len()], &sorted_objects_layer_2[0..sorted_objects_layer_2.len()]].concat() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `index` is used to index `unsorted_objects` [INFO] [stdout] --> src/game.rs:1418:18 [INFO] [stdout] | [INFO] [stdout] 1418 | for index in 0..unsorted_objects.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] 1418 - for index in 0..unsorted_objects.len() { [INFO] [stdout] 1418 + for (index, ) in unsorted_objects.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/gamedata.rs:189:11 [INFO] [stdout] | [INFO] [stdout] 189 | if !vec![BuffType::Impulse].contains(&buff.buff_type) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[BuffType::Impulse]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/gameserver.rs:446:18 [INFO] [stdout] | [INFO] [stdout] 446 | if vec![BuffType::Speed, BuffType::WiroSpeed].contains(&player.buffs[b_index].buff_type) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[BuffType::Speed, BuffType::WiroSpeed]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/game.rs:410:28 [INFO] [stdout] | [INFO] [stdout] 410 | let shaded_objects = vec![GameObjectType::RaphaelleBullet, [INFO] [stdout] | ____________________________^ [INFO] [stdout] 411 | | GameObjectType::RaphaelleBulletEmpowered, [INFO] [stdout] 412 | | GameObjectType::HernaniBullet, [INFO] [stdout] 413 | | GameObjectType::CynewynnSword, [INFO] [stdout] 414 | | GameObjectType::CenterOrb, [INFO] [stdout] 415 | | GameObjectType::ElizabethProjectileRicochet, [INFO] [stdout] 416 | | ]; [INFO] [stdout] | |_____________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 410 ~ let shaded_objects = [GameObjectType::RaphaelleBullet, [INFO] [stdout] 411 + GameObjectType::RaphaelleBulletEmpowered, [INFO] [stdout] 412 + GameObjectType::HernaniBullet, [INFO] [stdout] 413 + GameObjectType::CynewynnSword, [INFO] [stdout] 414 + GameObjectType::CenterOrb, [INFO] [stdout] 415 ~ GameObjectType::ElizabethProjectileRicochet]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/game.rs:1269:12 [INFO] [stdout] | [INFO] [stdout] 1269 | if vec![BuffType::Speed, BuffType::WiroSpeed].contains(&buff.buff_type) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use an array directly: `[BuffType::Speed, BuffType::WiroSpeed]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/game.rs:1368:22 [INFO] [stdout] | [INFO] [stdout] 1368 | let bright_tiles = vec![GameObjectType::Grass1Bright, [INFO] [stdout] | ______________________^ [INFO] [stdout] 1369 | | GameObjectType::Grass2Bright, [INFO] [stdout] 1370 | | GameObjectType::Grass3Bright, [INFO] [stdout] 1371 | | GameObjectType::Grass4Bright, [INFO] [stdout] 1372 | | GameObjectType::Grass5Bright, [INFO] [stdout] 1373 | | GameObjectType::Grass6Bright, [INFO] [stdout] 1374 | | GameObjectType::Grass7Bright, ]; [INFO] [stdout] | |______________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 1368 ~ let bright_tiles = [GameObjectType::Grass1Bright, [INFO] [stdout] 1369 + GameObjectType::Grass2Bright, [INFO] [stdout] 1370 + GameObjectType::Grass3Bright, [INFO] [stdout] 1371 + GameObjectType::Grass4Bright, [INFO] [stdout] 1372 + GameObjectType::Grass5Bright, [INFO] [stdout] 1373 + GameObjectType::Grass6Bright, [INFO] [stdout] 1374 ~ GameObjectType::Grass7Bright]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/game.rs:1375:20 [INFO] [stdout] | [INFO] [stdout] 1375 | let dark_tiles = vec![GameObjectType::Grass1, [INFO] [stdout] | ____________________^ [INFO] [stdout] 1376 | | GameObjectType::Grass2, [INFO] [stdout] 1377 | | GameObjectType::Grass3, [INFO] [stdout] 1378 | | GameObjectType::Grass4, [INFO] [stdout] 1379 | | GameObjectType::Grass5, [INFO] [stdout] 1380 | | GameObjectType::Grass6, [INFO] [stdout] 1381 | | GameObjectType::Grass7, ]; [INFO] [stdout] | |________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] help: you can use an array directly [INFO] [stdout] | [INFO] [stdout] 1375 ~ let dark_tiles = [GameObjectType::Grass1, [INFO] [stdout] 1376 + GameObjectType::Grass2, [INFO] [stdout] 1377 + GameObjectType::Grass3, [INFO] [stdout] 1378 + GameObjectType::Grass4, [INFO] [stdout] 1379 + GameObjectType::Grass5, [INFO] [stdout] 1380 + GameObjectType::Grass6, [INFO] [stdout] 1381 ~ GameObjectType::Grass7]; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/server.rs:694:33 [INFO] [stdout] | [INFO] [stdout] 694 | ... port: port, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `port` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `miniquad::window::get_window_position` [INFO] [stdout] --> src/bin/client.rs:10:17 [INFO] [stdout] | [INFO] [stdout] 10 | use macroquad::{miniquad::window::get_window_position, prelude::*}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `miniquad::window::get_window_position` [INFO] [stdout] --> src/bin/client.rs:10:17 [INFO] [stdout] | [INFO] [stdout] 10 | use macroquad::{miniquad::window::get_window_position, prelude::*}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like an `else if` but the `else` is missing [INFO] [stdout] --> src/bin/client.rs:899:6 [INFO] [stdout] | [INFO] [stdout] 899 | } if !main_tabs.selected_tab() == 3 { [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: to remove this lint, add the missing `else` or add a new line before the second `if` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#possible_missing_else [INFO] [stdout] = note: `#[warn(clippy::possible_missing_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like an `else if` but the `else` is missing [INFO] [stdout] --> src/bin/client.rs:1038:6 [INFO] [stdout] | [INFO] [stdout] 1038 | } if !main_tabs.selected_tab() == 4 { [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: to remove this lint, add the missing `else` or add a new line before the second `if` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#possible_missing_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like an `else if` but the `else` is missing [INFO] [stdout] --> src/bin/client.rs:899:6 [INFO] [stdout] | [INFO] [stdout] 899 | } if !main_tabs.selected_tab() == 3 { [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: to remove this lint, add the missing `else` or add a new line before the second `if` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#possible_missing_else [INFO] [stdout] = note: `#[warn(clippy::possible_missing_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like an `else if` but the `else` is missing [INFO] [stdout] --> src/bin/client.rs:1038:6 [INFO] [stdout] | [INFO] [stdout] 1038 | } if !main_tabs.selected_tab() == 4 { [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: to remove this lint, add the missing `else` or add a new line before the second `if` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#possible_missing_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like an `else if` but the `else` is missing [INFO] [stdout] --> src/bin/client.rs:746:8 [INFO] [stdout] | [INFO] [stdout] 746 | } if queue { [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: to remove this lint, add the missing `else` or add a new line before the second `if` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#possible_missing_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this looks like an `else if` but the `else` is missing [INFO] [stdout] --> src/bin/client.rs:746:8 [INFO] [stdout] | [INFO] [stdout] 746 | } if queue { [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: to remove this lint, add the missing `else` or add a new line before the second `if` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#possible_missing_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/client.rs:858:15 [INFO] [stdout] | [INFO] [stdout] 858 | session_key: session_key, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `session_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/client.rs:858:15 [INFO] [stdout] | [INFO] [stdout] 858 | session_key: session_key, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `session_key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/bin/server.rs:694:33 [INFO] [stdout] | [INFO] [stdout] 694 | ... port: port, [INFO] [stdout] | ^^^^^^^^^^ help: replace it with: `port` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/bin/client.rs:240:35 [INFO] [stdout] | [INFO] [stdout] 240 | else if password_selected { [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 241 | | confirm = true; [INFO] [stdout] 242 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/bin/client.rs:243:14 [INFO] [stdout] | [INFO] [stdout] 243 | else { [INFO] [stdout] | ______________^ [INFO] [stdout] 244 | | confirm = true; [INFO] [stdout] 245 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression assigns a bool literal [INFO] [stdout] --> src/bin/client.rs:240:14 [INFO] [stdout] | [INFO] [stdout] 240 | else if password_selected { [INFO] [stdout] | ______________^ [INFO] [stdout] 241 | | confirm = true; [INFO] [stdout] 242 | | } [INFO] [stdout] 243 | | else { [INFO] [stdout] 244 | | confirm = true; [INFO] [stdout] 245 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `{ password_selected; confirm = true; }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign [INFO] [stdout] = note: `#[warn(clippy::needless_bool_assign)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/bin/client.rs:423:18 [INFO] [stdout] | [INFO] [stdout] 423 | if registering == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `!registering` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `n_index` is used to index `notifications` [INFO] [stdout] --> src/bin/client.rs:582:22 [INFO] [stdout] | [INFO] [stdout] 582 | for n_index in 0..notifications.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] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 582 - for n_index in 0..notifications.len() { [INFO] [stdout] 582 + for (n_index, ) in notifications.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/bin/client.rs:808:20 [INFO] [stdout] | [INFO] [stdout] 808 | ... draw_text(&format!("{}", player.username), lobby_position.x + 2.0*vh, lobby_position.y + (i as f32)*y_offset + lobby_size.y*0... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `player.username.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/bin/client.rs:809:20 [INFO] [stdout] | [INFO] [stdout] 809 | ... draw_text(&format!("{}", is_ready_text), lobby_position.x + lobby_size.x * 0.67, lobby_position.y + (i as f32)*y_offset + lob... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `is_ready_text.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u16` which implements the `Copy` trait [INFO] [stdout] --> src/bin/client.rs:847:34 [INFO] [stdout] | [INFO] [stdout] 847 | let practice_game_port = game_port.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `game_port` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/bin/client.rs:240:35 [INFO] [stdout] | [INFO] [stdout] 240 | else if password_selected { [INFO] [stdout] | ___________________________________^ [INFO] [stdout] 241 | | confirm = true; [INFO] [stdout] 242 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/bin/client.rs:243:14 [INFO] [stdout] | [INFO] [stdout] 243 | else { [INFO] [stdout] | ______________^ [INFO] [stdout] 244 | | confirm = true; [INFO] [stdout] 245 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression assigns a bool literal [INFO] [stdout] --> src/bin/client.rs:240:14 [INFO] [stdout] | [INFO] [stdout] 240 | else if password_selected { [INFO] [stdout] | ______________^ [INFO] [stdout] 241 | | confirm = true; [INFO] [stdout] 242 | | } [INFO] [stdout] 243 | | else { [INFO] [stdout] 244 | | confirm = true; [INFO] [stdout] 245 | | } [INFO] [stdout] | |_________^ help: you can reduce it to: `{ password_selected; confirm = true; }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool_assign [INFO] [stdout] = note: `#[warn(clippy::needless_bool_assign)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/bin/client.rs:423:18 [INFO] [stdout] | [INFO] [stdout] 423 | if registering == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `!registering` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_comparison)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Character` which implements the `Copy` trait [INFO] [stdout] --> src/bin/client.rs:850:34 [INFO] [stdout] | [INFO] [stdout] 850 | let practice_character = characters[selected_char].clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `characters[selected_char]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/bin/client.rs:885:10 [INFO] [stdout] | [INFO] [stdout] 885 | if tab_stats_refresh_flag == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!tab_stats_refresh_flag` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/bin/client.rs:905:10 [INFO] [stdout] | [INFO] [stdout] 905 | if tab_friends_refresh_flag == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!tab_friends_refresh_flag` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `n_index` is used to index `notifications` [INFO] [stdout] --> src/bin/client.rs:582:22 [INFO] [stdout] | [INFO] [stdout] 582 | for n_index in 0..notifications.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] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 582 - for n_index in 0..notifications.len() { [INFO] [stdout] 582 + for (n_index, ) in notifications.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/bin/client.rs:958:9 [INFO] [stdout] | [INFO] [stdout] 958 | let peer_username; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `peer_username` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 958 ~ [INFO] [stdout] 959 | let split: Vec<&str> = friend.0.split(":").collect(); [INFO] [stdout] 960 ~ let peer_username = if *split[0] == username { [INFO] [stdout] 961 ~ split[1] [INFO] [stdout] 962 | } else { [INFO] [stdout] 963 ~ split[0] [INFO] [stdout] 964 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/client.rs:970:87 [INFO] [stdout] | [INFO] [stdout] 970 | let pending_for_you_status = database::get_friend_request_type(&username, &peer_username); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `peer_username` [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: the loop variable `n_index` is used to index `notifications` [INFO] [stdout] --> src/bin/client.rs:1048:20 [INFO] [stdout] | [INFO] [stdout] 1048 | for n_index in 0..notifications.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] 1048 - for n_index in 0..notifications.len() { [INFO] [stdout] 1048 + for (n_index, ) in notifications.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/bin/client.rs:808:20 [INFO] [stdout] | [INFO] [stdout] 808 | ... draw_text(&format!("{}", player.username), lobby_position.x + 2.0*vh, lobby_position.y + (i as f32)*y_offset + lobby_size.y*0... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `player.username.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/bin/client.rs:809:20 [INFO] [stdout] | [INFO] [stdout] 809 | ... draw_text(&format!("{}", is_ready_text), lobby_position.x + lobby_size.x * 0.67, lobby_position.y + (i as f32)*y_offset + lob... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `is_ready_text.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `u16` which implements the `Copy` trait [INFO] [stdout] --> src/bin/client.rs:847:34 [INFO] [stdout] | [INFO] [stdout] 847 | let practice_game_port = game_port.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `game_port` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Character` which implements the `Copy` trait [INFO] [stdout] --> src/bin/client.rs:850:34 [INFO] [stdout] | [INFO] [stdout] 850 | let practice_character = characters[selected_char].clone(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `characters[selected_char]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/bin/client.rs:885:10 [INFO] [stdout] | [INFO] [stdout] 885 | if tab_stats_refresh_flag == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!tab_stats_refresh_flag` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/bin/client.rs:905:10 [INFO] [stdout] | [INFO] [stdout] 905 | if tab_friends_refresh_flag == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!tab_friends_refresh_flag` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/bin/client.rs:958:9 [INFO] [stdout] | [INFO] [stdout] 958 | let peer_username; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `peer_username` here and remove the assignments from the branches [INFO] [stdout] | [INFO] [stdout] 958 ~ [INFO] [stdout] 959 | let split: Vec<&str> = friend.0.split(":").collect(); [INFO] [stdout] 960 ~ let peer_username = if *split[0] == username { [INFO] [stdout] 961 ~ split[1] [INFO] [stdout] 962 | } else { [INFO] [stdout] 963 ~ split[0] [INFO] [stdout] 964 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/bin/client.rs:970:87 [INFO] [stdout] | [INFO] [stdout] 970 | let pending_for_you_status = database::get_friend_request_type(&username, &peer_username); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `peer_username` [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: the loop variable `n_index` is used to index `notifications` [INFO] [stdout] --> src/bin/client.rs:1048:20 [INFO] [stdout] | [INFO] [stdout] 1048 | for n_index in 0..notifications.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] 1048 - for n_index in 0..notifications.len() { [INFO] [stdout] 1048 + for (n_index, ) in notifications.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/bin/server.rs:176:21 [INFO] [stdout] | [INFO] [stdout] 176 | let username_taken_real: bool; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `username_taken_real` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 176 ~ [INFO] [stdout] 177 | { [INFO] [stdout] ... [INFO] [stdout] 180 | } [INFO] [stdout] 181 ~ let username_taken_real: bool = match username_taken { [INFO] [stdout] 182 ~ Ok(taken) => { taken }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `database::username_taken` doesn't need a mutable reference [INFO] [stdout] --> src/bin/server.rs:179:65 [INFO] [stdout] | [INFO] [stdout] 179 | username_taken = database::username_taken(&mut database, &recieved_username); [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] 179 - username_taken = database::username_taken(&mut database, &recieved_username); [INFO] [stdout] 179 + username_taken = database::username_taken(&database, &recieved_username); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/bin/server.rs:238:21 [INFO] [stdout] | [INFO] [stdout] 238 | let user_exists_real: bool; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `user_exists_real` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 238 ~ [INFO] [stdout] 239 | { [INFO] [stdout] ... [INFO] [stdout] 243 | } [INFO] [stdout] 244 ~ let user_exists_real: bool = match user_exists { [INFO] [stdout] 245 ~ Ok(exists) => exists, [INFO] [stdout] 246 | Err(_err) => { [INFO] [stdout] ... [INFO] [stdout] 251 | } [INFO] [stdout] 252 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/bin/server.rs:460:31 [INFO] [stdout] | [INFO] [stdout] 460 | ... let lobby_owner_index; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ created here [INFO] [stdout] 461 | ... lobby_owner_index = player_index; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ initialised here [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `lobby_owner_index` here [INFO] [stdout] | [INFO] [stdout] 460 ~ [INFO] [stdout] 461 ~ let lobby_owner_index = player_index; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `player_index` is used to index `players_copy` [INFO] [stdout] --> src/bin/server.rs:600:45 [INFO] [stdout] | [INFO] [stdout] 600 | for player_index in 0..players_copy.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] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 600 - for player_index in 0..players_copy.len() { [INFO] [stdout] 600 + for (player_index, ) in players_copy.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/server.rs:1082:41 [INFO] [stdout] | [INFO] [stdout] 1082 | if peer_username == String::from("tc") || peer_username == String::from("ac") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"tc"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/server.rs:1082:80 [INFO] [stdout] | [INFO] [stdout] 1082 | if peer_username == String::from("tc") || peer_username == String::from("ac") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"ac"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/server.rs:1095:49 [INFO] [stdout] | [INFO] [stdout] 1095 | ... if peer_username == String::from("tc") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"tc"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `bool` which implements the `Copy` trait [INFO] [stdout] --> src/bin/server.rs:1372:51 [INFO] [stdout] | [INFO] [stdout] 1372 | ... is_ready: players[index].queued.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `players[index].queued` [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] --> src/bin/server.rs:1489:51 [INFO] [stdout] | [INFO] [stdout] 1489 | ... match from_user(&player, players.clone()) { [INFO] [stdout] | ^^^^^^^ help: change this to: `player` [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: unneeded `return` statement [INFO] [stdout] --> src/bin/server.rs:1621:3 [INFO] [stdout] | [INFO] [stdout] 1621 | return Err(()) [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] 1621 - return Err(()) [INFO] [stdout] 1621 + Err(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `p_index` is used to index `players` [INFO] [stdout] --> src/bin/server.rs:1616:18 [INFO] [stdout] | [INFO] [stdout] 1616 | for p_index in 0..players.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] 1616 - for p_index in 0..players.len() { [INFO] [stdout] 1616 + for (p_index, ) in players.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/bin/server.rs:176:21 [INFO] [stdout] | [INFO] [stdout] 176 | let username_taken_real: bool; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] = note: `#[warn(clippy::needless_late_init)]` on by default [INFO] [stdout] help: move the declaration `username_taken_real` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 176 ~ [INFO] [stdout] 177 | { [INFO] [stdout] ... [INFO] [stdout] 180 | } [INFO] [stdout] 181 ~ let username_taken_real: bool = match username_taken { [INFO] [stdout] 182 ~ Ok(taken) => { taken }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the function `database::username_taken` doesn't need a mutable reference [INFO] [stdout] --> src/bin/server.rs:179:65 [INFO] [stdout] | [INFO] [stdout] 179 | username_taken = database::username_taken(&mut database, &recieved_username); [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] 179 - username_taken = database::username_taken(&mut database, &recieved_username); [INFO] [stdout] 179 + username_taken = database::username_taken(&database, &recieved_username); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/bin/server.rs:238:21 [INFO] [stdout] | [INFO] [stdout] 238 | let user_exists_real: bool; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `user_exists_real` here and remove the assignments from the `match` arms [INFO] [stdout] | [INFO] [stdout] 238 ~ [INFO] [stdout] 239 | { [INFO] [stdout] ... [INFO] [stdout] 243 | } [INFO] [stdout] 244 ~ let user_exists_real: bool = match user_exists { [INFO] [stdout] 245 ~ Ok(exists) => exists, [INFO] [stdout] 246 | Err(_err) => { [INFO] [stdout] ... [INFO] [stdout] 251 | } [INFO] [stdout] 252 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded late initialization [INFO] [stdout] --> src/bin/server.rs:460:31 [INFO] [stdout] | [INFO] [stdout] 460 | ... let lobby_owner_index; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ created here [INFO] [stdout] 461 | ... lobby_owner_index = player_index; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ initialised here [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init [INFO] [stdout] help: move the declaration `lobby_owner_index` here [INFO] [stdout] | [INFO] [stdout] 460 ~ [INFO] [stdout] 461 ~ let lobby_owner_index = player_index; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `player_index` is used to index `players_copy` [INFO] [stdout] --> src/bin/server.rs:600:45 [INFO] [stdout] | [INFO] [stdout] 600 | for player_index in 0..players_copy.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] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 600 - for player_index in 0..players_copy.len() { [INFO] [stdout] 600 + for (player_index, ) in players_copy.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/server.rs:1082:41 [INFO] [stdout] | [INFO] [stdout] 1082 | if peer_username == String::from("tc") || peer_username == String::from("ac") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"tc"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/server.rs:1082:80 [INFO] [stdout] | [INFO] [stdout] 1082 | if peer_username == String::from("tc") || peer_username == String::from("ac") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"ac"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/bin/server.rs:1095:49 [INFO] [stdout] | [INFO] [stdout] 1095 | ... if peer_username == String::from("tc") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `"tc"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `bool` which implements the `Copy` trait [INFO] [stdout] --> src/bin/server.rs:1372:51 [INFO] [stdout] | [INFO] [stdout] 1372 | ... is_ready: players[index].queued.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `players[index].queued` [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] --> src/bin/server.rs:1489:51 [INFO] [stdout] | [INFO] [stdout] 1489 | ... match from_user(&player, players.clone()) { [INFO] [stdout] | ^^^^^^^ help: change this to: `player` [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: unneeded `return` statement [INFO] [stdout] --> src/bin/server.rs:1621:3 [INFO] [stdout] | [INFO] [stdout] 1621 | return Err(()) [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] 1621 - return Err(()) [INFO] [stdout] 1621 + Err(()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `p_index` is used to index `players` [INFO] [stdout] --> src/bin/server.rs:1616:18 [INFO] [stdout] | [INFO] [stdout] 1616 | for p_index in 0..players.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] 1616 - for p_index in 0..players.len() { [INFO] [stdout] 1616 + for (p_index, ) in players.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 03s [INFO] running `Command { std: "docker" "inspect" "a76c3909fffa5b6755094fe55c530d2884377a5981f5f01c6cad1cc994ee3c1b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "a76c3909fffa5b6755094fe55c530d2884377a5981f5f01c6cad1cc994ee3c1b", kill_on_drop: false }` [INFO] [stdout] a76c3909fffa5b6755094fe55c530d2884377a5981f5f01c6cad1cc994ee3c1b