[INFO] cloning repository https://github.com/Kerimniy/Abotrep [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/Kerimniy/Abotrep" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FKerimniy%2FAbotrep", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FKerimniy%2FAbotrep'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] b69ce62f8a23b4a70c3861f97949eb49506244cf [INFO] linting Kerimniy/Abotrep against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FKerimniy%2FAbotrep" "/workspace/builds/worker-6-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-6-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/Kerimniy/Abotrep [INFO] finished tweaking git repo https://github.com/Kerimniy/Abotrep [INFO] tweaked toml for git repo https://github.com/Kerimniy/Abotrep written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/Kerimniy/Abotrep 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/Kerimniy/Abotrep 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 http-range-header v0.4.2 [INFO] [stderr] Downloaded tower-cookies v0.11.0 [INFO] [stderr] Downloaded nibble_vec v0.1.0 [INFO] [stderr] Downloaded fs_extra v1.3.0 [INFO] [stderr] Downloaded wasm-bindgen-futures v0.4.55 [INFO] [stderr] Downloaded dashmap v7.0.0-rc2 [INFO] [stderr] Downloaded askama v0.14.0 [INFO] [stderr] Downloaded askama_parser v0.14.0 [INFO] [stderr] Downloaded askama_derive v0.14.0 [INFO] [stderr] Downloaded cc v1.2.47 [INFO] [stderr] Downloaded iri-string v0.7.9 [INFO] [stderr] Downloaded zerocopy-derive v0.8.30 [INFO] [stderr] Downloaded tower-http v0.6.7 [INFO] [stderr] Downloaded reqwest v0.12.24 [INFO] [stderr] Downloaded axum v0.8.7 [INFO] [stderr] Downloaded basic-toml v0.1.10 [INFO] [stderr] Downloaded axum-server v0.7.3 [INFO] [stderr] Downloaded aws-lc-rs v1.15.1 [INFO] [stderr] Downloaded zerocopy v0.8.30 [INFO] [stderr] Downloaded radix_trie v0.3.0 [INFO] [stderr] Downloaded rustls-pki-types v1.13.0 [INFO] [stderr] Downloaded fs-err v3.2.0 [INFO] [stderr] Downloaded endian-type v0.2.0 [INFO] [stderr] Downloaded cmake v0.1.54 [INFO] [stderr] Downloaded web-sys v0.3.82 [INFO] [stderr] Downloaded aws-lc-sys v0.34.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 2524c8b51cffa392cc5698876370940b2975af1be3fd48bd9d55502d48b8f0ce [INFO] running `Command { std: "docker" "start" "-a" "2524c8b51cffa392cc5698876370940b2975af1be3fd48bd9d55502d48b8f0ce", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "2524c8b51cffa392cc5698876370940b2975af1be3fd48bd9d55502d48b8f0ce", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "2524c8b51cffa392cc5698876370940b2975af1be3fd48bd9d55502d48b8f0ce", kill_on_drop: false }` [INFO] [stdout] 2524c8b51cffa392cc5698876370940b2975af1be3fd48bd9d55502d48b8f0ce [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] f917c737b2f6536d38a806a1fffc7ac3cd79e804a569f90d105700f19a705ad6 [INFO] running `Command { std: "docker" "start" "-a" "f917c737b2f6536d38a806a1fffc7ac3cd79e804a569f90d105700f19a705ad6", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.103 [INFO] [stderr] Compiling quote v1.0.42 [INFO] [stderr] Compiling libc v0.2.177 [INFO] [stderr] Checking pin-project-lite v0.2.16 [INFO] [stderr] Checking itoa v1.0.15 [INFO] [stderr] Checking futures-core v0.3.31 [INFO] [stderr] Checking bytes v1.11.0 [INFO] [stderr] Compiling find-msvc-tools v0.1.5 [INFO] [stderr] Compiling shlex v1.3.0 [INFO] [stderr] Checking smallvec v1.15.1 [INFO] [stderr] Checking once_cell v1.21.3 [INFO] [stderr] Checking futures-sink v0.3.31 [INFO] [stderr] Checking stable_deref_trait v1.2.1 [INFO] [stderr] Checking slab v0.4.11 [INFO] [stderr] Checking fnv v1.0.7 [INFO] [stderr] Compiling dunce v1.0.5 [INFO] [stderr] Compiling fs_extra v1.3.0 [INFO] [stderr] Checking memchr v2.7.6 [INFO] [stderr] Checking percent-encoding v2.3.2 [INFO] [stderr] Checking futures-channel v0.3.31 [INFO] [stderr] Checking log v0.4.28 [INFO] [stderr] Checking futures-io v0.3.31 [INFO] [stderr] Checking futures-task v0.3.31 [INFO] [stderr] Checking zeroize v1.8.2 [INFO] [stderr] Checking tracing-core v0.1.34 [INFO] [stderr] Compiling typenum v1.19.0 [INFO] [stderr] Checking subtle v2.6.1 [INFO] [stderr] Checking tower-service v0.3.3 [INFO] [stderr] Compiling aws-lc-rs v1.15.1 [INFO] [stderr] Compiling serde_core v1.0.228 [INFO] [stderr] Compiling zerocopy v0.8.30 [INFO] [stderr] Checking rustls-pki-types v1.13.0 [INFO] [stderr] Checking litemap v0.8.1 [INFO] [stderr] Checking writeable v0.6.2 [INFO] [stderr] Compiling httparse v1.10.1 [INFO] [stderr] Checking hashbrown v0.16.1 [INFO] [stderr] Checking atomic-waker v1.1.2 [INFO] [stderr] Checking try-lock v0.2.5 [INFO] [stderr] Checking untrusted v0.9.0 [INFO] [stderr] Compiling icu_properties_data v2.1.1 [INFO] [stderr] Compiling icu_normalizer_data v2.1.1 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Checking httpdate v1.0.3 [INFO] [stderr] Checking base64 v0.22.1 [INFO] [stderr] Checking want v0.3.1 [INFO] [stderr] Checking sync_wrapper v1.0.2 [INFO] [stderr] Checking mime v0.3.17 [INFO] [stderr] Compiling rustls v0.23.35 [INFO] [stderr] Checking tower-layer v0.3.3 [INFO] [stderr] Compiling serde v1.0.228 [INFO] [stderr] Compiling unicase v2.8.1 [INFO] [stderr] Compiling parking_lot_core v0.9.12 [INFO] [stderr] Checking ipnet v2.11.0 [INFO] [stderr] Compiling getrandom v0.3.4 [INFO] [stderr] Checking form_urlencoded v1.2.2 [INFO] [stderr] Compiling mime_guess v2.0.5 [INFO] [stderr] Compiling time-core v0.1.6 [INFO] [stderr] Compiling syn v2.0.111 [INFO] [stderr] Checking ryu v1.0.20 [INFO] [stderr] Checking indexmap v2.12.1 [INFO] [stderr] Compiling serde_json v1.0.145 [INFO] [stderr] Compiling num-conv v0.1.0 [INFO] [stderr] Compiling autocfg v1.5.0 [INFO] [stderr] Checking powerfmt v0.2.0 [INFO] [stderr] Checking lock_api v0.4.14 [INFO] [stderr] Checking http v1.3.1 [INFO] [stderr] Compiling cookie v0.18.1 [INFO] [stderr] Checking deranged v0.5.5 [INFO] [stderr] Checking mio v1.1.0 [INFO] [stderr] Compiling jobserver v0.1.34 [INFO] [stderr] Checking socket2 v0.6.1 [INFO] [stderr] Checking getrandom v0.2.16 [INFO] [stderr] Compiling time-macros v0.2.24 [INFO] [stderr] Checking generic-array v0.14.7 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Compiling fs-err v3.2.0 [INFO] [stderr] Compiling crossbeam-utils v0.8.21 [INFO] [stderr] Compiling cc v1.2.47 [INFO] [stderr] Checking utf8_iter v1.0.4 [INFO] [stderr] Compiling winnow v0.7.14 [INFO] [stderr] Checking rand_core v0.9.3 [INFO] [stderr] Checking block-buffer v0.10.4 [INFO] [stderr] Checking crypto-common v0.1.7 [INFO] [stderr] Checking webpki-roots v1.0.4 [INFO] [stderr] Checking http-range-header v0.4.2 [INFO] [stderr] Compiling rustc-hash v2.1.1 [INFO] [stderr] Checking bitflags v2.10.0 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Checking http-body v1.0.1 [INFO] [stderr] Checking hmac v0.12.1 [INFO] [stderr] Checking http-body-util v0.1.3 [INFO] [stderr] Checking sha2 v0.10.9 [INFO] [stderr] Checking iri-string v0.7.9 [INFO] [stderr] Checking parking_lot v0.12.5 [INFO] [stderr] Checking rustls-pemfile v2.2.0 [INFO] [stderr] Checking nibble_vec v0.1.0 [INFO] [stderr] Checking axum-core v0.5.5 [INFO] [stderr] Checking arc-swap v1.7.1 [INFO] [stderr] Checking endian-type v0.2.0 [INFO] [stderr] Checking matchit v0.8.4 [INFO] [stderr] Checking serde_path_to_error v0.1.20 [INFO] [stderr] Checking hashbrown v0.15.5 [INFO] [stderr] Checking radix_trie v0.3.0 [INFO] [stderr] Checking time v0.3.44 [INFO] [stderr] Checking ppv-lite86 v0.2.21 [INFO] [stderr] Compiling cmake v0.1.54 [INFO] [stderr] Checking dashmap v7.0.0-rc2 [INFO] [stderr] Compiling basic-toml v0.1.10 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand_chacha v0.9.0 [INFO] [stderr] Compiling aws-lc-sys v0.34.0 [INFO] [stderr] Compiling ring v0.17.14 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking rand v0.9.2 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Compiling tokio-macros v2.6.0 [INFO] [stderr] Compiling zerovec-derive v0.11.2 [INFO] [stderr] Compiling futures-macro v0.3.31 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.8.1 [INFO] [stderr] Checking tokio v1.48.0 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Checking yoke v0.8.1 [INFO] [stderr] Checking zerovec v0.11.5 [INFO] [stderr] Checking zerotrie v0.2.3 [INFO] [stderr] Checking tinystr v0.8.2 [INFO] [stderr] Checking potential_utf v0.1.4 [INFO] [stderr] Checking icu_collections v2.1.1 [INFO] [stderr] Checking icu_locale_core v2.1.1 [INFO] [stderr] Compiling askama_parser v0.14.0 [INFO] [stderr] Checking icu_provider v2.1.1 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking icu_normalizer v2.1.1 [INFO] [stderr] Checking icu_properties v2.1.1 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Checking idna v1.1.0 [INFO] [stderr] Checking futures-executor v0.3.31 [INFO] [stderr] Checking tower-cookies v0.11.0 [INFO] [stderr] Checking futures v0.3.31 [INFO] [stderr] Checking url v2.5.7 [INFO] [stderr] Compiling askama_derive v0.14.0 [INFO] [stderr] Checking tokio-util v0.7.17 [INFO] [stderr] Checking tower v0.5.2 [INFO] [stderr] Checking h2 v0.4.12 [INFO] [stderr] Checking tower-http v0.6.7 [INFO] [stderr] Checking askama v0.14.0 [INFO] [stderr] Checking hyper v1.8.1 [INFO] [stderr] Checking rustls-webpki v0.103.8 [INFO] [stderr] Checking hyper-util v0.1.18 [INFO] [stderr] Checking axum v0.8.7 [INFO] [stderr] Checking tokio-rustls v0.26.4 [INFO] [stderr] Checking hyper-rustls v0.27.7 [INFO] [stderr] Checking axum-server v0.7.3 [INFO] [stderr] Checking reqwest v0.12.24 [INFO] [stderr] Checking abotrep v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `std::cell::RefMut` [INFO] [stdout] --> src/main.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use std::cell::RefMut; [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: `HeaderValue` [INFO] [stdout] --> src/main.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | HeaderValue, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `OffsetDateTime` [INFO] [stdout] --> src/main.rs:18:22 [INFO] [stdout] | [INFO] [stdout] 18 | use time::{Duration, OffsetDateTime}; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `Request` and `request::Parts` [INFO] [stdout] --> src/main.rs:19:18 [INFO] [stdout] | [INFO] [stdout] 19 | use axum::http::{Request, request::Parts}; [INFO] [stdout] | ^^^^^^^ ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `SubTrie` [INFO] [stdout] --> src/main.rs:22:18 [INFO] [stdout] | [INFO] [stdout] 22 | use radix_trie::{SubTrie, Trie, TrieCommon}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `serde_json::json` [INFO] [stdout] --> src/main.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | use serde_json::json; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Serialize` [INFO] [stdout] --> src/main.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | use serde::{Serialize,Deserialize}; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::ops::Deref` [INFO] [stdout] --> src/main.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | use std::ops::Deref; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `time::format_description::well_known::iso8601::Config` [INFO] [stdout] --> src/main.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | use time::format_description::well_known::iso8601::Config; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `futures::future` [INFO] [stdout] --> src/main.rs:32:5 [INFO] [stdout] | [INFO] [stdout] 32 | use futures::future; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Sha256` [INFO] [stdout] --> src/main.rs:33:12 [INFO] [stdout] | [INFO] [stdout] 33 | use sha2::{Sha256, Digest}; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/main.rs:193:13 [INFO] [stdout] | [INFO] [stdout] 193 | rate_limit_state: rate_limit_state, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `rate_limit_state` [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/main.rs:197:13 [INFO] [stdout] | [INFO] [stdout] 197 | antibot: antibot, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `antibot` [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/main.rs:199:13 [INFO] [stdout] | [INFO] [stdout] 199 | default_antibot: default_antibot, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `default_antibot` [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: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/main.rs:243:12 [INFO] [stdout] | [INFO] [stdout] 243 | if (start.elapsed()>std::time::Duration::from_secs(self.window as u64)){ [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 243 - if (start.elapsed()>std::time::Duration::from_secs(self.window as u64)){ [INFO] [stdout] 243 + if start.elapsed()>std::time::Duration::from_secs(self.window as u64) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/main.rs:247:12 [INFO] [stdout] | [INFO] [stdout] 247 | if (session.value_mut().0>self.limit){ [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 247 - if (session.value_mut().0>self.limit){ [INFO] [stdout] 247 + if session.value_mut().0>self.limit { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type `custom_captcha_conf` should have an upper camel case name [INFO] [stdout] --> src/main.rs:340:8 [INFO] [stdout] | [INFO] [stdout] 340 | struct custom_captcha_conf{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: convert the identifier to upper camel case: `CustomCaptchaConf` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_camel_case_types)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary trailing semicolon [INFO] [stdout] --> src/main.rs:861:370 [INFO] [stdout] | [INFO] [stdout] 861 | ....clone())).layer(Extension(json_custom.clone()));; [INFO] [stdout] | ^ help: remove this semicolon [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(redundant_semicolons)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::cell::RefMut` [INFO] [stdout] --> src/main.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use std::cell::RefMut; [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: `HeaderValue` [INFO] [stdout] --> src/main.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | HeaderValue, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `OffsetDateTime` [INFO] [stdout] --> src/main.rs:18:22 [INFO] [stdout] | [INFO] [stdout] 18 | use time::{Duration, OffsetDateTime}; [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `Request` and `request::Parts` [INFO] [stdout] --> src/main.rs:19:18 [INFO] [stdout] | [INFO] [stdout] 19 | use axum::http::{Request, request::Parts}; [INFO] [stdout] | ^^^^^^^ ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `SubTrie` [INFO] [stdout] --> src/main.rs:22:18 [INFO] [stdout] | [INFO] [stdout] 22 | use radix_trie::{SubTrie, Trie, TrieCommon}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `serde_json::json` [INFO] [stdout] --> src/main.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | use serde_json::json; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Serialize` [INFO] [stdout] --> src/main.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | use serde::{Serialize,Deserialize}; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::ops::Deref` [INFO] [stdout] --> src/main.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 27 | use std::ops::Deref; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `time::format_description::well_known::iso8601::Config` [INFO] [stdout] --> src/main.rs:29:5 [INFO] [stdout] | [INFO] [stdout] 29 | use time::format_description::well_known::iso8601::Config; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `futures::future` [INFO] [stdout] --> src/main.rs:32:5 [INFO] [stdout] | [INFO] [stdout] 32 | use futures::future; [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Sha256` [INFO] [stdout] --> src/main.rs:33:12 [INFO] [stdout] | [INFO] [stdout] 33 | use sha2::{Sha256, Digest}; [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/main.rs:193:13 [INFO] [stdout] | [INFO] [stdout] 193 | rate_limit_state: rate_limit_state, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `rate_limit_state` [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/main.rs:197:13 [INFO] [stdout] | [INFO] [stdout] 197 | antibot: antibot, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `antibot` [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/main.rs:199:13 [INFO] [stdout] | [INFO] [stdout] 199 | default_antibot: default_antibot, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `default_antibot` [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: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/main.rs:243:12 [INFO] [stdout] | [INFO] [stdout] 243 | if (start.elapsed()>std::time::Duration::from_secs(self.window as u64)){ [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 243 - if (start.elapsed()>std::time::Duration::from_secs(self.window as u64)){ [INFO] [stdout] 243 + if start.elapsed()>std::time::Duration::from_secs(self.window as u64) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/main.rs:247:12 [INFO] [stdout] | [INFO] [stdout] 247 | if (session.value_mut().0>self.limit){ [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 247 - if (session.value_mut().0>self.limit){ [INFO] [stdout] 247 + if session.value_mut().0>self.limit { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: type `custom_captcha_conf` should have an upper camel case name [INFO] [stdout] --> src/main.rs:340:8 [INFO] [stdout] | [INFO] [stdout] 340 | struct custom_captcha_conf{ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: convert the identifier to upper camel case: `CustomCaptchaConf` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_camel_case_types)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary trailing semicolon [INFO] [stdout] --> src/main.rs:861:370 [INFO] [stdout] | [INFO] [stdout] 861 | ....clone())).layer(Extension(json_custom.clone()));; [INFO] [stdout] | ^ help: remove this semicolon [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(redundant_semicolons)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:171:13 [INFO] [stdout] | [INFO] [stdout] 171 | let mut rate_limit_state: SafeTrie = SafeTrie::new(RwLock::new(Trie::new())); [INFO] [stdout] | ----^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:180:13 [INFO] [stdout] | [INFO] [stdout] 180 | let mut antibot: SafeTrie = SafeTrie::new(RwLock::new(Trie::new())); [INFO] [stdout] | ----^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:171:13 [INFO] [stdout] | [INFO] [stdout] 171 | let mut rate_limit_state: SafeTrie = SafeTrie::new(RwLock::new(Trie::new())); [INFO] [stdout] | ----^^^^^^^^^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:180:13 [INFO] [stdout] | [INFO] [stdout] 180 | let mut antibot: SafeTrie = SafeTrie::new(RwLock::new(Trie::new())); [INFO] [stdout] | ----^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:700:9 [INFO] [stdout] | [INFO] [stdout] 700 | let mut req = client.post(ccf.verify_url).form(¶ms); [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:700:9 [INFO] [stdout] | [INFO] [stdout] 700 | let mut req = client.post(ccf.verify_url).form(¶ms); [INFO] [stdout] | ----^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable expression [INFO] [stdout] --> src/main.rs:962:13 [INFO] [stdout] | [INFO] [stdout] 961 | return key; [INFO] [stdout] | ---------- any code following this expression is unreachable [INFO] [stdout] 962 | key.to_vec() [INFO] [stdout] | ^^^^^^^^^^^^ unreachable expression [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unreachable_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unreachable expression [INFO] [stdout] --> src/main.rs:962:13 [INFO] [stdout] | [INFO] [stdout] 961 | return key; [INFO] [stdout] | ---------- any code following this expression is unreachable [INFO] [stdout] 962 | key.to_vec() [INFO] [stdout] | ^^^^^^^^^^^^ unreachable expression [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unreachable_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:241:22 [INFO] [stdout] | [INFO] [stdout] 241 | let ( count, mut start) = *session; [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `count` [INFO] [stdout] --> src/main.rs:241:15 [INFO] [stdout] | [INFO] [stdout] 241 | let ( count, mut start) = *session; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_count` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:241:22 [INFO] [stdout] | [INFO] [stdout] 241 | let ( count, mut start) = *session; [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `count` [INFO] [stdout] --> src/main.rs:241:15 [INFO] [stdout] | [INFO] [stdout] 241 | let ( count, mut start) = *session; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_count` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `h` [INFO] [stdout] --> src/main.rs:625:18 [INFO] [stdout] | [INFO] [stdout] 625 | Some(h) => { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_h` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `h` [INFO] [stdout] --> src/main.rs:625:18 [INFO] [stdout] | [INFO] [stdout] 625 | Some(h) => { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_h` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `E` [INFO] [stdout] --> src/main.rs:833:13 [INFO] [stdout] | [INFO] [stdout] 833 | Err(E) => { println!("\nInvalid config file. Delete to restore structure\n"); return; } [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_E` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `E` [INFO] [stdout] --> src/main.rs:845:13 [INFO] [stdout] | [INFO] [stdout] 845 | Err(E) => { println!("\nInvalid config file. Delete to restore structure\n"); return; } [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_E` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `isnedtoreturn` is never read [INFO] [stdout] --> src/main.rs:839:9 [INFO] [stdout] | [INFO] [stdout] 839 | isnedtoreturn=true; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `default` is never used [INFO] [stdout] --> src/main.rs:151:8 [INFO] [stdout] | [INFO] [stdout] 150 | impl Conf { [INFO] [stdout] | --------- associated function in this implementation [INFO] [stdout] 151 | fn default()-> Self{ [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/main.rs:222:12 [INFO] [stdout] | [INFO] [stdout] 221 | impl RateLimitState { [INFO] [stdout] | ------------------- associated function in this implementation [INFO] [stdout] 222 | pub fn new(_limit: usize, _window: u32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `challenge_ts`, `hostname`, and `error_codes` are never read [INFO] [stdout] --> src/main.rs:326:5 [INFO] [stdout] | [INFO] [stdout] 323 | struct TurnstileResponse { [INFO] [stdout] | ----------------- fields in this struct [INFO] [stdout] ... [INFO] [stdout] 326 | challenge_ts: Option, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] 327 | #[serde(default)] [INFO] [stdout] 328 | hostname: Option, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 329 | #[serde(default)] [INFO] [stdout] 330 | error_codes: Option>, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/captcha.rs:102:13 [INFO] [stdout] | [INFO] [stdout] 102 | / if let Some(l) = last_x { [INFO] [stdout] 103 | | if dir != l { [INFO] [stdout] 104 | | cd += 1; [INFO] [stdout] 105 | | } [INFO] [stdout] 106 | | } [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] 102 ~ if let Some(l) = last_x [INFO] [stdout] 103 ~ && dir != l { [INFO] [stdout] 104 | cd += 1; [INFO] [stdout] 105 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/captcha.rs:112:13 [INFO] [stdout] | [INFO] [stdout] 112 | / if let Some(l) = last_y { [INFO] [stdout] 113 | | if dir != l { [INFO] [stdout] 114 | | cd += 1; [INFO] [stdout] 115 | | } [INFO] [stdout] 116 | | } [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] 112 ~ if let Some(l) = last_y [INFO] [stdout] 113 ~ && dir != l { [INFO] [stdout] 114 | cd += 1; [INFO] [stdout] 115 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `CAPTCHA` contains a capitalized acronym [INFO] [stdout] --> src/main.rs:37:5 [INFO] [stdout] | [INFO] [stdout] 37 | CAPTCHA, [INFO] [stdout] | ^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Captcha` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `CUSTOM` contains a capitalized acronym [INFO] [stdout] --> src/main.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 39 | CUSTOM, [INFO] [stdout] | ^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Custom` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `NONE` contains a capitalized acronym [INFO] [stdout] --> src/main.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | NONE [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `None` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:46:13 [INFO] [stdout] | [INFO] [stdout] 46 | return AntibotTypes::CAPTCHA; [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] 46 - return AntibotTypes::CAPTCHA; [INFO] [stdout] 46 + AntibotTypes::CAPTCHA [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | return AntibotTypes::PoW; [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] 49 - return AntibotTypes::PoW; [INFO] [stdout] 49 + AntibotTypes::PoW [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:52:13 [INFO] [stdout] | [INFO] [stdout] 52 | return AntibotTypes::CUSTOM; [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] 52 - return AntibotTypes::CUSTOM; [INFO] [stdout] 52 + AntibotTypes::CUSTOM [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:54:17 [INFO] [stdout] | [INFO] [stdout] 54 | else { return AntibotTypes::NONE; } [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] 54 - else { return AntibotTypes::NONE; } [INFO] [stdout] 54 + else { AntibotTypes::NONE} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `E` [INFO] [stdout] --> src/main.rs:833:13 [INFO] [stdout] | [INFO] [stdout] 833 | Err(E) => { println!("\nInvalid config file. Delete to restore structure\n"); return; } [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_E` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `E` [INFO] [stdout] --> src/main.rs:845:13 [INFO] [stdout] | [INFO] [stdout] 845 | Err(E) => { println!("\nInvalid config file. Delete to restore structure\n"); return; } [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_E` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `isnedtoreturn` is never read [INFO] [stdout] --> src/main.rs:839:9 [INFO] [stdout] | [INFO] [stdout] 839 | isnedtoreturn=true; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `default` is never used [INFO] [stdout] --> src/main.rs:151:8 [INFO] [stdout] | [INFO] [stdout] 150 | impl Conf { [INFO] [stdout] | --------- associated function in this implementation [INFO] [stdout] 151 | fn default()-> Self{ [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/main.rs:222:12 [INFO] [stdout] | [INFO] [stdout] 221 | impl RateLimitState { [INFO] [stdout] | ------------------- associated function in this implementation [INFO] [stdout] 222 | pub fn new(_limit: usize, _window: u32) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `challenge_ts`, `hostname`, and `error_codes` are never read [INFO] [stdout] --> src/main.rs:326:5 [INFO] [stdout] | [INFO] [stdout] 323 | struct TurnstileResponse { [INFO] [stdout] | ----------------- fields in this struct [INFO] [stdout] ... [INFO] [stdout] 326 | challenge_ts: Option, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] 327 | #[serde(default)] [INFO] [stdout] 328 | hostname: Option, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 329 | #[serde(default)] [INFO] [stdout] 330 | error_codes: Option>, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:385:12 [INFO] [stdout] | [INFO] [stdout] 385 | ...if name != "host" && name != "content-length" && name != "date" && name!="Transfer-Encoding"&& name != "connection" && name != "content-encoding" && name != "date" { [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] 385 - if name != "host" && name != "content-length" && name != "date" && name!="Transfer-Encoding"&& name != "connection" && name != "content-encoding" && name != "date" { [INFO] [stdout] 385 + if !(name == "host" || name == "content-length" || name == "date" || name == "Transfer-Encoding" || name == "connection" || name == "content-encoding") { [INFO] [stdout] | [INFO] [stdout] 385 - if name != "host" && name != "content-length" && name != "date" && name!="Transfer-Encoding"&& name != "connection" && name != "content-encoding" && name != "date" { [INFO] [stdout] 385 + if name != "host" && name != "content-length" && name != "date" && name!="Transfer-Encoding" && name != "connection" && name != "content-encoding" { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/captcha.rs:102:13 [INFO] [stdout] | [INFO] [stdout] 102 | / if let Some(l) = last_x { [INFO] [stdout] 103 | | if dir != l { [INFO] [stdout] 104 | | cd += 1; [INFO] [stdout] 105 | | } [INFO] [stdout] 106 | | } [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] 102 ~ if let Some(l) = last_x [INFO] [stdout] 103 ~ && dir != l { [INFO] [stdout] 104 | cd += 1; [INFO] [stdout] 105 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/captcha.rs:112:13 [INFO] [stdout] | [INFO] [stdout] 112 | / if let Some(l) = last_y { [INFO] [stdout] 113 | | if dir != l { [INFO] [stdout] 114 | | cd += 1; [INFO] [stdout] 115 | | } [INFO] [stdout] 116 | | } [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] 112 ~ if let Some(l) = last_y [INFO] [stdout] 113 ~ && dir != l { [INFO] [stdout] 114 | cd += 1; [INFO] [stdout] 115 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:459:12 [INFO] [stdout] | [INFO] [stdout] 459 | ...if name != "host" && name != "content-length" && name != "date" && name!="Transfer-Encoding"&& name != "connection" && name != "content-encoding" && name != "date" { [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] help: try [INFO] [stdout] | [INFO] [stdout] 459 - if name != "host" && name != "content-length" && name != "date" && name!="Transfer-Encoding"&& name != "connection" && name != "content-encoding" && name != "date" { [INFO] [stdout] 459 + if !(name == "host" || name == "content-length" || name == "date" || name == "Transfer-Encoding" || name == "connection" || name == "content-encoding") { [INFO] [stdout] | [INFO] [stdout] 459 - if name != "host" && name != "content-length" && name != "date" && name!="Transfer-Encoding"&& name != "connection" && name != "content-encoding" && name != "date" { [INFO] [stdout] 459 + if name != "host" && name != "content-length" && name != "date" && name!="Transfer-Encoding" && name != "connection" && name != "content-encoding" { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `CAPTCHA` contains a capitalized acronym [INFO] [stdout] --> src/main.rs:37:5 [INFO] [stdout] | [INFO] [stdout] 37 | CAPTCHA, [INFO] [stdout] | ^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Captcha` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] = note: `#[warn(clippy::upper_case_acronyms)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `CUSTOM` contains a capitalized acronym [INFO] [stdout] --> src/main.rs:39:5 [INFO] [stdout] | [INFO] [stdout] 39 | CUSTOM, [INFO] [stdout] | ^^^^^^ help: consider making the acronym lowercase, except the initial letter: `Custom` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: name `NONE` contains a capitalized acronym [INFO] [stdout] --> src/main.rs:40:5 [INFO] [stdout] | [INFO] [stdout] 40 | NONE [INFO] [stdout] | ^^^^ help: consider making the acronym lowercase, except the initial letter: `None` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#upper_case_acronyms [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:46:13 [INFO] [stdout] | [INFO] [stdout] 46 | return AntibotTypes::CAPTCHA; [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] 46 - return AntibotTypes::CAPTCHA; [INFO] [stdout] 46 + AntibotTypes::CAPTCHA [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | return AntibotTypes::PoW; [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] 49 - return AntibotTypes::PoW; [INFO] [stdout] 49 + AntibotTypes::PoW [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:52:13 [INFO] [stdout] | [INFO] [stdout] 52 | return AntibotTypes::CUSTOM; [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] 52 - return AntibotTypes::CUSTOM; [INFO] [stdout] 52 + AntibotTypes::CUSTOM [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:54:17 [INFO] [stdout] | [INFO] [stdout] 54 | else { return AntibotTypes::NONE; } [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] 54 - else { return AntibotTypes::NONE; } [INFO] [stdout] 54 + else { AntibotTypes::NONE} [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/main.rs:528:8 [INFO] [stdout] | [INFO] [stdout] 528 | if conf.is_blacklist_rate_limit == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `conf.is_blacklist_rate_limit` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/main.rs:531:9 [INFO] [stdout] | [INFO] [stdout] 531 | / match state.get_ancestor(request.uri().path()) { [INFO] [stdout] 532 | | Some(h) => { [INFO] [stdout] 533 | | for (key, _rate_limit_state) in h.iter() { [INFO] [stdout] 534 | | let config_path = std::path::Path::new(key); [INFO] [stdout] ... | [INFO] [stdout] 546 | | None => {} [INFO] [stdout] 547 | | } [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] 531 ~ if let Some(h) = state.get_ancestor(request.uri().path()) { [INFO] [stdout] 532 + for (key, _rate_limit_state) in h.iter() { [INFO] [stdout] 533 + let config_path = std::path::Path::new(key); [INFO] [stdout] 534 + if request_path.starts_with(config_path) { [INFO] [stdout] 535 + if _rate_limit_state.check_rate_limit(&ip) == 429 { [INFO] [stdout] 536 + return ( [INFO] [stdout] 537 + StatusCode::TOO_MANY_REQUESTS, [INFO] [stdout] 538 + axum::response::Html(E429.as_str()) [INFO] [stdout] 539 + ).into_response(); [INFO] [stdout] 540 + } [INFO] [stdout] 541 + break; [INFO] [stdout] 542 + } [INFO] [stdout] 543 + } [INFO] [stdout] 544 + } [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/main.rs:553:9 [INFO] [stdout] | [INFO] [stdout] 553 | / match state.get_ancestor(request.uri().path()) { [INFO] [stdout] 554 | | Some(h) => { [INFO] [stdout] 555 | | for (key, _rate_limit_state) in h.iter() { [INFO] [stdout] 556 | | let config_path = std::path::Path::new(key); [INFO] [stdout] ... | [INFO] [stdout] 564 | | None => {} [INFO] [stdout] 565 | | } [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] 553 ~ if let Some(h) = state.get_ancestor(request.uri().path()) { [INFO] [stdout] 554 + for (key, _rate_limit_state) in h.iter() { [INFO] [stdout] 555 + let config_path = std::path::Path::new(key); [INFO] [stdout] 556 + if request_path.starts_with(config_path) { [INFO] [stdout] 557 + [INFO] [stdout] 558 + empty = false; [INFO] [stdout] 559 + break; [INFO] [stdout] 560 + } [INFO] [stdout] 561 + } [INFO] [stdout] 562 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/main.rs:583:8 [INFO] [stdout] | [INFO] [stdout] 583 | if conf.is_blacklist_antibot == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!conf.is_blacklist_antibot` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/main.rs:586:9 [INFO] [stdout] | [INFO] [stdout] 586 | / match state.get_ancestor(request.uri().path()) { [INFO] [stdout] 587 | | Some(h) => { [INFO] [stdout] 588 | | for (key, antbt) in h.iter() { [INFO] [stdout] 589 | | let config_path = std::path::Path::new(key); [INFO] [stdout] ... | [INFO] [stdout] 615 | | None => {} [INFO] [stdout] 616 | | } [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] 586 ~ if let Some(h) = state.get_ancestor(request.uri().path()) { [INFO] [stdout] 587 + for (key, antbt) in h.iter() { [INFO] [stdout] 588 + let config_path = std::path::Path::new(key); [INFO] [stdout] 589 + if request_path.starts_with(config_path) { [INFO] [stdout] 590 + if matches!( antbt , AntibotTypes::PoW) && user_cookie != "1" { [INFO] [stdout] 591 + return ( [INFO] [stdout] 592 + StatusCode::OK, [INFO] [stdout] 593 + axum::response::Html(PoW.as_str()) [INFO] [stdout] 594 + ).into_response(); [INFO] [stdout] 595 + } [INFO] [stdout] 596 + else if matches!( antbt , AntibotTypes::CAPTCHA) && user_cookie != "1" { [INFO] [stdout] 597 + return ( [INFO] [stdout] 598 + StatusCode::OK, [INFO] [stdout] 599 + axum::response::Html(Captcha.as_str()) [INFO] [stdout] 600 + ).into_response(); [INFO] [stdout] 601 + } [INFO] [stdout] 602 + else if user_cookie != "1" { [INFO] [stdout] 603 + return ( [INFO] [stdout] 604 + StatusCode::OK, [INFO] [stdout] 605 + axum::response::Html(Custom.as_str()) [INFO] [stdout] 606 + ).into_response(); [INFO] [stdout] 607 + } [INFO] [stdout] 608 + break [INFO] [stdout] 609 + } [INFO] [stdout] 610 + } [INFO] [stdout] 611 + [INFO] [stdout] 612 + [INFO] [stdout] 613 + } [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/main.rs:624:9 [INFO] [stdout] | [INFO] [stdout] 624 | / match state.get_ancestor(request.uri().path()) { [INFO] [stdout] 625 | | Some(h) => { [INFO] [stdout] 626 | | for (key, _antibot_type) in state.iter() { [INFO] [stdout] 627 | | let config_path = std::path::Path::new(key); [INFO] [stdout] ... | [INFO] [stdout] 634 | | None => {} [INFO] [stdout] 635 | | } [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] 624 ~ if let Some(h) = state.get_ancestor(request.uri().path()) { [INFO] [stdout] 625 + for (key, _antibot_type) in state.iter() { [INFO] [stdout] 626 + let config_path = std::path::Path::new(key); [INFO] [stdout] 627 + if request_path.starts_with(config_path) { [INFO] [stdout] 628 + empty = false; [INFO] [stdout] 629 + break; [INFO] [stdout] 630 + } [INFO] [stdout] 631 + } [INFO] [stdout] 632 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:730:5 [INFO] [stdout] | [INFO] [stdout] 730 | return (StatusCode::BAD_REQUEST).into_response(); [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] 730 - return (StatusCode::BAD_REQUEST).into_response(); [INFO] [stdout] 730 + (StatusCode::BAD_REQUEST).into_response() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:776:5 [INFO] [stdout] | [INFO] [stdout] 776 | return (StatusCode::OK).into_response(); [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] 776 - return (StatusCode::OK).into_response(); [INFO] [stdout] 776 + (StatusCode::OK).into_response() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/main.rs:826:15 [INFO] [stdout] | [INFO] [stdout] 826 | if cfg == "".to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `""` [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/main.rs:838:15 [INFO] [stdout] | [INFO] [stdout] 838 | if cfg == "".to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `""` [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: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/main.rs:883:12 [INFO] [stdout] | [INFO] [stdout] 883 | if e.is_secure==false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `!e.is_secure` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> src/main.rs:951:5 [INFO] [stdout] | [INFO] [stdout] 938 | / let str_content =match std::fs::read_to_string(path){ [INFO] [stdout] 939 | | Ok(string_content) => string_content, [INFO] [stdout] 940 | | Err(_) => { [INFO] [stdout] 941 | | if path == "config.json" { [INFO] [stdout] ... | [INFO] [stdout] 949 | | }; [INFO] [stdout] | |______- unnecessary `let` binding [INFO] [stdout] 950 | [INFO] [stdout] 951 | str_content [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 938 ~ [INFO] [stdout] 939 | [INFO] [stdout] 940 ~ match std::fs::read_to_string(path){ [INFO] [stdout] 941 + Ok(string_content) => string_content, [INFO] [stdout] 942 + Err(_) => { [INFO] [stdout] 943 + if path == "config.json" { [INFO] [stdout] 944 + std::fs::write("config.json", BASE_CONFIG_EXAMPLE); [INFO] [stdout] 945 + } [INFO] [stdout] 946 + else { [INFO] [stdout] 947 + std::fs::write(path, BASE_CUSTOM_CAPTCHA_CONFIG_EXAMPLE); [INFO] [stdout] 948 + } [INFO] [stdout] 949 + "".to_string() [INFO] [stdout] 950 + } [INFO] [stdout] 951 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/main.rs:974:9 [INFO] [stdout] | [INFO] [stdout] 974 | / for i in 0..64{ [INFO] [stdout] 975 | | key[i] = content[i]; [INFO] [stdout] 976 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `key.copy_from_slice(&content[..64]);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] = note: `#[warn(clippy::manual_memcpy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `Custom` should have an upper case name [INFO] [stdout] --> src/main.rs:359:8 [INFO] [stdout] | [INFO] [stdout] 359 | static Custom: Lazy = Lazy::::new(|| CustomTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_upper_case_globals)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 359 - static Custom: Lazy = Lazy::::new(|| CustomTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] 359 + static CUSTOM: Lazy = Lazy::::new(|| CustomTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `Captcha` should have an upper case name [INFO] [stdout] --> src/main.rs:361:8 [INFO] [stdout] | [INFO] [stdout] 361 | static Captcha: Lazy = Lazy::::new(|| CaptchaTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 361 - static Captcha: Lazy = Lazy::::new(|| CaptchaTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] 361 + static CAPTCHA: Lazy = Lazy::::new(|| CaptchaTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `PoW` should have an upper case name [INFO] [stdout] --> src/main.rs:363:8 [INFO] [stdout] | [INFO] [stdout] 363 | static PoW: Lazy = Lazy::::new(|| PoWTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 363 - static PoW: Lazy = Lazy::::new(|| PoWTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] 363 + static PO_W: Lazy = Lazy::::new(|| PoWTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `E` should have a snake case name [INFO] [stdout] --> src/main.rs:833:13 [INFO] [stdout] | [INFO] [stdout] 833 | Err(E) => { println!("\nInvalid config file. Delete to restore structure\n"); return; } [INFO] [stdout] | ^ help: convert the identifier to snake case: `e` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `E` should have a snake case name [INFO] [stdout] --> src/main.rs:845:13 [INFO] [stdout] | [INFO] [stdout] 845 | Err(E) => { println!("\nInvalid config file. Delete to restore structure\n"); return; } [INFO] [stdout] | ^ help: convert the identifier to snake case: `e` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/main.rs:942:17 [INFO] [stdout] | [INFO] [stdout] 942 | std::fs::write("config.json", BASE_CONFIG_EXAMPLE); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 942 | let _ = std::fs::write("config.json", BASE_CONFIG_EXAMPLE); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/main.rs:945:17 [INFO] [stdout] | [INFO] [stdout] 945 | std::fs::write(path, BASE_CUSTOM_CAPTCHA_CONFIG_EXAMPLE); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 945 | let _ = std::fs::write(path, BASE_CUSTOM_CAPTCHA_CONFIG_EXAMPLE); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/main.rs:960:13 [INFO] [stdout] | [INFO] [stdout] 960 | std::fs::write(".SECRETKEY", key); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 960 | let _ = std::fs::write(".SECRETKEY", key); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/main.rs:970:9 [INFO] [stdout] | [INFO] [stdout] 970 | std::fs::write(".SECRETKEY", key); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 970 | let _ = std::fs::write(".SECRETKEY", key); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:385:12 [INFO] [stdout] | [INFO] [stdout] 385 | ...if name != "host" && name != "content-length" && name != "date" && name!="Transfer-Encoding"&& name != "connection" && name != "content-encoding" && name != "date" { [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] 385 - if name != "host" && name != "content-length" && name != "date" && name!="Transfer-Encoding"&& name != "connection" && name != "content-encoding" && name != "date" { [INFO] [stdout] 385 + if !(name == "host" || name == "content-length" || name == "date" || name == "Transfer-Encoding" || name == "connection" || name == "content-encoding") { [INFO] [stdout] | [INFO] [stdout] 385 - if name != "host" && name != "content-length" && name != "date" && name!="Transfer-Encoding"&& name != "connection" && name != "content-encoding" && name != "date" { [INFO] [stdout] 385 + if name != "host" && name != "content-length" && name != "date" && name!="Transfer-Encoding" && name != "connection" && name != "content-encoding" { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:459:12 [INFO] [stdout] | [INFO] [stdout] 459 | ...if name != "host" && name != "content-length" && name != "date" && name!="Transfer-Encoding"&& name != "connection" && name != "content-encoding" && name != "date" { [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] help: try [INFO] [stdout] | [INFO] [stdout] 459 - if name != "host" && name != "content-length" && name != "date" && name!="Transfer-Encoding"&& name != "connection" && name != "content-encoding" && name != "date" { [INFO] [stdout] 459 + if !(name == "host" || name == "content-length" || name == "date" || name == "Transfer-Encoding" || name == "connection" || name == "content-encoding") { [INFO] [stdout] | [INFO] [stdout] 459 - if name != "host" && name != "content-length" && name != "date" && name!="Transfer-Encoding"&& name != "connection" && name != "content-encoding" && name != "date" { [INFO] [stdout] 459 + if name != "host" && name != "content-length" && name != "date" && name!="Transfer-Encoding" && name != "connection" && name != "content-encoding" { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against true are unnecessary [INFO] [stdout] --> src/main.rs:528:8 [INFO] [stdout] | [INFO] [stdout] 528 | if conf.is_blacklist_rate_limit == true { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `conf.is_blacklist_rate_limit` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/main.rs:531:9 [INFO] [stdout] | [INFO] [stdout] 531 | / match state.get_ancestor(request.uri().path()) { [INFO] [stdout] 532 | | Some(h) => { [INFO] [stdout] 533 | | for (key, _rate_limit_state) in h.iter() { [INFO] [stdout] 534 | | let config_path = std::path::Path::new(key); [INFO] [stdout] ... | [INFO] [stdout] 546 | | None => {} [INFO] [stdout] 547 | | } [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] 531 ~ if let Some(h) = state.get_ancestor(request.uri().path()) { [INFO] [stdout] 532 + for (key, _rate_limit_state) in h.iter() { [INFO] [stdout] 533 + let config_path = std::path::Path::new(key); [INFO] [stdout] 534 + if request_path.starts_with(config_path) { [INFO] [stdout] 535 + if _rate_limit_state.check_rate_limit(&ip) == 429 { [INFO] [stdout] 536 + return ( [INFO] [stdout] 537 + StatusCode::TOO_MANY_REQUESTS, [INFO] [stdout] 538 + axum::response::Html(E429.as_str()) [INFO] [stdout] 539 + ).into_response(); [INFO] [stdout] 540 + } [INFO] [stdout] 541 + break; [INFO] [stdout] 542 + } [INFO] [stdout] 543 + } [INFO] [stdout] 544 + } [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/main.rs:553:9 [INFO] [stdout] | [INFO] [stdout] 553 | / match state.get_ancestor(request.uri().path()) { [INFO] [stdout] 554 | | Some(h) => { [INFO] [stdout] 555 | | for (key, _rate_limit_state) in h.iter() { [INFO] [stdout] 556 | | let config_path = std::path::Path::new(key); [INFO] [stdout] ... | [INFO] [stdout] 564 | | None => {} [INFO] [stdout] 565 | | } [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] 553 ~ if let Some(h) = state.get_ancestor(request.uri().path()) { [INFO] [stdout] 554 + for (key, _rate_limit_state) in h.iter() { [INFO] [stdout] 555 + let config_path = std::path::Path::new(key); [INFO] [stdout] 556 + if request_path.starts_with(config_path) { [INFO] [stdout] 557 + [INFO] [stdout] 558 + empty = false; [INFO] [stdout] 559 + break; [INFO] [stdout] 560 + } [INFO] [stdout] 561 + } [INFO] [stdout] 562 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/main.rs:583:8 [INFO] [stdout] | [INFO] [stdout] 583 | if conf.is_blacklist_antibot == false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `!conf.is_blacklist_antibot` [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/main.rs:586:9 [INFO] [stdout] | [INFO] [stdout] 586 | / match state.get_ancestor(request.uri().path()) { [INFO] [stdout] 587 | | Some(h) => { [INFO] [stdout] 588 | | for (key, antbt) in h.iter() { [INFO] [stdout] 589 | | let config_path = std::path::Path::new(key); [INFO] [stdout] ... | [INFO] [stdout] 615 | | None => {} [INFO] [stdout] 616 | | } [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] 586 ~ if let Some(h) = state.get_ancestor(request.uri().path()) { [INFO] [stdout] 587 + for (key, antbt) in h.iter() { [INFO] [stdout] 588 + let config_path = std::path::Path::new(key); [INFO] [stdout] 589 + if request_path.starts_with(config_path) { [INFO] [stdout] 590 + if matches!( antbt , AntibotTypes::PoW) && user_cookie != "1" { [INFO] [stdout] 591 + return ( [INFO] [stdout] 592 + StatusCode::OK, [INFO] [stdout] 593 + axum::response::Html(PoW.as_str()) [INFO] [stdout] 594 + ).into_response(); [INFO] [stdout] 595 + } [INFO] [stdout] 596 + else if matches!( antbt , AntibotTypes::CAPTCHA) && user_cookie != "1" { [INFO] [stdout] 597 + return ( [INFO] [stdout] 598 + StatusCode::OK, [INFO] [stdout] 599 + axum::response::Html(Captcha.as_str()) [INFO] [stdout] 600 + ).into_response(); [INFO] [stdout] 601 + } [INFO] [stdout] 602 + else if user_cookie != "1" { [INFO] [stdout] 603 + return ( [INFO] [stdout] 604 + StatusCode::OK, [INFO] [stdout] 605 + axum::response::Html(Custom.as_str()) [INFO] [stdout] 606 + ).into_response(); [INFO] [stdout] 607 + } [INFO] [stdout] 608 + break [INFO] [stdout] 609 + } [INFO] [stdout] 610 + } [INFO] [stdout] 611 + [INFO] [stdout] 612 + [INFO] [stdout] 613 + } [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/main.rs:624:9 [INFO] [stdout] | [INFO] [stdout] 624 | / match state.get_ancestor(request.uri().path()) { [INFO] [stdout] 625 | | Some(h) => { [INFO] [stdout] 626 | | for (key, _antibot_type) in state.iter() { [INFO] [stdout] 627 | | let config_path = std::path::Path::new(key); [INFO] [stdout] ... | [INFO] [stdout] 634 | | None => {} [INFO] [stdout] 635 | | } [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] 624 ~ if let Some(h) = state.get_ancestor(request.uri().path()) { [INFO] [stdout] 625 + for (key, _antibot_type) in state.iter() { [INFO] [stdout] 626 + let config_path = std::path::Path::new(key); [INFO] [stdout] 627 + if request_path.starts_with(config_path) { [INFO] [stdout] 628 + empty = false; [INFO] [stdout] 629 + break; [INFO] [stdout] 630 + } [INFO] [stdout] 631 + } [INFO] [stdout] 632 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:730:5 [INFO] [stdout] | [INFO] [stdout] 730 | return (StatusCode::BAD_REQUEST).into_response(); [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] 730 - return (StatusCode::BAD_REQUEST).into_response(); [INFO] [stdout] 730 + (StatusCode::BAD_REQUEST).into_response() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/main.rs:776:5 [INFO] [stdout] | [INFO] [stdout] 776 | return (StatusCode::OK).into_response(); [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] 776 - return (StatusCode::OK).into_response(); [INFO] [stdout] 776 + (StatusCode::OK).into_response() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/main.rs:826:15 [INFO] [stdout] | [INFO] [stdout] 826 | if cfg == "".to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `""` [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/main.rs:838:15 [INFO] [stdout] | [INFO] [stdout] 838 | if cfg == "".to_string() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `""` [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: equality checks against false can be replaced by a negation [INFO] [stdout] --> src/main.rs:883:12 [INFO] [stdout] | [INFO] [stdout] 883 | if e.is_secure==false { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `!e.is_secure` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> src/main.rs:951:5 [INFO] [stdout] | [INFO] [stdout] 938 | / let str_content =match std::fs::read_to_string(path){ [INFO] [stdout] 939 | | Ok(string_content) => string_content, [INFO] [stdout] 940 | | Err(_) => { [INFO] [stdout] 941 | | if path == "config.json" { [INFO] [stdout] ... | [INFO] [stdout] 949 | | }; [INFO] [stdout] | |______- unnecessary `let` binding [INFO] [stdout] 950 | [INFO] [stdout] 951 | str_content [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 938 ~ [INFO] [stdout] 939 | [INFO] [stdout] 940 ~ match std::fs::read_to_string(path){ [INFO] [stdout] 941 + Ok(string_content) => string_content, [INFO] [stdout] 942 + Err(_) => { [INFO] [stdout] 943 + if path == "config.json" { [INFO] [stdout] 944 + std::fs::write("config.json", BASE_CONFIG_EXAMPLE); [INFO] [stdout] 945 + } [INFO] [stdout] 946 + else { [INFO] [stdout] 947 + std::fs::write(path, BASE_CUSTOM_CAPTCHA_CONFIG_EXAMPLE); [INFO] [stdout] 948 + } [INFO] [stdout] 949 + "".to_string() [INFO] [stdout] 950 + } [INFO] [stdout] 951 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: it looks like you're manually copying between slices [INFO] [stdout] --> src/main.rs:974:9 [INFO] [stdout] | [INFO] [stdout] 974 | / for i in 0..64{ [INFO] [stdout] 975 | | key[i] = content[i]; [INFO] [stdout] 976 | | } [INFO] [stdout] | |_________^ help: try replacing the loop by: `key.copy_from_slice(&content[..64]);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy [INFO] [stdout] = note: `#[warn(clippy::manual_memcpy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `Custom` should have an upper case name [INFO] [stdout] --> src/main.rs:359:8 [INFO] [stdout] | [INFO] [stdout] 359 | static Custom: Lazy = Lazy::::new(|| CustomTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_upper_case_globals)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 359 - static Custom: Lazy = Lazy::::new(|| CustomTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] 359 + static CUSTOM: Lazy = Lazy::::new(|| CustomTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `Captcha` should have an upper case name [INFO] [stdout] --> src/main.rs:361:8 [INFO] [stdout] | [INFO] [stdout] 361 | static Captcha: Lazy = Lazy::::new(|| CaptchaTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 361 - static Captcha: Lazy = Lazy::::new(|| CaptchaTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] 361 + static CAPTCHA: Lazy = Lazy::::new(|| CaptchaTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: static variable `PoW` should have an upper case name [INFO] [stdout] --> src/main.rs:363:8 [INFO] [stdout] | [INFO] [stdout] 363 | static PoW: Lazy = Lazy::::new(|| PoWTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] help: convert the identifier to upper case [INFO] [stdout] | [INFO] [stdout] 363 - static PoW: Lazy = Lazy::::new(|| PoWTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] 363 + static PO_W: Lazy = Lazy::::new(|| PoWTemplate.render().unwrap_or("500".to_string())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `E` should have a snake case name [INFO] [stdout] --> src/main.rs:833:13 [INFO] [stdout] | [INFO] [stdout] 833 | Err(E) => { println!("\nInvalid config file. Delete to restore structure\n"); return; } [INFO] [stdout] | ^ help: convert the identifier to snake case: `e` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `E` should have a snake case name [INFO] [stdout] --> src/main.rs:845:13 [INFO] [stdout] | [INFO] [stdout] 845 | Err(E) => { println!("\nInvalid config file. Delete to restore structure\n"); return; } [INFO] [stdout] | ^ help: convert the identifier to snake case: `e` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/main.rs:942:17 [INFO] [stdout] | [INFO] [stdout] 942 | std::fs::write("config.json", BASE_CONFIG_EXAMPLE); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] = note: `#[warn(unused_must_use)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 942 | let _ = std::fs::write("config.json", BASE_CONFIG_EXAMPLE); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/main.rs:945:17 [INFO] [stdout] | [INFO] [stdout] 945 | std::fs::write(path, BASE_CUSTOM_CAPTCHA_CONFIG_EXAMPLE); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 945 | let _ = std::fs::write(path, BASE_CUSTOM_CAPTCHA_CONFIG_EXAMPLE); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/main.rs:960:13 [INFO] [stdout] | [INFO] [stdout] 960 | std::fs::write(".SECRETKEY", key); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 960 | let _ = std::fs::write(".SECRETKEY", key); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused `std::result::Result` that must be used [INFO] [stdout] --> src/main.rs:970:9 [INFO] [stdout] | [INFO] [stdout] 970 | std::fs::write(".SECRETKEY", key); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this `Result` may be an `Err` variant, which should be handled [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 970 | let _ = std::fs::write(".SECRETKEY", key); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 00s [INFO] running `Command { std: "docker" "inspect" "f917c737b2f6536d38a806a1fffc7ac3cd79e804a569f90d105700f19a705ad6", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "f917c737b2f6536d38a806a1fffc7ac3cd79e804a569f90d105700f19a705ad6", kill_on_drop: false }` [INFO] [stdout] f917c737b2f6536d38a806a1fffc7ac3cd79e804a569f90d105700f19a705ad6