[INFO] fetching crate rusty-socks 0.2.0... [INFO] linting rusty-socks-0.2.0 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate rusty-socks 0.2.0 into /workspace/builds/worker-7-tc1/source [INFO] started tweaking crates.io crate rusty-socks 0.2.0 [INFO] removed 0 missing examples [INFO] removed 0 missing tests [INFO] finished tweaking crates.io crate rusty-socks 0.2.0 [INFO] tweaked toml for crates.io crate rusty-socks 0.2.0 written to /workspace/builds/worker-7-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate rusty-socks 0.2.0 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 crates.io crate rusty-socks 0.2.0 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded ring v0.17.12 [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] 664472aff32531b6f58c0a566864fdea6bfbba6a63828374a6908517eab7c84e [INFO] running `Command { std: "docker" "start" "-a" "664472aff32531b6f58c0a566864fdea6bfbba6a63828374a6908517eab7c84e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "664472aff32531b6f58c0a566864fdea6bfbba6a63828374a6908517eab7c84e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "664472aff32531b6f58c0a566864fdea6bfbba6a63828374a6908517eab7c84e", kill_on_drop: false }` [INFO] [stdout] 664472aff32531b6f58c0a566864fdea6bfbba6a63828374a6908517eab7c84e [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] c95ca1056ff19d8214a36a40ca2bc36f6aac730b9f531c7d954c2b5682527a7c [INFO] running `Command { std: "docker" "start" "-a" "c95ca1056ff19d8214a36a40ca2bc36f6aac730b9f531c7d954c2b5682527a7c", kill_on_drop: false }` [INFO] [stderr] Compiling syn v2.0.117 [INFO] [stderr] Compiling jobserver v0.1.34 [INFO] [stderr] Checking getrandom v0.2.17 [INFO] [stderr] Checking parking_lot_core v0.9.12 [INFO] [stderr] Checking socket2 v0.5.10 [INFO] [stderr] Checking hashbrown v0.16.1 [INFO] [stderr] Compiling time-macros v0.2.27 [INFO] [stderr] Checking tracing v0.1.44 [INFO] [stderr] Checking nom v7.1.3 [INFO] [stderr] Checking ppv-lite86 v0.2.21 [INFO] [stderr] Checking num-bigint v0.4.6 [INFO] [stderr] Checking sha1 v0.10.6 [INFO] [stderr] Compiling thiserror v2.0.18 [INFO] [stderr] Compiling rustls v0.22.4 [INFO] [stderr] Compiling multer v2.1.0 [INFO] [stderr] Compiling oid-registry v0.7.1 [INFO] [stderr] Compiling aws-lc-rs v1.16.0 [INFO] [stderr] Compiling rustls v0.21.12 [INFO] [stderr] Checking parking_lot v0.12.5 [INFO] [stderr] Checking rand_core v0.6.4 [INFO] [stderr] Compiling cc v1.2.56 [INFO] [stderr] Checking regex-automata v0.4.14 [INFO] [stderr] Checking headers-core v0.2.0 [INFO] [stderr] Checking base64ct v1.8.3 [INFO] [stderr] Checking pem v3.0.5 [INFO] [stderr] Checking headers v0.3.9 [INFO] [stderr] Checking rustls-pemfile v2.2.0 [INFO] [stderr] Checking blake2 v0.10.6 [INFO] [stderr] Checking is-terminal v0.4.17 [INFO] [stderr] Checking humantime v2.3.0 [INFO] [stderr] Checking indexmap v2.13.0 [INFO] [stderr] Checking signature v2.2.0 [INFO] [stderr] Checking lru v0.16.3 [INFO] [stderr] Checking password-hash v0.5.0 [INFO] [stderr] Checking dotenvy v0.15.7 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand v0.8.5 [INFO] [stderr] Checking argon2 v0.5.3 [INFO] [stderr] Checking time v0.3.47 [INFO] [stderr] Compiling cmake v0.1.57 [INFO] [stderr] Checking rusticata-macros v4.1.0 [INFO] [stderr] Compiling ring v0.17.12 [INFO] [stderr] Compiling openssl-sys v0.9.111 [INFO] [stderr] Compiling aws-lc-sys v0.37.1 [INFO] [stderr] Compiling openssl v0.10.75 [INFO] [stderr] Compiling native-tls v0.2.18 [INFO] [stderr] Checking regex v1.12.3 [INFO] [stderr] Checking env_logger v0.10.2 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Checking rustls-webpki v0.102.8 [INFO] [stderr] Checking rustls-webpki v0.101.7 [INFO] [stderr] Checking sct v0.7.1 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling zerovec-derive v0.11.2 [INFO] [stderr] Compiling tokio-macros v2.5.0 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.8.1 [INFO] [stderr] Compiling futures-macro v0.3.31 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Compiling asn1-rs-derive v0.5.1 [INFO] [stderr] Compiling asn1-rs-impl v0.2.0 [INFO] [stderr] Compiling openssl-macros v0.1.1 [INFO] [stderr] Compiling thiserror-impl v2.0.18 [INFO] [stderr] Compiling pin-project-internal v1.1.11 [INFO] [stderr] Checking tokio v1.45.1 [INFO] [stderr] Compiling async-trait v0.1.88 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Checking thiserror v1.0.69 [INFO] [stderr] Checking asn1-rs v0.6.2 [INFO] [stderr] Checking yoke v0.8.1 [INFO] [stderr] Checking zerovec v0.11.5 [INFO] [stderr] Checking zerotrie v0.2.3 [INFO] [stderr] Checking simple_asn1 v0.6.3 [INFO] [stderr] Checking serde v1.0.228 [INFO] [stderr] Checking pin-project v1.1.11 [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] Checking serde_json v1.0.140 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking chrono v0.4.44 [INFO] [stderr] Checking der-parser v9.0.0 [INFO] [stderr] Checking uuid v1.17.0 [INFO] [stderr] Checking icu_provider v2.1.1 [INFO] [stderr] Checking x509-parser v0.16.0 [INFO] [stderr] Checking icu_properties v2.1.2 [INFO] [stderr] Checking icu_normalizer v2.1.1 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Checking idna v1.1.0 [INFO] [stderr] Checking url v2.5.4 [INFO] [stderr] Checking tokio-util v0.7.18 [INFO] [stderr] Checking tokio-rustls v0.25.0 [INFO] [stderr] Checking tokio-rustls v0.24.1 [INFO] [stderr] Checking tokio-native-tls v0.3.1 [INFO] [stderr] Checking tungstenite v0.21.0 [INFO] [stderr] Checking h2 v0.3.27 [INFO] [stderr] Checking tokio-tungstenite v0.21.0 [INFO] [stderr] Checking hyper v0.14.32 [INFO] [stderr] Checking jsonwebtoken v10.3.0 [INFO] [stderr] Checking warp v0.3.7 [INFO] [stderr] Checking hyper-tls v0.5.0 [INFO] [stderr] Checking reqwest v0.11.27 [INFO] [stderr] Checking rusty-socks v0.2.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/storage/message_store.rs:349:1 [INFO] [stdout] | [INFO] [stdout] 349 | / /// Async helper functions for convenient access to SharedMessageStore [INFO] [stdout] 350 | | [INFO] [stdout] | |_^ [INFO] [stdout] 351 | /// Add a message to the store asynchronously [INFO] [stdout] 352 | pub async fn add_message_async(store: &SharedMessageStore, message: Message) { [INFO] [stdout] | ------------------------------ the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the documentation should include the empty line include it in the comment [INFO] [stdout] | [INFO] [stdout] 350 | /// [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/storage/message_store.rs:349:1 [INFO] [stdout] | [INFO] [stdout] 349 | / /// Async helper functions for convenient access to SharedMessageStore [INFO] [stdout] 350 | | [INFO] [stdout] | |_^ [INFO] [stdout] 351 | /// Add a message to the store asynchronously [INFO] [stdout] 352 | pub async fn add_message_async(store: &SharedMessageStore, message: Message) { [INFO] [stdout] | ------------------------------ the comment documents this function [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments [INFO] [stdout] = note: `#[warn(clippy::empty_line_after_doc_comments)]` on by default [INFO] [stdout] = help: if the empty line is unintentional, remove it [INFO] [stdout] help: if the documentation should include the empty line include it in the comment [INFO] [stdout] | [INFO] [stdout] 350 | /// [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ApiKeyAuthProvider` [INFO] [stdout] --> src/auth/provider.rs:172:5 [INFO] [stdout] | [INFO] [stdout] 172 | / pub fn new() -> Self { [INFO] [stdout] 173 | | Self { [INFO] [stdout] 174 | | api_keys: HashMap::new(), [INFO] [stdout] 175 | | } [INFO] [stdout] 176 | | } [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] 171 + impl Default for ApiKeyAuthProvider { [INFO] [stdout] 172 + fn default() -> Self { [INFO] [stdout] 173 + Self::new() [INFO] [stdout] 174 + } [INFO] [stdout] 175 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `NoAuthProvider` [INFO] [stdout] --> src/auth/provider.rs:238:5 [INFO] [stdout] | [INFO] [stdout] 238 | / pub fn new() -> Self { [INFO] [stdout] 239 | | let default_user = AuthenticatedUser { [INFO] [stdout] 240 | | user_id: "anonymous".to_string(), [INFO] [stdout] 241 | | username: "Anonymous".to_string(), [INFO] [stdout] ... | [INFO] [stdout] 248 | | Self { default_user } [INFO] [stdout] 249 | | } [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] 237 + impl Default for NoAuthProvider { [INFO] [stdout] 238 + fn default() -> Self { [INFO] [stdout] 239 + Self::new() [INFO] [stdout] 240 + } [INFO] [stdout] 241 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `AuthManager` [INFO] [stdout] --> src/auth/provider.rs:274:5 [INFO] [stdout] | [INFO] [stdout] 274 | / pub fn new() -> Self { [INFO] [stdout] 275 | | Self { [INFO] [stdout] 276 | | providers: Vec::new(), [INFO] [stdout] 277 | | fallback_to_anonymous: false, [INFO] [stdout] 278 | | } [INFO] [stdout] 279 | | } [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] 273 + impl Default for AuthManager { [INFO] [stdout] 274 + fn default() -> Self { [INFO] [stdout] 275 + Self::new() [INFO] [stdout] 276 + } [INFO] [stdout] 277 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/auth/token.rs:280:14 [INFO] [stdout] | [INFO] [stdout] 280 | Some(auth_header[7..].to_string()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/auth/token.rs:279:5 [INFO] [stdout] | [INFO] [stdout] 279 | if auth_header.starts_with("Bearer ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 279 ~ if let Some() = auth_header.strip_prefix("Bearer ") { [INFO] [stdout] 280 ~ Some(.to_string()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ApiKeyAuthProvider` [INFO] [stdout] --> src/auth/provider.rs:172:5 [INFO] [stdout] | [INFO] [stdout] 172 | / pub fn new() -> Self { [INFO] [stdout] 173 | | Self { [INFO] [stdout] 174 | | api_keys: HashMap::new(), [INFO] [stdout] 175 | | } [INFO] [stdout] 176 | | } [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] 171 + impl Default for ApiKeyAuthProvider { [INFO] [stdout] 172 + fn default() -> Self { [INFO] [stdout] 173 + Self::new() [INFO] [stdout] 174 + } [INFO] [stdout] 175 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `NoAuthProvider` [INFO] [stdout] --> src/auth/provider.rs:238:5 [INFO] [stdout] | [INFO] [stdout] 238 | / pub fn new() -> Self { [INFO] [stdout] 239 | | let default_user = AuthenticatedUser { [INFO] [stdout] 240 | | user_id: "anonymous".to_string(), [INFO] [stdout] 241 | | username: "Anonymous".to_string(), [INFO] [stdout] ... | [INFO] [stdout] 248 | | Self { default_user } [INFO] [stdout] 249 | | } [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] 237 + impl Default for NoAuthProvider { [INFO] [stdout] 238 + fn default() -> Self { [INFO] [stdout] 239 + Self::new() [INFO] [stdout] 240 + } [INFO] [stdout] 241 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `AuthManager` [INFO] [stdout] --> src/auth/provider.rs:274:5 [INFO] [stdout] | [INFO] [stdout] 274 | / pub fn new() -> Self { [INFO] [stdout] 275 | | Self { [INFO] [stdout] 276 | | providers: Vec::new(), [INFO] [stdout] 277 | | fallback_to_anonymous: false, [INFO] [stdout] 278 | | } [INFO] [stdout] 279 | | } [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] 273 + impl Default for AuthManager { [INFO] [stdout] 274 + fn default() -> Self { [INFO] [stdout] 275 + Self::new() [INFO] [stdout] 276 + } [INFO] [stdout] 277 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/core/ip_extractor.rs:21:1 [INFO] [stdout] | [INFO] [stdout] 21 | / impl Default for IpExtractionConfig { [INFO] [stdout] 22 | | fn default() -> Self { [INFO] [stdout] 23 | | Self { [INFO] [stdout] 24 | | trust_proxy_headers: false, // Secure by default [INFO] [stdout] ... | [INFO] [stdout] 29 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 12 + #[derive(Default)] [INFO] [stdout] 13 | pub struct IpExtractionConfig { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/auth/token.rs:280:14 [INFO] [stdout] | [INFO] [stdout] 280 | Some(auth_header[7..].to_string()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/auth/token.rs:279:5 [INFO] [stdout] | [INFO] [stdout] 279 | if auth_header.starts_with("Bearer ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] = note: `#[warn(clippy::manual_strip)]` on by default [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 279 ~ if let Some() = auth_header.strip_prefix("Bearer ") { [INFO] [stdout] 280 ~ Some(.to_string()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/core/ip_extractor.rs:291:9 [INFO] [stdout] | [INFO] [stdout] 291 | config.trust_proxy_headers = true; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `core::ip_extractor::IpExtractionConfig { trust_proxy_headers: true, trusted_proxies: vec!["203.0.113.100".parse().unwrap()], ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/core/ip_extractor.rs:290:9 [INFO] [stdout] | [INFO] [stdout] 290 | let mut config = IpExtractionConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/core/message_handler.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | config.max_normalized_length = 2000; // Match MAX_MESSAGE_LENGTH [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `security::unicode_validation::UnicodeSecurityConfig { max_normalized_length: 2000, allow_mixed_scripts: false, allow_bidirectional: false, allow_private_use: false, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/core/message_handler.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | let mut config = UnicodeSecurityConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/core/message_handler.rs:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | config.max_normalized_length = 50; // Shorter limit for room names [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `security::unicode_validation::UnicodeSecurityConfig { max_normalized_length: 50, allow_mixed_scripts: false, allow_bidirectional: false, allow_private_use: false, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/core/message_handler.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | let mut config = UnicodeSecurityConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/core/ip_extractor.rs:21:1 [INFO] [stdout] | [INFO] [stdout] 21 | / impl Default for IpExtractionConfig { [INFO] [stdout] 22 | | fn default() -> Self { [INFO] [stdout] 23 | | Self { [INFO] [stdout] 24 | | trust_proxy_headers: false, // Secure by default [INFO] [stdout] ... | [INFO] [stdout] 29 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 12 + #[derive(Default)] [INFO] [stdout] 13 | pub struct IpExtractionConfig { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `UserTier` which implements the `Copy` trait [INFO] [stdout] --> src/core/message_handler.rs:412:72 [INFO] [stdout] | [INFO] [stdout] 412 | if !self.server.can_user_perform_operation(sender_id, user_ip, user_tier.clone(), OperationType::Message).await { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `user_tier` [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 `UserTier` which implements the `Copy` trait [INFO] [stdout] --> src/core/message_handler.rs:579:72 [INFO] [stdout] | [INFO] [stdout] 579 | if !self.server.can_user_perform_operation(sender_id, user_ip, user_tier.clone(), OperationType::RoomCreation).await { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `user_tier` [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: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/core/message_handler.rs:26:9 [INFO] [stdout] | [INFO] [stdout] 26 | config.max_normalized_length = 2000; // Match MAX_MESSAGE_LENGTH [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `security::unicode_validation::UnicodeSecurityConfig { max_normalized_length: 2000, allow_mixed_scripts: false, allow_bidirectional: false, allow_private_use: false, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/core/message_handler.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | let mut config = UnicodeSecurityConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/core/message_handler.rs:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | config.max_normalized_length = 50; // Shorter limit for room names [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `security::unicode_validation::UnicodeSecurityConfig { max_normalized_length: 50, allow_mixed_scripts: false, allow_bidirectional: false, allow_private_use: false, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/core/message_handler.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | let mut config = UnicodeSecurityConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `duration_hours` after checking its variant with `is_some` [INFO] [stdout] --> src/core/message_handler.rs:931:45 [INFO] [stdout] | [INFO] [stdout] 930 | let ban_type = if duration_hours.is_some() { [INFO] [stdout] | --------------------------- help: try: `if let Some() = duration_hours` [INFO] [stdout] 931 | format!("for {} hours", duration_hours.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `UserTier` which implements the `Copy` trait [INFO] [stdout] --> src/core/message_handler.rs:412:72 [INFO] [stdout] | [INFO] [stdout] 412 | if !self.server.can_user_perform_operation(sender_id, user_ip, user_tier.clone(), OperationType::Message).await { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `user_tier` [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 `UserTier` which implements the `Copy` trait [INFO] [stdout] --> src/core/message_handler.rs:579:72 [INFO] [stdout] | [INFO] [stdout] 579 | if !self.server.can_user_perform_operation(sender_id, user_ip, user_tier.clone(), OperationType::RoomCreation).await { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `user_tier` [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: called `unwrap` on `duration_hours` after checking its variant with `is_some` [INFO] [stdout] --> src/core/message_handler.rs:931:45 [INFO] [stdout] | [INFO] [stdout] 930 | let ban_type = if duration_hours.is_some() { [INFO] [stdout] | --------------------------- help: try: `if let Some() = duration_hours` [INFO] [stdout] 931 | format!("for {} hours", duration_hours.unwrap()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `MultiTierRateLimiter` [INFO] [stdout] --> src/core/multi_tier_rate_limiter.rs:212:5 [INFO] [stdout] | [INFO] [stdout] 212 | / pub fn new() -> Self { [INFO] [stdout] 213 | | let mut configs = HashMap::new(); [INFO] [stdout] ... | [INFO] [stdout] 268 | | } [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] 211 + impl Default for MultiTierRateLimiter { [INFO] [stdout] 212 + fn default() -> Self { [INFO] [stdout] 213 + Self::new() [INFO] [stdout] 214 + } [INFO] [stdout] 215 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `UserTier` which implements the `Copy` trait [INFO] [stdout] --> src/core/multi_tier_rate_limiter.rs:285:47 [INFO] [stdout] | [INFO] [stdout] 285 | let config = match self.configs.get(&(user_tier.clone(), operation.clone())) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `user_tier` [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 `OperationType` which implements the `Copy` trait [INFO] [stdout] --> src/core/multi_tier_rate_limiter.rs:285:66 [INFO] [stdout] | [INFO] [stdout] 285 | let config = match self.configs.get(&(user_tier.clone(), operation.clone())) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `operation` [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: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/core/room.rs:81:9 [INFO] [stdout] | [INFO] [stdout] 81 | / if !self.user_roles.contains_key(&client_id) { [INFO] [stdout] 82 | | self.user_roles.insert(client_id, UserRole::Member); [INFO] [stdout] 83 | | } [INFO] [stdout] | |_________^ help: try: `self.user_roles.entry(client_id).or_insert(UserRole::Member);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `RoomManager` [INFO] [stdout] --> src/core/room.rs:193:5 [INFO] [stdout] | [INFO] [stdout] 193 | / pub fn new() -> Self { [INFO] [stdout] 194 | | let default_room = Room::new("lobby".to_string()); [INFO] [stdout] 195 | | let default_room_id = default_room.id.clone(); [INFO] [stdout] ... | [INFO] [stdout] 205 | | } [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] 191 + impl Default for RoomManager { [INFO] [stdout] 192 + fn default() -> Self { [INFO] [stdout] 193 + Self::new() [INFO] [stdout] 194 + } [INFO] [stdout] 195 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/core/room.rs:644:21 [INFO] [stdout] | [INFO] [stdout] 644 | assert!(client_rooms.get(member_id).map_or(false, |rooms| rooms.contains(&room_id)), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 644 - assert!(client_rooms.get(member_id).map_or(false, |rooms| rooms.contains(&room_id)), [INFO] [stdout] 644 + assert!(client_rooms.get(member_id).is_some_and(|rooms| rooms.contains(&room_id)), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ServerManager` [INFO] [stdout] --> src/core/server.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | / pub fn new() -> Self { [INFO] [stdout] 31 | | // Default rate limits [INFO] [stdout] 32 | | let rate_limiter = Arc::new(RateLimiterManager::new(10, 60)); [INFO] [stdout] ... | [INFO] [stdout] 48 | | } [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] 28 + impl Default for ServerManager { [INFO] [stdout] 29 + fn default() -> Self { [INFO] [stdout] 30 + Self::new() [INFO] [stdout] 31 + } [INFO] [stdout] 32 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `MultiTierRateLimiter` [INFO] [stdout] --> src/core/multi_tier_rate_limiter.rs:212:5 [INFO] [stdout] | [INFO] [stdout] 212 | / pub fn new() -> Self { [INFO] [stdout] 213 | | let mut configs = HashMap::new(); [INFO] [stdout] ... | [INFO] [stdout] 268 | | } [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] 211 + impl Default for MultiTierRateLimiter { [INFO] [stdout] 212 + fn default() -> Self { [INFO] [stdout] 213 + Self::new() [INFO] [stdout] 214 + } [INFO] [stdout] 215 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `UserTier` which implements the `Copy` trait [INFO] [stdout] --> src/core/multi_tier_rate_limiter.rs:285:47 [INFO] [stdout] | [INFO] [stdout] 285 | let config = match self.configs.get(&(user_tier.clone(), operation.clone())) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `user_tier` [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 `OperationType` which implements the `Copy` trait [INFO] [stdout] --> src/core/multi_tier_rate_limiter.rs:285:66 [INFO] [stdout] | [INFO] [stdout] 285 | let config = match self.configs.get(&(user_tier.clone(), operation.clone())) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `operation` [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 pattern creates a reference to a reference [INFO] [stdout] --> src/core/server.rs:257:29 [INFO] [stdout] | [INFO] [stdout] 257 | if let Some(ref exclude) = exclude_user { [INFO] [stdout] | ^^^^^^^^^^^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 257 ~ if let Some(exclude) = exclude_user { [INFO] [stdout] 258 ~ if member_id == exclude { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/core/room.rs:81:9 [INFO] [stdout] | [INFO] [stdout] 81 | / if !self.user_roles.contains_key(&client_id) { [INFO] [stdout] 82 | | self.user_roles.insert(client_id, UserRole::Member); [INFO] [stdout] 83 | | } [INFO] [stdout] | |_________^ help: try: `self.user_roles.entry(client_id).or_insert(UserRole::Member);` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] = note: `#[warn(clippy::map_entry)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `SessionManager` [INFO] [stdout] --> src/core/session.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | / pub fn new() -> Self { [INFO] [stdout] 19 | | Self { [INFO] [stdout] 20 | | connections: HashMap::new(), [INFO] [stdout] 21 | | message_store: None, [INFO] [stdout] 22 | | } [INFO] [stdout] 23 | | } [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] 17 + impl Default for SessionManager { [INFO] [stdout] 18 + fn default() -> Self { [INFO] [stdout] 19 + Self::new() [INFO] [stdout] 20 + } [INFO] [stdout] 21 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `RoomManager` [INFO] [stdout] --> src/core/room.rs:193:5 [INFO] [stdout] | [INFO] [stdout] 193 | / pub fn new() -> Self { [INFO] [stdout] 194 | | let default_room = Room::new("lobby".to_string()); [INFO] [stdout] 195 | | let default_room_id = default_room.id.clone(); [INFO] [stdout] ... | [INFO] [stdout] 205 | | } [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] 191 + impl Default for RoomManager { [INFO] [stdout] 192 + fn default() -> Self { [INFO] [stdout] 193 + Self::new() [INFO] [stdout] 194 + } [INFO] [stdout] 195 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/core/session.rs:131:13 [INFO] [stdout] | [INFO] [stdout] 131 | / if id != sender_id { [INFO] [stdout] 132 | | if connection.sender.send(ws_message.clone()).is_ok() { [INFO] [stdout] 133 | | success_count += 1; [INFO] [stdout] 134 | | } [INFO] [stdout] 135 | | } [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] 131 ~ if id != sender_id [INFO] [stdout] 132 ~ && connection.sender.send(ws_message.clone()).is_ok() { [INFO] [stdout] 133 | success_count += 1; [INFO] [stdout] 134 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ServerManager` [INFO] [stdout] --> src/core/server.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 30 | / pub fn new() -> Self { [INFO] [stdout] 31 | | // Default rate limits [INFO] [stdout] 32 | | let rate_limiter = Arc::new(RateLimiterManager::new(10, 60)); [INFO] [stdout] ... | [INFO] [stdout] 48 | | } [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] 28 + impl Default for ServerManager { [INFO] [stdout] 29 + fn default() -> Self { [INFO] [stdout] 30 + Self::new() [INFO] [stdout] 31 + } [INFO] [stdout] 32 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/handlers/auth.rs:29:33 [INFO] [stdout] | [INFO] [stdout] 29 | return Some(protocol[7..].to_string()); // Remove "bearer." prefix [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/handlers/auth.rs:28:17 [INFO] [stdout] | [INFO] [stdout] 28 | if protocol.starts_with("bearer.") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 28 ~ if let Some() = protocol.strip_prefix("bearer.") { [INFO] [stdout] 29 ~ return Some(.to_string()); // Remove "bearer." prefix [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/handlers/auth.rs:32:33 [INFO] [stdout] | [INFO] [stdout] 32 | return Some(protocol[6..].to_string()); // Remove "token." prefix [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/handlers/auth.rs:31:17 [INFO] [stdout] | [INFO] [stdout] 31 | if protocol.starts_with("token.") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 31 ~ if let Some() = protocol.strip_prefix("token.") { [INFO] [stdout] 32 ~ return Some(.to_string()); // Remove "token." prefix [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/handlers/auth.rs:108:41 [INFO] [stdout] | [INFO] [stdout] 108 | if claims.sub.is_empty() || claims.username.as_ref().map_or(true, |u| u.is_empty()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 108 - if claims.sub.is_empty() || claims.username.as_ref().map_or(true, |u| u.is_empty()) { [INFO] [stdout] 108 + if claims.sub.is_empty() || claims.username.as_ref().is_none_or(|u| u.is_empty()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/handlers/auth.rs:115:42 [INFO] [stdout] | [INFO] [stdout] 115 | if claims.sub.len() > 100 || claims.username.as_ref().map_or(false, |u| u.len() > 50) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 115 - if claims.sub.len() > 100 || claims.username.as_ref().map_or(false, |u| u.len() > 50) { [INFO] [stdout] 115 + if claims.sub.len() > 100 || claims.username.as_ref().is_some_and(|u| u.len() > 50) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this pattern creates a reference to a reference [INFO] [stdout] --> src/core/server.rs:257:29 [INFO] [stdout] | [INFO] [stdout] 257 | if let Some(ref exclude) = exclude_user { [INFO] [stdout] | ^^^^^^^^^^^ [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] help: try [INFO] [stdout] | [INFO] [stdout] 257 ~ if let Some(exclude) = exclude_user { [INFO] [stdout] 258 ~ if member_id == exclude { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `HandlerRegistry` [INFO] [stdout] --> src/handlers/plugin.rs:126:5 [INFO] [stdout] | [INFO] [stdout] 126 | / pub fn new() -> Self { [INFO] [stdout] 127 | | Self { [INFO] [stdout] 128 | | handlers: HashMap::new(), [INFO] [stdout] 129 | | type_mappings: HashMap::new(), [INFO] [stdout] 130 | | } [INFO] [stdout] 131 | | } [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] 125 + impl Default for HandlerRegistry { [INFO] [stdout] 126 + fn default() -> Self { [INFO] [stdout] 127 + Self::new() [INFO] [stdout] 128 + } [INFO] [stdout] 129 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `SessionManager` [INFO] [stdout] --> src/core/session.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | / pub fn new() -> Self { [INFO] [stdout] 19 | | Self { [INFO] [stdout] 20 | | connections: HashMap::new(), [INFO] [stdout] 21 | | message_store: None, [INFO] [stdout] 22 | | } [INFO] [stdout] 23 | | } [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] 17 + impl Default for SessionManager { [INFO] [stdout] 18 + fn default() -> Self { [INFO] [stdout] 19 + Self::new() [INFO] [stdout] 20 + } [INFO] [stdout] 21 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/core/session.rs:131:13 [INFO] [stdout] | [INFO] [stdout] 131 | / if id != sender_id { [INFO] [stdout] 132 | | if connection.sender.send(ws_message.clone()).is_ok() { [INFO] [stdout] 133 | | success_count += 1; [INFO] [stdout] 134 | | } [INFO] [stdout] 135 | | } [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] 131 ~ if id != sender_id [INFO] [stdout] 132 ~ && connection.sender.send(ws_message.clone()).is_ok() { [INFO] [stdout] 133 | success_count += 1; [INFO] [stdout] 134 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/handlers/token_management.rs:85:69 [INFO] [stdout] | [INFO] [stdout] 85 | } else if request.reason.as_deref() == Some("admin_action") { [INFO] [stdout] | _____________________________________________________________________^ [INFO] [stdout] 86 | | RevocationReason::AdminRevocation [INFO] [stdout] 87 | | } else { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/handlers/token_management.rs:87:16 [INFO] [stdout] | [INFO] [stdout] 87 | } else { [INFO] [stdout] | ________________^ [INFO] [stdout] 88 | | RevocationReason::AdminRevocation // Default for admin-initiated revocations [INFO] [stdout] 89 | | }; [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: stripping a prefix manually [INFO] [stdout] --> src/handlers/auth.rs:29:33 [INFO] [stdout] | [INFO] [stdout] 29 | return Some(protocol[7..].to_string()); // Remove "bearer." prefix [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/handlers/auth.rs:28:17 [INFO] [stdout] | [INFO] [stdout] 28 | if protocol.starts_with("bearer.") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 28 ~ if let Some() = protocol.strip_prefix("bearer.") { [INFO] [stdout] 29 ~ return Some(.to_string()); // Remove "bearer." prefix [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/handlers/auth.rs:32:33 [INFO] [stdout] | [INFO] [stdout] 32 | return Some(protocol[6..].to_string()); // Remove "token." prefix [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/handlers/auth.rs:31:17 [INFO] [stdout] | [INFO] [stdout] 31 | if protocol.starts_with("token.") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 31 ~ if let Some() = protocol.strip_prefix("token.") { [INFO] [stdout] 32 ~ return Some(.to_string()); // Remove "token." prefix [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/handlers/auth.rs:108:41 [INFO] [stdout] | [INFO] [stdout] 108 | if claims.sub.is_empty() || claims.username.as_ref().map_or(true, |u| u.is_empty()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_none_or` instead [INFO] [stdout] | [INFO] [stdout] 108 - if claims.sub.is_empty() || claims.username.as_ref().map_or(true, |u| u.is_empty()) { [INFO] [stdout] 108 + if claims.sub.is_empty() || claims.username.as_ref().is_none_or(|u| u.is_empty()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/handlers/auth.rs:115:42 [INFO] [stdout] | [INFO] [stdout] 115 | if claims.sub.len() > 100 || claims.username.as_ref().map_or(false, |u| u.len() > 50) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 115 - if claims.sub.len() > 100 || claims.username.as_ref().map_or(false, |u| u.len() > 50) { [INFO] [stdout] 115 + if claims.sub.len() > 100 || claims.username.as_ref().is_some_and(|u| u.len() > 50) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `HandlerRegistry` [INFO] [stdout] --> src/handlers/plugin.rs:126:5 [INFO] [stdout] | [INFO] [stdout] 126 | / pub fn new() -> Self { [INFO] [stdout] 127 | | Self { [INFO] [stdout] 128 | | handlers: HashMap::new(), [INFO] [stdout] 129 | | type_mappings: HashMap::new(), [INFO] [stdout] 130 | | } [INFO] [stdout] 131 | | } [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] 125 + impl Default for HandlerRegistry { [INFO] [stdout] 126 + fn default() -> Self { [INFO] [stdout] 127 + Self::new() [INFO] [stdout] 128 + } [INFO] [stdout] 129 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `default` can be confused for the standard trait method `std::default::Default::default` [INFO] [stdout] --> src/security/timing.rs:61:5 [INFO] [stdout] | [INFO] [stdout] 61 | / pub fn default() -> Self { [INFO] [stdout] 62 | | Self::new(Duration::from_millis(100)) [INFO] [stdout] 63 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/security/csrf.rs:117:17 [INFO] [stdout] | [INFO] [stdout] 117 | / if self.development_mode && self.allowed_origins.is_empty() { [INFO] [stdout] 118 | | if self.is_localhost_origin(origin_value) { [INFO] [stdout] 119 | | log::debug!("Development mode: allowing localhost origin: {}", origin_value); [INFO] [stdout] 120 | | return CSRFValidationResult::Valid; [INFO] [stdout] 121 | | } [INFO] [stdout] 122 | | } [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] 117 ~ if self.development_mode && self.allowed_origins.is_empty() [INFO] [stdout] 118 ~ && self.is_localhost_origin(origin_value) { [INFO] [stdout] 119 | log::debug!("Development mode: allowing localhost origin: {}", origin_value); [INFO] [stdout] 120 | return CSRFValidationResult::Valid; [INFO] [stdout] 121 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/handlers/token_management.rs:85:69 [INFO] [stdout] | [INFO] [stdout] 85 | } else if request.reason.as_deref() == Some("admin_action") { [INFO] [stdout] | _____________________________________________________________________^ [INFO] [stdout] 86 | | RevocationReason::AdminRevocation [INFO] [stdout] 87 | | } else { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/handlers/token_management.rs:87:16 [INFO] [stdout] | [INFO] [stdout] 87 | } else { [INFO] [stdout] | ________________^ [INFO] [stdout] 88 | | RevocationReason::AdminRevocation // Default for admin-initiated revocations [INFO] [stdout] 89 | | }; [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/security/unicode_validation.rs:200:16 [INFO] [stdout] | [INFO] [stdout] 200 | if (code_point >= 0xFDD0 && code_point <= 0xFDEF) || // Non-characters in Arabic Presentation Forms-A [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0xFDD0..=0xFDEF).contains(&code_point)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/security/unicode_validation.rs:241:21 [INFO] [stdout] | [INFO] [stdout] 241 | / if bidi_embedding_count > 0 { [INFO] [stdout] 242 | | bidi_embedding_count -= 1; [INFO] [stdout] 243 | | } [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] 240 ~ '\u{202C}' [INFO] [stdout] 241 ~ if bidi_embedding_count > 0 => { [INFO] [stdout] 242 | bidi_embedding_count -= 1; [INFO] [stdout] 243 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/security/unicode_validation.rs:246:21 [INFO] [stdout] | [INFO] [stdout] 246 | / if bidi_isolate_count > 0 { [INFO] [stdout] 247 | | bidi_isolate_count -= 1; [INFO] [stdout] 248 | | } [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] 245 ~ '\u{2069}' [INFO] [stdout] 246 ~ if bidi_isolate_count > 0 => { [INFO] [stdout] 247 | bidi_isolate_count -= 1; [INFO] [stdout] 248 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/security/unicode_validation.rs:281:16 [INFO] [stdout] | [INFO] [stdout] 281 | if (code_point >= 0xE000 && code_point <= 0xF8FF) || // Private Use Area [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0xE000..=0xF8FF).contains(&code_point)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/security/unicode_validation.rs:282:16 [INFO] [stdout] | [INFO] [stdout] 282 | (code_point >= 0xF0000 && code_point <= 0xFFFFD) || // Supplementary Private Use Area-A [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0xF0000..=0xFFFFD).contains(&code_point)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/security/unicode_validation.rs:283:16 [INFO] [stdout] | [INFO] [stdout] 283 | (code_point >= 0x100000 && code_point <= 0x10FFFD) { // Supplementary Private Use Area-B [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0x100000..=0x10FFFD).contains(&code_point)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/security/unicode_validation.rs:382:16 [INFO] [stdout] | [INFO] [stdout] 382 | if (has_latin && has_cyrillic) || (has_latin && has_greek) { [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] 382 - if (has_latin && has_cyrillic) || (has_latin && has_greek) { [INFO] [stdout] 382 + if !(!has_latin || !has_cyrillic && !has_greek) { [INFO] [stdout] | [INFO] [stdout] 382 - if (has_latin && has_cyrillic) || (has_latin && has_greek) { [INFO] [stdout] 382 + if (has_greek || has_cyrillic) && has_latin { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/security/unicode_validation.rs:566:9 [INFO] [stdout] | [INFO] [stdout] 566 | config.allow_bidirectional = true; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `security::unicode_validation::UnicodeSecurityConfig { allow_bidirectional: true, max_normalized_length: 100, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/security/unicode_validation.rs:565:9 [INFO] [stdout] | [INFO] [stdout] 565 | let mut config = UnicodeSecurityConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `default` can be confused for the standard trait method `std::default::Default::default` [INFO] [stdout] --> src/security/timing.rs:61:5 [INFO] [stdout] | [INFO] [stdout] 61 | / pub fn default() -> Self { [INFO] [stdout] 62 | | Self::new(Duration::from_millis(100)) [INFO] [stdout] 63 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/security/csrf.rs:117:17 [INFO] [stdout] | [INFO] [stdout] 117 | / if self.development_mode && self.allowed_origins.is_empty() { [INFO] [stdout] 118 | | if self.is_localhost_origin(origin_value) { [INFO] [stdout] 119 | | log::debug!("Development mode: allowing localhost origin: {}", origin_value); [INFO] [stdout] 120 | | return CSRFValidationResult::Valid; [INFO] [stdout] 121 | | } [INFO] [stdout] 122 | | } [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] 117 ~ if self.development_mode && self.allowed_origins.is_empty() [INFO] [stdout] 118 ~ && self.is_localhost_origin(origin_value) { [INFO] [stdout] 119 | log::debug!("Development mode: allowing localhost origin: {}", origin_value); [INFO] [stdout] 120 | return CSRFValidationResult::Valid; [INFO] [stdout] 121 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ProductionChecker` [INFO] [stdout] --> src/security/production_warnings.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | / pub fn new() -> Self { [INFO] [stdout] 43 | | let environment = std::env::var("RUST_ENV") [INFO] [stdout] 44 | | .or_else(|_| std::env::var("ENVIRONMENT")) [INFO] [stdout] 45 | | .or_else(|_| std::env::var("NODE_ENV")) [INFO] [stdout] ... | [INFO] [stdout] 56 | | } [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] 40 + impl Default for ProductionChecker { [INFO] [stdout] 41 + fn default() -> Self { [INFO] [stdout] 42 + Self::new() [INFO] [stdout] 43 + } [INFO] [stdout] 44 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/security/unicode_validation.rs:200:16 [INFO] [stdout] | [INFO] [stdout] 200 | if (code_point >= 0xFDD0 && code_point <= 0xFDEF) || // Non-characters in Arabic Presentation Forms-A [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0xFDD0..=0xFDEF).contains(&code_point)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/security/unicode_validation.rs:241:21 [INFO] [stdout] | [INFO] [stdout] 241 | / if bidi_embedding_count > 0 { [INFO] [stdout] 242 | | bidi_embedding_count -= 1; [INFO] [stdout] 243 | | } [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] 240 ~ '\u{202C}' [INFO] [stdout] 241 ~ if bidi_embedding_count > 0 => { [INFO] [stdout] 242 | bidi_embedding_count -= 1; [INFO] [stdout] 243 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/security/unicode_validation.rs:246:21 [INFO] [stdout] | [INFO] [stdout] 246 | / if bidi_isolate_count > 0 { [INFO] [stdout] 247 | | bidi_isolate_count -= 1; [INFO] [stdout] 248 | | } [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] 245 ~ '\u{2069}' [INFO] [stdout] 246 ~ if bidi_isolate_count > 0 => { [INFO] [stdout] 247 | bidi_isolate_count -= 1; [INFO] [stdout] 248 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/security/unicode_validation.rs:281:16 [INFO] [stdout] | [INFO] [stdout] 281 | if (code_point >= 0xE000 && code_point <= 0xF8FF) || // Private Use Area [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0xE000..=0xF8FF).contains(&code_point)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/security/unicode_validation.rs:282:16 [INFO] [stdout] | [INFO] [stdout] 282 | (code_point >= 0xF0000 && code_point <= 0xFFFFD) || // Supplementary Private Use Area-A [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0xF0000..=0xFFFFD).contains(&code_point)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/security/unicode_validation.rs:283:16 [INFO] [stdout] | [INFO] [stdout] 283 | (code_point >= 0x100000 && code_point <= 0x10FFFD) { // Supplementary Private Use Area-B [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0x100000..=0x10FFFD).contains(&code_point)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/security/unicode_validation.rs:382:16 [INFO] [stdout] | [INFO] [stdout] 382 | if (has_latin && has_cyrillic) || (has_latin && has_greek) { [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] 382 - if (has_latin && has_cyrillic) || (has_latin && has_greek) { [INFO] [stdout] 382 + if !(!has_latin || !has_cyrillic && !has_greek) { [INFO] [stdout] | [INFO] [stdout] 382 - if (has_latin && has_cyrillic) || (has_latin && has_greek) { [INFO] [stdout] 382 + if (has_greek || has_cyrillic) && has_latin { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `SecurityLogger` [INFO] [stdout] --> src/security_logger.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 60 | / pub fn new() -> Self { [INFO] [stdout] 61 | | let mut alert_thresholds = HashMap::new(); [INFO] [stdout] 62 | | // Authentication [INFO] [stdout] 63 | | alert_thresholds.insert("auth_failed".to_string(), 5); [INFO] [stdout] ... | [INFO] [stdout] 94 | | } [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] 58 + impl Default for SecurityLogger { [INFO] [stdout] 59 + fn default() -> Self { [INFO] [stdout] 60 + Self::new() [INFO] [stdout] 61 + } [INFO] [stdout] 62 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `ProductionChecker` [INFO] [stdout] --> src/security/production_warnings.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | / pub fn new() -> Self { [INFO] [stdout] 43 | | let environment = std::env::var("RUST_ENV") [INFO] [stdout] 44 | | .or_else(|_| std::env::var("ENVIRONMENT")) [INFO] [stdout] 45 | | .or_else(|_| std::env::var("NODE_ENV")) [INFO] [stdout] ... | [INFO] [stdout] 56 | | } [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] 40 + impl Default for ProductionChecker { [INFO] [stdout] 41 + fn default() -> Self { [INFO] [stdout] 42 + Self::new() [INFO] [stdout] 43 + } [INFO] [stdout] 44 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `MemoryMessageStorage` [INFO] [stdout] --> src/storage/memory.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | / pub fn new() -> Self { [INFO] [stdout] 25 | | Self { [INFO] [stdout] 26 | | messages: Arc::new(RwLock::new(HashMap::new())), [INFO] [stdout] 27 | | room_messages: Arc::new(RwLock::new(HashMap::new())), [INFO] [stdout] ... | [INFO] [stdout] 30 | | } [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] 23 + impl Default for MemoryMessageStorage { [INFO] [stdout] 24 + fn default() -> Self { [INFO] [stdout] 25 + Self::new() [INFO] [stdout] 26 + } [INFO] [stdout] 27 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/storage/memory.rs:78:13 [INFO] [stdout] | [INFO] [stdout] 78 | sorted_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 78 - sorted_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); [INFO] [stdout] 78 + sorted_messages.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `SecurityLogger` [INFO] [stdout] --> src/security_logger.rs:60:5 [INFO] [stdout] | [INFO] [stdout] 60 | / pub fn new() -> Self { [INFO] [stdout] 61 | | let mut alert_thresholds = HashMap::new(); [INFO] [stdout] 62 | | // Authentication [INFO] [stdout] 63 | | alert_thresholds.insert("auth_failed".to_string(), 5); [INFO] [stdout] ... | [INFO] [stdout] 94 | | } [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] 58 + impl Default for SecurityLogger { [INFO] [stdout] 59 + fn default() -> Self { [INFO] [stdout] 60 + Self::new() [INFO] [stdout] 61 + } [INFO] [stdout] 62 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/storage/memory.rs:179:9 [INFO] [stdout] | [INFO] [stdout] 179 | results.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 179 - results.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); [INFO] [stdout] 179 + results.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/storage/memory.rs:225:16 [INFO] [stdout] | [INFO] [stdout] 225 | analytics: Arc, HashMap)>>>>, // event_type -> events [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: you should consider adding a `Default` implementation for `MemoryStorageProvider` [INFO] [stdout] --> src/storage/memory.rs:229:5 [INFO] [stdout] | [INFO] [stdout] 229 | / pub fn new() -> Self { [INFO] [stdout] 230 | | Self { [INFO] [stdout] 231 | | message_storage: MemoryMessageStorage::new(), [INFO] [stdout] 232 | | rooms: Arc::new(RwLock::new(HashMap::new())), [INFO] [stdout] ... | [INFO] [stdout] 240 | | } [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] 228 + impl Default for MemoryStorageProvider { [INFO] [stdout] 229 + fn default() -> Self { [INFO] [stdout] 230 + Self::new() [INFO] [stdout] 231 + } [INFO] [stdout] 232 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/storage/memory.rs:312:9 [INFO] [stdout] | [INFO] [stdout] 312 | room_list.sort_by(|a, b| a.created_at.cmp(&b.created_at)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 312 - room_list.sort_by(|a, b| a.created_at.cmp(&b.created_at)); [INFO] [stdout] 312 + room_list.sort_by_key(|a| a.created_at); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:325:17 [INFO] [stdout] | [INFO] [stdout] 325 | room.description.as_ref().map_or(false, |desc| desc.to_lowercase().contains(&query_lower)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 325 - room.description.as_ref().map_or(false, |desc| desc.to_lowercase().contains(&query_lower)) [INFO] [stdout] 325 + room.description.as_ref().is_some_and(|desc| desc.to_lowercase().contains(&query_lower)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/storage/memory.rs:330:9 [INFO] [stdout] | [INFO] [stdout] 330 | results.sort_by(|a, b| a.created_at.cmp(&b.created_at)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 330 - results.sort_by(|a, b| a.created_at.cmp(&b.created_at)); [INFO] [stdout] 330 + results.sort_by_key(|a| a.created_at); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `MemoryMessageStorage` [INFO] [stdout] --> src/storage/memory.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | / pub fn new() -> Self { [INFO] [stdout] 25 | | Self { [INFO] [stdout] 26 | | messages: Arc::new(RwLock::new(HashMap::new())), [INFO] [stdout] 27 | | room_messages: Arc::new(RwLock::new(HashMap::new())), [INFO] [stdout] ... | [INFO] [stdout] 30 | | } [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] 23 + impl Default for MemoryMessageStorage { [INFO] [stdout] 24 + fn default() -> Self { [INFO] [stdout] 25 + Self::new() [INFO] [stdout] 26 + } [INFO] [stdout] 27 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/storage/memory.rs:78:13 [INFO] [stdout] | [INFO] [stdout] 78 | sorted_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] = note: `#[warn(clippy::unnecessary_sort_by)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 78 - sorted_messages.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); [INFO] [stdout] 78 + sorted_messages.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:440:17 [INFO] [stdout] | [INFO] [stdout] 440 | user.email.as_ref().map_or(false, |email| email.to_lowercase().contains(&query_lower)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 440 - user.email.as_ref().map_or(false, |email| email.to_lowercase().contains(&query_lower)) [INFO] [stdout] 440 + user.email.as_ref().is_some_and(|email| email.to_lowercase().contains(&query_lower)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/storage/memory.rs:179:9 [INFO] [stdout] | [INFO] [stdout] 179 | results.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 179 - results.sort_by(|a, b| b.timestamp.cmp(&a.timestamp)); [INFO] [stdout] 179 + results.sort_by_key(|b| std::cmp::Reverse(b.timestamp)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/storage/memory.rs:225:16 [INFO] [stdout] | [INFO] [stdout] 225 | analytics: Arc, HashMap)>>>>, // event_type -> events [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: you should consider adding a `Default` implementation for `MemoryStorageProvider` [INFO] [stdout] --> src/storage/memory.rs:229:5 [INFO] [stdout] | [INFO] [stdout] 229 | / pub fn new() -> Self { [INFO] [stdout] 230 | | Self { [INFO] [stdout] 231 | | message_storage: MemoryMessageStorage::new(), [INFO] [stdout] 232 | | rooms: Arc::new(RwLock::new(HashMap::new())), [INFO] [stdout] ... | [INFO] [stdout] 240 | | } [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] 228 + impl Default for MemoryStorageProvider { [INFO] [stdout] 229 + fn default() -> Self { [INFO] [stdout] 230 + Self::new() [INFO] [stdout] 231 + } [INFO] [stdout] 232 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:571:17 [INFO] [stdout] | [INFO] [stdout] 571 | ban.room_id.as_ref().map_or(false, |rid| rid == room_id) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 571 - ban.room_id.as_ref().map_or(false, |rid| rid == room_id) [INFO] [stdout] 571 + ban.room_id.as_ref().is_some_and(|rid| rid == room_id) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/storage/memory.rs:312:9 [INFO] [stdout] | [INFO] [stdout] 312 | room_list.sort_by(|a, b| a.created_at.cmp(&b.created_at)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 312 - room_list.sort_by(|a, b| a.created_at.cmp(&b.created_at)); [INFO] [stdout] 312 + room_list.sort_by_key(|a| a.created_at); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:325:17 [INFO] [stdout] | [INFO] [stdout] 325 | room.description.as_ref().map_or(false, |desc| desc.to_lowercase().contains(&query_lower)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 325 - room.description.as_ref().map_or(false, |desc| desc.to_lowercase().contains(&query_lower)) [INFO] [stdout] 325 + room.description.as_ref().is_some_and(|desc| desc.to_lowercase().contains(&query_lower)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/storage/memory.rs:330:9 [INFO] [stdout] | [INFO] [stdout] 330 | results.sort_by(|a, b| a.created_at.cmp(&b.created_at)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 330 - results.sort_by(|a, b| a.created_at.cmp(&b.created_at)); [INFO] [stdout] 330 + results.sort_by_key(|a| a.created_at); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/storage/memory.rs:645:9 [INFO] [stdout] | [INFO] [stdout] 645 | sorted_users.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 645 - sorted_users.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 645 + sorted_users.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:658:20 [INFO] [stdout] | [INFO] [stdout] 658 | if data.get("room_id").map_or(false, |rid| rid == room_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 658 - if data.get("room_id").map_or(false, |rid| rid == room_id) { [INFO] [stdout] 658 + if data.get("room_id").is_some_and(|rid| rid == room_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `MessageStore` [INFO] [stdout] --> src/storage/message_store.rs:78:5 [INFO] [stdout] | [INFO] [stdout] 78 | / pub fn new() -> Self { [INFO] [stdout] 79 | | let config = MessageStoreConfig::default(); [INFO] [stdout] 80 | | Self { [INFO] [stdout] 81 | | messages: VecDeque::with_capacity(config.max_messages), [INFO] [stdout] ... | [INFO] [stdout] 86 | | } [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] 76 + impl Default for MessageStore { [INFO] [stdout] 77 + fn default() -> Self { [INFO] [stdout] 78 + Self::new() [INFO] [stdout] 79 + } [INFO] [stdout] 80 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/storage/message_store.rs:101:9 [INFO] [stdout] | [INFO] [stdout] 101 | config.max_messages = capacity; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `storage::message_store::MessageStoreConfig { max_messages: capacity, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/storage/message_store.rs:100:9 [INFO] [stdout] | [INFO] [stdout] 100 | let mut config = MessageStoreConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:440:17 [INFO] [stdout] | [INFO] [stdout] 440 | user.email.as_ref().map_or(false, |email| email.to_lowercase().contains(&query_lower)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 440 - user.email.as_ref().map_or(false, |email| email.to_lowercase().contains(&query_lower)) [INFO] [stdout] 440 + user.email.as_ref().is_some_and(|email| email.to_lowercase().contains(&query_lower)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/storage/message_store.rs:345:5 [INFO] [stdout] | [INFO] [stdout] 345 | config.max_messages = capacity; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `storage::message_store::MessageStoreConfig { max_messages: capacity, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/storage/message_store.rs:344:5 [INFO] [stdout] | [INFO] [stdout] 344 | let mut config = MessageStoreConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:571:17 [INFO] [stdout] | [INFO] [stdout] 571 | ban.room_id.as_ref().map_or(false, |rid| rid == room_id) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 571 - ban.room_id.as_ref().map_or(false, |rid| rid == room_id) [INFO] [stdout] 571 + ban.room_id.as_ref().is_some_and(|rid| rid == room_id) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/storage/memory.rs:645:9 [INFO] [stdout] | [INFO] [stdout] 645 | sorted_users.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 645 - sorted_users.sort_by(|a, b| b.1.cmp(&a.1)); [INFO] [stdout] 645 + sorted_users.sort_by_key(|b| std::cmp::Reverse(b.1)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/storage/memory.rs:658:20 [INFO] [stdout] | [INFO] [stdout] 658 | if data.get("room_id").map_or(false, |rid| rid == room_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 658 - if data.get("room_id").map_or(false, |rid| rid == room_id) { [INFO] [stdout] 658 + if data.get("room_id").is_some_and(|rid| rid == room_id) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `MessageStore` [INFO] [stdout] --> src/storage/message_store.rs:78:5 [INFO] [stdout] | [INFO] [stdout] 78 | / pub fn new() -> Self { [INFO] [stdout] 79 | | let config = MessageStoreConfig::default(); [INFO] [stdout] 80 | | Self { [INFO] [stdout] 81 | | messages: VecDeque::with_capacity(config.max_messages), [INFO] [stdout] ... | [INFO] [stdout] 86 | | } [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] 76 + impl Default for MessageStore { [INFO] [stdout] 77 + fn default() -> Self { [INFO] [stdout] 78 + Self::new() [INFO] [stdout] 79 + } [INFO] [stdout] 80 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/storage/message_store.rs:101:9 [INFO] [stdout] | [INFO] [stdout] 101 | config.max_messages = capacity; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `storage::message_store::MessageStoreConfig { max_messages: capacity, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/storage/message_store.rs:100:9 [INFO] [stdout] | [INFO] [stdout] 100 | let mut config = MessageStoreConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/storage/message_store.rs:572:9 [INFO] [stdout] | [INFO] [stdout] 572 | config.retention_hours = 24; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `storage::message_store::MessageStoreConfig { retention_hours: 24, max_messages: 10, enable_background_cleanup: false, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/storage/message_store.rs:571:9 [INFO] [stdout] | [INFO] [stdout] 571 | let mut config = MessageStoreConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/storage/message_store.rs:595:9 [INFO] [stdout] | [INFO] [stdout] 595 | config.max_memory_bytes = 2048; // Small limit for testing [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `storage::message_store::MessageStoreConfig { max_memory_bytes: 2048, max_messages: 20, enable_background_cleanup: false, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/storage/message_store.rs:594:9 [INFO] [stdout] | [INFO] [stdout] 594 | let mut config = MessageStoreConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/storage/message_store.rs:345:5 [INFO] [stdout] | [INFO] [stdout] 345 | config.max_messages = capacity; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `storage::message_store::MessageStoreConfig { max_messages: capacity, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/storage/message_store.rs:344:5 [INFO] [stdout] | [INFO] [stdout] 344 | let mut config = MessageStoreConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/storage/message_store.rs:668:9 [INFO] [stdout] | [INFO] [stdout] 668 | new_config.max_messages = 2; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `storage::message_store::MessageStoreConfig { max_messages: 2, retention_hours: 24, enable_background_cleanup: false, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/storage/message_store.rs:667:9 [INFO] [stdout] | [INFO] [stdout] 667 | let mut new_config = MessageStoreConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/storage/token_revocation.rs:169:17 [INFO] [stdout] | [INFO] [stdout] 169 | / if !revoked_tokens.contains_key(&token_id) { [INFO] [stdout] 170 | | let revoked_token = RevokedToken { [INFO] [stdout] 171 | | token_id: token_id.clone(), [INFO] [stdout] 172 | | user_id: user_id.to_string(), [INFO] [stdout] ... | [INFO] [stdout] 179 | | count += 1; [INFO] [stdout] 180 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 169 ~ if let std::collections::hash_map::Entry::Vacant(e) = revoked_tokens.entry(token_id) { [INFO] [stdout] 170 + let revoked_token = RevokedToken { [INFO] [stdout] 171 + token_id: token_id.clone(), [INFO] [stdout] 172 + user_id: user_id.to_string(), [INFO] [stdout] 173 + revoked_at: now, [INFO] [stdout] 174 + expires_at: now + chrono::Duration::hours(24), // Default expiration [INFO] [stdout] 175 + reason: reason.clone(), [INFO] [stdout] 176 + context: Some(format!("Bulk revocation for user {}", user_id)), [INFO] [stdout] 177 + }; [INFO] [stdout] 178 + e.insert(revoked_token); [INFO] [stdout] 179 + count += 1; [INFO] [stdout] 180 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: usage of `contains_key` followed by `insert` on a `HashMap` [INFO] [stdout] --> src/storage/token_revocation.rs:169:17 [INFO] [stdout] | [INFO] [stdout] 169 | / if !revoked_tokens.contains_key(&token_id) { [INFO] [stdout] 170 | | let revoked_token = RevokedToken { [INFO] [stdout] 171 | | token_id: token_id.clone(), [INFO] [stdout] 172 | | user_id: user_id.to_string(), [INFO] [stdout] ... | [INFO] [stdout] 179 | | count += 1; [INFO] [stdout] 180 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 169 ~ if let std::collections::hash_map::Entry::Vacant(e) = revoked_tokens.entry(token_id) { [INFO] [stdout] 170 + let revoked_token = RevokedToken { [INFO] [stdout] 171 + token_id: token_id.clone(), [INFO] [stdout] 172 + user_id: user_id.to_string(), [INFO] [stdout] 173 + revoked_at: now, [INFO] [stdout] 174 + expires_at: now + chrono::Duration::hours(24), // Default expiration [INFO] [stdout] 175 + reason: reason.clone(), [INFO] [stdout] 176 + context: Some(format!("Bulk revocation for user {}", user_id)), [INFO] [stdout] 177 + }; [INFO] [stdout] 178 + e.insert(revoked_token); [INFO] [stdout] 179 + count += 1; [INFO] [stdout] 180 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/tls.rs:89:43 [INFO] [stdout] | [INFO] [stdout] 89 | fn validate_cert_key_pair(cert_chain: &Vec, private_key: &PrivateKey) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 89 ~ fn validate_cert_key_pair(cert_chain: &[Certificate], private_key: &PrivateKey) -> Result<()> { [INFO] [stdout] 90 | if cert_chain.is_empty() { [INFO] [stdout] ... [INFO] [stdout] 134 | .with_no_client_auth() [INFO] [stdout] 135 ~ .with_single_cert(cert_chain.to_owned(), private_key.clone()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/tls.rs:89:43 [INFO] [stdout] | [INFO] [stdout] 89 | fn validate_cert_key_pair(cert_chain: &Vec, private_key: &PrivateKey) -> Result<()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 89 ~ fn validate_cert_key_pair(cert_chain: &[Certificate], private_key: &PrivateKey) -> Result<()> { [INFO] [stdout] 90 | if cert_chain.is_empty() { [INFO] [stdout] ... [INFO] [stdout] 134 | .with_no_client_auth() [INFO] [stdout] 135 ~ .with_single_cert(cert_chain.to_owned(), private_key.clone()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> examples/unicode_security_demo.rs:49:5 [INFO] [stdout] | [INFO] [stdout] 49 | custom_config.allow_bidirectional = true; // Allow BiDi text [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `rusty_socks::security::UnicodeSecurityConfig { allow_bidirectional: true, max_normalized_length: 100, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> examples/unicode_security_demo.rs:48:5 [INFO] [stdout] | [INFO] [stdout] 48 | let mut custom_config = UnicodeSecurityConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `start_test_server` is never used [INFO] [stdout] --> tests/websocket_auth_test.rs:7:10 [INFO] [stdout] | [INFO] [stdout] 7 | async fn start_test_server() -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `id`, `name`, `host`, `max_players`, and `game_type` are never read [INFO] [stdout] --> examples/gaming_server.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 16 | struct GameLobby { [INFO] [stdout] | --------- fields in this struct [INFO] [stdout] 17 | id: String, [INFO] [stdout] | ^^ [INFO] [stdout] 18 | name: String, [INFO] [stdout] | ^^^^ [INFO] [stdout] 19 | host: String, [INFO] [stdout] | ^^^^ [INFO] [stdout] 20 | players: Vec, [INFO] [stdout] 21 | max_players: usize, [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] 22 | game_type: String, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `GameLobby` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Starting` is never constructed [INFO] [stdout] --> examples/gaming_server.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 28 | enum LobbyStatus { [INFO] [stdout] | ----------- variant in this enum [INFO] [stdout] 29 | Waiting, [INFO] [stdout] 30 | Starting, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `LobbyStatus` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `id` and `username` are never read [INFO] [stdout] --> examples/gaming_server.rs:37:5 [INFO] [stdout] | [INFO] [stdout] 36 | struct Player { [INFO] [stdout] | ------ fields in this struct [INFO] [stdout] 37 | id: String, [INFO] [stdout] | ^^ [INFO] [stdout] 38 | username: String, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Player` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `id` is never read [INFO] [stdout] --> examples/gaming_server.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 53 | struct GameSession { [INFO] [stdout] | ----------- field in this struct [INFO] [stdout] 54 | id: String, [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = note: `GameSession` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> examples/gaming_server.rs:271:21 [INFO] [stdout] | [INFO] [stdout] 271 | / state.players.get(player_id) [INFO] [stdout] 272 | | .map_or(false, |p| p.ready) [INFO] [stdout] | |___________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 272 - .map_or(false, |p| p.ready) [INFO] [stdout] 272 + .is_some_and(|p| p.ready) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `pending_orders` is never read [INFO] [stdout] --> examples/trading_client.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 14 | struct Portfolio { [INFO] [stdout] | --------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 17 | pending_orders: HashMap, [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Portfolio` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `symbol` is never read [INFO] [stdout] --> examples/trading_client.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 21 | struct Position { [INFO] [stdout] | -------- field in this struct [INFO] [stdout] 22 | symbol: String, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Position` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: multiple fields are never read [INFO] [stdout] --> examples/trading_client.rs:30:5 [INFO] [stdout] | [INFO] [stdout] 29 | struct Order { [INFO] [stdout] | ----- fields in this struct [INFO] [stdout] 30 | id: String, [INFO] [stdout] | ^^ [INFO] [stdout] 31 | symbol: String, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 32 | side: OrderSide, [INFO] [stdout] | ^^^^ [INFO] [stdout] 33 | quantity: i64, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 34 | price: f64, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 35 | order_type: OrderType, [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] 36 | status: OrderStatus, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Order` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Buy` and `Sell` are never constructed [INFO] [stdout] --> examples/trading_client.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 40 | enum OrderSide { [INFO] [stdout] | --------- variants in this enum [INFO] [stdout] 41 | Buy, [INFO] [stdout] | ^^^ [INFO] [stdout] 42 | Sell, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `OrderSide` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Market`, `Limit`, and `Stop` are never constructed [INFO] [stdout] --> examples/trading_client.rs:47:5 [INFO] [stdout] | [INFO] [stdout] 46 | enum OrderType { [INFO] [stdout] | --------- variants in this enum [INFO] [stdout] 47 | Market, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 48 | Limit, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 49 | Stop, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `OrderType` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Pending`, `Filled`, `Cancelled`, and `PartiallyFilled` are never constructed [INFO] [stdout] --> examples/trading_client.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 53 | enum OrderStatus { [INFO] [stdout] | ----------- variants in this enum [INFO] [stdout] 54 | Pending, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] 55 | Filled, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 56 | Cancelled, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] 57 | PartiallyFilled, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `OrderStatus` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `symbol`, `price`, `bid`, `ask`, and `timestamp` are never read [INFO] [stdout] --> examples/trading_client.rs:62:5 [INFO] [stdout] | [INFO] [stdout] 61 | struct MarketData { [INFO] [stdout] | ---------- fields in this struct [INFO] [stdout] 62 | symbol: String, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 63 | price: f64, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 64 | bid: f64, [INFO] [stdout] | ^^^ [INFO] [stdout] 65 | ask: f64, [INFO] [stdout] | ^^^ [INFO] [stdout] 66 | volume: u64, [INFO] [stdout] 67 | timestamp: chrono::DateTime, [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `MarketData` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 08s [INFO] running `Command { std: "docker" "inspect" "c95ca1056ff19d8214a36a40ca2bc36f6aac730b9f531c7d954c2b5682527a7c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c95ca1056ff19d8214a36a40ca2bc36f6aac730b9f531c7d954c2b5682527a7c", kill_on_drop: false }` [INFO] [stdout] c95ca1056ff19d8214a36a40ca2bc36f6aac730b9f531c7d954c2b5682527a7c