[INFO] cloning repository https://github.com/tnromy/adminradius-infrastructure-module [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/tnromy/adminradius-infrastructure-module" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ftnromy%2Fadminradius-infrastructure-module", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ftnromy%2Fadminradius-infrastructure-module'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 24467b4d3a9b54021eb1382c917df35c1599bd60 [INFO] linting tnromy/adminradius-infrastructure-module/24467b4d3a9b54021eb1382c917df35c1599bd60 against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Ftnromy%2Fadminradius-infrastructure-module" "/workspace/builds/worker-6-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-6-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/tnromy/adminradius-infrastructure-module [INFO] finished tweaking git repo https://github.com/tnromy/adminradius-infrastructure-module [INFO] tweaked toml for git repo https://github.com/tnromy/adminradius-infrastructure-module written to /workspace/builds/worker-6-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/tnromy/adminradius-infrastructure-module on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/tnromy/adminradius-infrastructure-module already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded fstr v0.2.13 [INFO] [stderr] Downloaded bcrypt v0.15.1 [INFO] [stderr] Downloaded bytestring v1.5.0 [INFO] [stderr] Downloaded deranged v0.5.4 [INFO] [stderr] Downloaded deadpool-redis v0.15.1 [INFO] [stderr] Downloaded actix-rt v2.11.0 [INFO] [stderr] Downloaded rust-ini v0.20.0 [INFO] [stderr] Downloaded serde v1.0.227 [INFO] [stderr] Downloaded tokio-rustls v0.26.3 [INFO] [stderr] Downloaded serde_core v1.0.227 [INFO] [stderr] Downloaded regex-lite v0.1.7 [INFO] [stderr] Downloaded attohttpc v0.28.5 [INFO] [stderr] Downloaded yaml-rust2 v0.8.1 [INFO] [stderr] Downloaded rustls-webpki v0.103.6 [INFO] [stderr] Downloaded quick-xml v0.32.0 [INFO] [stderr] Downloaded cc v1.2.38 [INFO] [stderr] Downloaded actix-http v3.11.1 [INFO] [stderr] Downloaded serde_derive v1.0.227 [INFO] [stderr] Downloaded redis v0.25.4 [INFO] [stderr] Downloaded aws-creds v0.37.0 [INFO] [stderr] Downloaded rust-s3 v0.35.1 [INFO] [stderr] Downloaded uuid7 v0.6.4 [INFO] [stderr] Downloaded rustls v0.23.32 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 629bd1ae2734be7cb29efb010de6f231ac20ed516eaa19ac6d8e8beea4fa24ae [INFO] running `Command { std: "docker" "start" "-a" "629bd1ae2734be7cb29efb010de6f231ac20ed516eaa19ac6d8e8beea4fa24ae", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "629bd1ae2734be7cb29efb010de6f231ac20ed516eaa19ac6d8e8beea4fa24ae", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "629bd1ae2734be7cb29efb010de6f231ac20ed516eaa19ac6d8e8beea4fa24ae", kill_on_drop: false }` [INFO] [stdout] 629bd1ae2734be7cb29efb010de6f231ac20ed516eaa19ac6d8e8beea4fa24ae [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 7eab9be34308f4adab1f241902b1e233b1108c754cce12dc1d7332f388873a43 [INFO] running `Command { std: "docker" "start" "-a" "7eab9be34308f4adab1f241902b1e233b1108c754cce12dc1d7332f388873a43", kill_on_drop: false }` [INFO] [stderr] Compiling serde_core v1.0.227 [INFO] [stderr] Compiling serde v1.0.227 [INFO] [stderr] Compiling libc v0.2.176 [INFO] [stderr] Checking log v0.4.28 [INFO] [stderr] Compiling cfg-if v1.0.3 [INFO] [stderr] Compiling serde_derive v1.0.227 [INFO] [stderr] Checking parking_lot_core v0.9.11 [INFO] [stderr] Checking signal-hook-registry v1.4.6 [INFO] [stderr] Compiling tracing-attributes v0.1.30 [INFO] [stderr] Checking parking_lot v0.12.4 [INFO] [stderr] Checking mio v1.0.4 [INFO] [stderr] Checking getrandom v0.2.16 [INFO] [stderr] Compiling futures-macro v0.3.31 [INFO] [stderr] Checking getrandom v0.3.3 [INFO] [stderr] Compiling zerofrom v0.1.6 [INFO] [stderr] Compiling yoke v0.8.0 [INFO] [stderr] Checking tokio v1.47.1 [INFO] [stderr] Compiling serde_json v1.0.145 [INFO] [stderr] Compiling memchr v2.7.6 [INFO] [stderr] Compiling zerovec v0.11.4 [INFO] [stderr] Checking icu_normalizer v2.0.0 [INFO] [stderr] Compiling tinystr v0.8.1 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Compiling jobserver v0.1.34 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Checking ahash v0.8.12 [INFO] [stderr] Compiling cc v1.2.38 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Compiling icu_locale_core v2.0.0 [INFO] [stderr] Checking hashbrown v0.14.5 [INFO] [stderr] Checking idna v1.1.0 [INFO] [stderr] Compiling potential_utf v0.1.3 [INFO] [stderr] Compiling zerotrie v0.2.2 [INFO] [stderr] Compiling zerocopy v0.8.27 [INFO] [stderr] Compiling thiserror v2.0.16 [INFO] [stderr] Compiling icu_provider v2.0.0 [INFO] [stderr] Compiling ring v0.17.14 [INFO] [stderr] Compiling icu_collections v2.0.0 [INFO] [stderr] Checking rustls-pki-types v1.12.0 [INFO] [stderr] Compiling thiserror-impl v2.0.16 [INFO] [stderr] Compiling untrusted v0.9.0 [INFO] [stderr] Compiling icu_properties v2.0.1 [INFO] [stderr] Checking url v2.5.7 [INFO] [stderr] Checking bitflags v2.9.4 [INFO] [stderr] Compiling const-random-macro v0.1.16 [INFO] [stderr] Compiling rustls v0.23.32 [INFO] [stderr] Checking const-random v0.1.18 [INFO] [stderr] Compiling zstd-sys v2.0.16+zstd.1.5.7 [INFO] [stderr] Compiling socket2 v0.6.0 [INFO] [stderr] Compiling num-traits v0.2.19 [INFO] [stderr] Checking tokio-util v0.7.16 [INFO] [stderr] Compiling rustls v0.21.12 [INFO] [stderr] Compiling ucd-trie v0.1.7 [INFO] [stderr] Compiling pest v2.8.2 [INFO] [stderr] Compiling nom v7.1.3 [INFO] [stderr] Compiling tinyvec v1.10.0 [INFO] [stderr] Compiling form_urlencoded v1.2.2 [INFO] [stderr] Checking dlv-list v0.5.2 [INFO] [stderr] Compiling ppv-lite86 v0.2.21 [INFO] [stderr] Checking webpki-roots v1.0.2 [INFO] [stderr] Compiling rand_core v0.6.4 [INFO] [stderr] Compiling time-core v0.1.6 [INFO] [stderr] Compiling base64 v0.21.7 [INFO] [stderr] Compiling hashbrown v0.16.0 [INFO] [stderr] Compiling slab v0.4.11 [INFO] [stderr] Compiling iana-time-zone v0.1.64 [INFO] [stderr] Compiling chrono v0.4.42 [INFO] [stderr] Compiling indexmap v2.11.4 [INFO] [stderr] Compiling sqlformat v0.2.6 [INFO] [stderr] Checking deranged v0.5.4 [INFO] [stderr] Checking rustls-webpki v0.101.7 [INFO] [stderr] Checking sct v0.7.1 [INFO] [stderr] Checking rustls-webpki v0.103.6 [INFO] [stderr] Compiling tokio-stream v0.1.17 [INFO] [stderr] Compiling rustls-pemfile v1.0.4 [INFO] [stderr] Compiling time-macros v0.2.24 [INFO] [stderr] Compiling pest_meta v2.8.2 [INFO] [stderr] Checking regex-automata v0.4.11 [INFO] [stderr] Compiling sha2 v0.10.9 [INFO] [stderr] Compiling rand_chacha v0.3.1 [INFO] [stderr] Compiling rustix v1.1.2 [INFO] [stderr] Checking ordered-multimap v0.7.3 [INFO] [stderr] Compiling futures-intrusive v0.5.0 [INFO] [stderr] Compiling hashlink v0.8.4 [INFO] [stderr] Compiling unicode-normalization v0.1.24 [INFO] [stderr] Compiling atoi v2.0.0 [INFO] [stderr] Compiling either v1.15.0 [INFO] [stderr] Compiling thiserror v1.0.69 [INFO] [stderr] Compiling uuid v1.18.1 [INFO] [stderr] Compiling webpki-roots v0.25.4 [INFO] [stderr] Compiling stringprep v0.1.5 [INFO] [stderr] Checking regex v1.11.3 [INFO] [stderr] Compiling openssl-sys v0.9.111 [INFO] [stderr] Checking time v0.3.44 [INFO] [stderr] Compiling rand v0.8.5 [INFO] [stderr] Compiling sqlx-core v0.7.4 [INFO] [stderr] Compiling pest_generator v2.8.2 [INFO] [stderr] Compiling md-5 v0.10.6 [INFO] [stderr] Checking rand_core v0.9.3 [INFO] [stderr] Compiling whoami v1.6.1 [INFO] [stderr] Compiling derive_more-impl v2.0.1 [INFO] [stderr] Compiling pest_derive v2.8.2 [INFO] [stderr] Checking rand_chacha v0.9.0 [INFO] [stderr] Compiling tempfile v3.23.0 [INFO] [stderr] Checking hyper v1.7.0 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Checking crc32fast v1.5.0 [INFO] [stderr] Compiling sqlx-postgres v0.7.4 [INFO] [stderr] Checking webpki-roots v0.26.11 [INFO] [stderr] Checking actix-rt v2.11.0 [INFO] [stderr] Checking toml_datetime v0.6.11 [INFO] [stderr] Checking serde_spanned v0.6.9 [INFO] [stderr] Compiling bytestring v1.5.0 [INFO] [stderr] Checking inout v0.1.4 [INFO] [stderr] Checking winnow v0.7.13 [INFO] [stderr] Compiling regex-lite v0.1.7 [INFO] [stderr] Checking tower v0.5.2 [INFO] [stderr] Checking derive_more v2.0.1 [INFO] [stderr] Checking hyper-util v0.1.17 [INFO] [stderr] Compiling actix-router v0.5.3 [INFO] [stderr] Checking cipher v0.4.4 [INFO] [stderr] Checking hyper v0.14.32 [INFO] [stderr] Checking attohttpc v0.28.5 [INFO] [stderr] Checking toml_edit v0.22.27 [INFO] [stderr] Checking flate2 v1.1.2 [INFO] [stderr] Checking brotli v8.0.2 [INFO] [stderr] Checking rand v0.9.2 [INFO] [stderr] Checking tokio-rustls v0.26.3 [INFO] [stderr] Checking rust-ini v0.21.3 [INFO] [stderr] Compiling sqlx-macros-core v0.7.4 [INFO] [stderr] Checking tokio-rustls v0.24.1 [INFO] [stderr] Checking h2 v0.3.27 [INFO] [stderr] Checking actix-codec v0.5.2 [INFO] [stderr] Checking combine v4.6.7 [INFO] [stderr] Checking deadpool-runtime v0.1.4 [INFO] [stderr] Checking sha1 v0.10.6 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking quick-xml v0.32.0 [INFO] [stderr] Checking futures-executor v0.3.31 [INFO] [stderr] Checking num_cpus v1.17.0 [INFO] [stderr] Checking iri-string v0.7.8 [INFO] [stderr] Compiling zstd-safe v7.2.4 [INFO] [stderr] Checking zstd v0.13.3 [INFO] [stderr] Compiling openssl v0.10.75 [INFO] [stderr] Checking arraydeque v0.5.1 [INFO] [stderr] Checking deadpool v0.12.3 [INFO] [stderr] Checking yaml-rust2 v0.8.1 [INFO] [stderr] Compiling sqlx-macros v0.7.4 [INFO] [stderr] Checking rustls-native-certs v0.6.3 [INFO] [stderr] Checking aws-creds v0.37.0 [INFO] [stderr] Checking convert_case v0.6.0 [INFO] [stderr] Checking anstream v0.6.20 [INFO] [stderr] Checking tower-http v0.6.6 [INFO] [stderr] Checking futures v0.3.31 [INFO] [stderr] Checking toml v0.8.23 [INFO] [stderr] Checking hyper-rustls v0.24.2 [INFO] [stderr] Checking hyper-rustls v0.27.7 [INFO] [stderr] Compiling actix-web-codegen v4.3.0 [INFO] [stderr] Checking blowfish v0.9.1 [INFO] [stderr] Checking cookie v0.16.2 [INFO] [stderr] Checking actix-server v2.6.0 [INFO] [stderr] Checking json5 v0.4.1 [INFO] [stderr] Checking env_filter v0.1.3 [INFO] [stderr] Checking rust-ini v0.20.0 [INFO] [stderr] Checking aws-region v0.25.5 [INFO] [stderr] Checking ron v0.8.1 [INFO] [stderr] Compiling actix-macros v0.2.4 [INFO] [stderr] Compiling maybe-async v0.2.10 [INFO] [stderr] Checking md5 v0.7.0 [INFO] [stderr] Checking fstr v0.2.13 [INFO] [stderr] Checking env_logger v0.11.8 [INFO] [stderr] Checking config v0.14.1 [INFO] [stderr] Checking actix-http v3.11.1 [INFO] [stderr] Checking uuid7 v0.6.4 [INFO] [stderr] Checking reqwest v0.12.23 [INFO] [stderr] Checking bcrypt v0.15.1 [INFO] [stderr] Checking rust-s3 v0.35.1 [INFO] [stderr] Checking handlebars v5.1.2 [INFO] [stderr] Checking urlencoding v2.1.3 [INFO] [stderr] Checking sqlx v0.7.4 [INFO] [stderr] Checking redis v0.25.4 [INFO] [stderr] Checking actix-web v4.11.0 [INFO] [stderr] Checking deadpool-redis v0.15.1 [INFO] [stderr] Checking radiusinfra v1.0.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/utils/string_helper.rs:4:1 [INFO] [stdout] | [INFO] [stdout] 4 | / /// without performing side effects. [INFO] [stdout] 5 | | [INFO] [stdout] | |_^ [INFO] [stdout] ... [INFO] [stdout] 11 | pub fn string_space_to_list(input: &str) -> Vec { [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 comment should document the parent module use an inner doc comment [INFO] [stdout] | [INFO] [stdout] 1 ~ //! String-related stateless helpers. [INFO] [stdout] 2 ~ //! [INFO] [stdout] 3 ~ //! All functions here are pure: depend only on parameters and return values [INFO] [stdout] 4 ~ //! without performing side effects. [INFO] [stdout] | [INFO] [stdout] help: if the documentation should include the empty line include it in the comment [INFO] [stdout] | [INFO] [stdout] 5 | /// [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: empty line after doc comment [INFO] [stdout] --> src/utils/string_helper.rs:4:1 [INFO] [stdout] | [INFO] [stdout] 4 | / /// without performing side effects. [INFO] [stdout] 5 | | [INFO] [stdout] | |_^ [INFO] [stdout] ... [INFO] [stdout] 11 | pub fn string_space_to_list(input: &str) -> Vec { [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 comment should document the parent module use an inner doc comment [INFO] [stdout] | [INFO] [stdout] 1 ~ //! String-related stateless helpers. [INFO] [stdout] 2 ~ //! [INFO] [stdout] 3 ~ //! All functions here are pure: depend only on parameters and return values [INFO] [stdout] 4 ~ //! without performing side effects. [INFO] [stdout] | [INFO] [stdout] help: if the documentation should include the empty line include it in the comment [INFO] [stdout] | [INFO] [stdout] 5 | /// [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `get`, `put`, `delete`, and `ping` are never used [INFO] [stdout] --> src/infrastructures/ca_openvpn.rs:70:18 [INFO] [stdout] | [INFO] [stdout] 30 | impl CaOpenvpnService { [INFO] [stdout] | --------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 70 | pub async fn get(&self, path: &str) -> Result [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 192 | pub async fn put(&self, path: &str, body: &B) -> Result [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 234 | pub async fn delete(&self, path: &str) -> Result [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 274 | pub async fn ping(&self) -> Result<()> { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `put` and `ping` are never used [INFO] [stdout] --> src/infrastructures/radius.rs:132:18 [INFO] [stdout] | [INFO] [stdout] 28 | impl RadiusService { [INFO] [stdout] | ------------------ methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 132 | pub async fn put(&self, path: &str, body: &B) -> Result [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 212 | pub async fn ping(&self) -> Result<()> { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/controllers/device_controller.rs:85:40 [INFO] [stdout] | [INFO] [stdout] 85 | let search = query.search.as_ref().map(|s| { [INFO] [stdout] | ________________________________________^ [INFO] [stdout] 86 | | let sanitized = sql_security_helper::sanitize_search_keyword(s); [INFO] [stdout] 87 | | if sanitized.is_empty() { None } else { Some(sanitized) } [INFO] [stdout] 88 | | }).flatten(); [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] help: try replacing `map` with `and_then` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 85 ~ let search = query.search.as_ref().and_then(|s| { [INFO] [stdout] 86 + let sanitized = sql_security_helper::sanitize_search_keyword(s); [INFO] [stdout] 87 + if sanitized.is_empty() { None } else { Some(sanitized) } [INFO] [stdout] 88 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `get`, `put`, `delete`, and `ping` are never used [INFO] [stdout] --> src/infrastructures/ca_openvpn.rs:70:18 [INFO] [stdout] | [INFO] [stdout] 30 | impl CaOpenvpnService { [INFO] [stdout] | --------------------- methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 70 | pub async fn get(&self, path: &str) -> Result [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 192 | pub async fn put(&self, path: &str, body: &B) -> Result [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 234 | pub async fn delete(&self, path: &str) -> Result [INFO] [stdout] | ^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 274 | pub async fn ping(&self) -> Result<()> { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `load_root_ca` is never used [INFO] [stdout] --> src/infrastructures/load_ca.rs:27:8 [INFO] [stdout] | [INFO] [stdout] 27 | pub fn load_root_ca() -> Result { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `get_root_ca_pem` is never used [INFO] [stdout] --> src/infrastructures/load_ca.rs:36:8 [INFO] [stdout] | [INFO] [stdout] 36 | pub fn get_root_ca_pem() -> &'static str { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `put` and `ping` are never used [INFO] [stdout] --> src/infrastructures/radius.rs:132:18 [INFO] [stdout] | [INFO] [stdout] 28 | impl RadiusService { [INFO] [stdout] | ------------------ methods in this implementation [INFO] [stdout] ... [INFO] [stdout] 132 | pub async fn put(&self, path: &str, body: &B) -> Result [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 212 | pub async fn ping(&self) -> Result<()> { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/controllers/device_controller.rs:85:40 [INFO] [stdout] | [INFO] [stdout] 85 | let search = query.search.as_ref().map(|s| { [INFO] [stdout] | ________________________________________^ [INFO] [stdout] 86 | | let sanitized = sql_security_helper::sanitize_search_keyword(s); [INFO] [stdout] 87 | | if sanitized.is_empty() { None } else { Some(sanitized) } [INFO] [stdout] 88 | | }).flatten(); [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] help: try replacing `map` with `and_then` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 85 ~ let search = query.search.as_ref().and_then(|s| { [INFO] [stdout] 86 + let sanitized = sql_security_helper::sanitize_search_keyword(s); [INFO] [stdout] 87 + if sanitized.is_empty() { None } else { Some(sanitized) } [INFO] [stdout] 88 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/middlewares/include_request_id_middleware.rs:74:13 [INFO] [stdout] | [INFO] [stdout] 74 | / if let Some(ctx) = req.extensions().get::() { [INFO] [stdout] 75 | | if let Ok(mut m) = ctx.lock() { [INFO] [stdout] 76 | | m.request_id = request_id.clone(); [INFO] [stdout] 77 | | } [INFO] [stdout] 78 | | } [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] 74 ~ if let Some(ctx) = req.extensions().get::() [INFO] [stdout] 75 ~ && let Ok(mut m) = ctx.lock() { [INFO] [stdout] 76 | m.request_id = request_id.clone(); [INFO] [stdout] 77 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/middlewares/log_middleware.rs:70:9 [INFO] [stdout] | [INFO] [stdout] 70 | doc.timestamp = Utc::now().to_rfc3339_opts(SecondsFormat::Millis, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `infrastructures::elastic_search::RequestLogDoc { timestamp: Utc::now().to_rfc3339_opts(SecondsFormat::Millis, true), method: method, path: path, ip: ip, user_agent: user_agent, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/middlewares/log_middleware.rs:69:9 [INFO] [stdout] | [INFO] [stdout] 69 | let mut doc = RequestLogDoc::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: this `if` statement can be collapsed [INFO] [stdout] --> src/middlewares/log_middleware.rs:85:13 [INFO] [stdout] | [INFO] [stdout] 85 | / if let Some(ctx) = res.request().extensions().get::() { [INFO] [stdout] 86 | | if let Ok(mut m) = ctx.lock() { [INFO] [stdout] 87 | | m.status = Some(res.status().as_u16()); [INFO] [stdout] 88 | | } [INFO] [stdout] 89 | | } [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] 85 ~ if let Some(ctx) = res.request().extensions().get::() [INFO] [stdout] 86 ~ && let Ok(mut m) = ctx.lock() { [INFO] [stdout] 87 | m.status = Some(res.status().as_u16()); [INFO] [stdout] 88 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/middlewares/log_middleware.rs:92:13 [INFO] [stdout] | [INFO] [stdout] 92 | / if let Some(data) = res [INFO] [stdout] 93 | | .request() [INFO] [stdout] 94 | | .app_data::>>() [INFO] [stdout] ... | [INFO] [stdout] 127 | | } [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] 94 ~ .app_data::>>() [INFO] [stdout] 95 ~ && let Some(es) = data.get_ref().as_ref() { [INFO] [stdout] 96 | // Build final doc clone to avoid holding the lock across await [INFO] [stdout] ... [INFO] [stdout] 124 | } [INFO] [stdout] 125 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/middlewares/log_middleware.rs:137:5 [INFO] [stdout] | [INFO] [stdout] 137 | / if let Some(ctx) = req.extensions().get::() { [INFO] [stdout] 138 | | if let Ok(mut m) = ctx.lock() { [INFO] [stdout] 139 | | m.notes.push(note.as_ref().to_string()); [INFO] [stdout] 140 | | } [INFO] [stdout] 141 | | } [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] 137 ~ if let Some(ctx) = req.extensions().get::() [INFO] [stdout] 138 ~ && let Ok(mut m) = ctx.lock() { [INFO] [stdout] 139 | m.notes.push(note.as_ref().to_string()); [INFO] [stdout] 140 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/middlewares/log_middleware.rs:150:5 [INFO] [stdout] | [INFO] [stdout] 150 | / if let Some(ctx) = req.extensions().get::() { [INFO] [stdout] 151 | | if let Ok(mut m) = ctx.lock() { [INFO] [stdout] 152 | | if m.extras.is_null() || !m.extras.is_object() { [INFO] [stdout] 153 | | m.extras = serde_json::json!({}); [INFO] [stdout] ... | [INFO] [stdout] 159 | | } [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] 150 ~ if let Some(ctx) = req.extensions().get::() [INFO] [stdout] 151 ~ && let Ok(mut m) = ctx.lock() { [INFO] [stdout] 152 | if m.extras.is_null() || !m.extras.is_object() { [INFO] [stdout] ... [INFO] [stdout] 157 | } [INFO] [stdout] 158 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (12/7) [INFO] [stdout] --> src/repositories/postgresql/openvpn_server_postgres_repository.rs:70:1 [INFO] [stdout] | [INFO] [stdout] 70 | / pub async fn update<'a, E>( [INFO] [stdout] 71 | | executor: E, [INFO] [stdout] 72 | | id: &str, [INFO] [stdout] 73 | | host: &str, [INFO] [stdout] ... | [INFO] [stdout] 84 | | where [INFO] [stdout] 85 | | E: Executor<'a, Database = Postgres>, [INFO] [stdout] | |_________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/activate_device_radius_client.rs:128:18 [INFO] [stdout] | [INFO] [stdout] 128 | .map_err(|e| ActivateDeviceRadiusClientError::Encryption(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ActivateDeviceRadiusClientError::Encryption` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/services/add_device_port.rs:53:5 [INFO] [stdout] | [INFO] [stdout] 53 | / if let Some(ref specification_id) = input.port_specification_id { [INFO] [stdout] 54 | | if !port_spec_repository::exists(conn, specification_id).await? { [INFO] [stdout] 55 | | return Err(AddDevicePortError::PortSpecificationNotFound); [INFO] [stdout] 56 | | } [INFO] [stdout] 57 | | } [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] 53 ~ if let Some(ref specification_id) = input.port_specification_id [INFO] [stdout] 54 ~ && !port_spec_repository::exists(conn, specification_id).await? { [INFO] [stdout] 55 | return Err(AddDevicePortError::PortSpecificationNotFound); [INFO] [stdout] 56 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/get_openvpn_client_passphrase.rs:47:18 [INFO] [stdout] | [INFO] [stdout] 47 | .map_err(|e| GetOpenvpnClientPassphraseError::Hash(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `GetOpenvpnClientPassphraseError::Hash` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/get_openvpn_client_passphrase.rs:69:14 [INFO] [stdout] | [INFO] [stdout] 69 | .map_err(|e| GetOpenvpnClientPassphraseError::Decryption(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `GetOpenvpnClientPassphraseError::Decryption` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/get_openvpn_server_passphrase.rs:55:18 [INFO] [stdout] | [INFO] [stdout] 55 | .map_err(|e| GetOpenvpnServerPassphraseError::Hash(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `GetOpenvpnServerPassphraseError::Hash` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/get_openvpn_server_passphrase.rs:77:14 [INFO] [stdout] | [INFO] [stdout] 77 | .map_err(|e| GetOpenvpnServerPassphraseError::Decryption(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `GetOpenvpnServerPassphraseError::Decryption` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/services/get_radius_clients.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | / if let Ok(mut conn) = redis_pool.get().await { [INFO] [stdout] 20 | | if let Ok(Some(cached_data)) = redis_repo::get(&mut conn, key_prefix, CACHE_KEY).await { [INFO] [stdout] 21 | | if let Ok(items) = serde_json::from_str::>(&cached_data) { [INFO] [stdout] 22 | | log::debug!("radius_clients:get_all:cache_hit"); [INFO] [stdout] ... | [INFO] [stdout] 26 | | } [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] 19 ~ if let Ok(mut conn) = redis_pool.get().await [INFO] [stdout] 20 ~ && let Ok(Some(cached_data)) = redis_repo::get(&mut conn, key_prefix, CACHE_KEY).await { [INFO] [stdout] 21 | if let Ok(items) = serde_json::from_str::>(&cached_data) { [INFO] [stdout] ... [INFO] [stdout] 24 | } [INFO] [stdout] 25 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/services/get_radius_clients.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | / if let Ok(Some(cached_data)) = redis_repo::get(&mut conn, key_prefix, CACHE_KEY).await { [INFO] [stdout] 21 | | if let Ok(items) = serde_json::from_str::>(&cached_data) { [INFO] [stdout] 22 | | log::debug!("radius_clients:get_all:cache_hit"); [INFO] [stdout] 23 | | return Ok(items); [INFO] [stdout] 24 | | } [INFO] [stdout] 25 | | } [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] 20 ~ if let Ok(Some(cached_data)) = redis_repo::get(&mut conn, key_prefix, CACHE_KEY).await [INFO] [stdout] 21 ~ && let Ok(items) = serde_json::from_str::>(&cached_data) { [INFO] [stdout] 22 | log::debug!("radius_clients:get_all:cache_hit"); [INFO] [stdout] 23 | return Ok(items); [INFO] [stdout] 24 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/services/get_radius_clients.rs:32:5 [INFO] [stdout] | [INFO] [stdout] 32 | / if let Ok(mut conn) = redis_pool.get().await { [INFO] [stdout] 33 | | if let Ok(json_data) = serde_json::to_string(&items) { [INFO] [stdout] 34 | | let _ = redis_repo::create(&mut conn, key_prefix, CACHE_KEY, &json_data, Some(CACHE_TTL)).await; [INFO] [stdout] 35 | | } [INFO] [stdout] 36 | | } [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] 32 ~ if let Ok(mut conn) = redis_pool.get().await [INFO] [stdout] 33 ~ && let Ok(json_data) = serde_json::to_string(&items) { [INFO] [stdout] 34 | let _ = redis_repo::create(&mut conn, key_prefix, CACHE_KEY, &json_data, Some(CACHE_TTL)).await; [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/services/get_radius_vendors.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | / if let Ok(mut conn) = redis_pool.get().await { [INFO] [stdout] 20 | | if let Ok(Some(cached_data)) = redis_repo::get(&mut conn, key_prefix, CACHE_KEY).await { [INFO] [stdout] 21 | | if let Ok(items) = serde_json::from_str::>(&cached_data) { [INFO] [stdout] 22 | | log::debug!("radius_vendors:get_all:cache_hit"); [INFO] [stdout] ... | [INFO] [stdout] 26 | | } [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] 19 ~ if let Ok(mut conn) = redis_pool.get().await [INFO] [stdout] 20 ~ && let Ok(Some(cached_data)) = redis_repo::get(&mut conn, key_prefix, CACHE_KEY).await { [INFO] [stdout] 21 | if let Ok(items) = serde_json::from_str::>(&cached_data) { [INFO] [stdout] ... [INFO] [stdout] 24 | } [INFO] [stdout] 25 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/services/get_radius_vendors.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | / if let Ok(Some(cached_data)) = redis_repo::get(&mut conn, key_prefix, CACHE_KEY).await { [INFO] [stdout] 21 | | if let Ok(items) = serde_json::from_str::>(&cached_data) { [INFO] [stdout] 22 | | log::debug!("radius_vendors:get_all:cache_hit"); [INFO] [stdout] 23 | | return Ok(items); [INFO] [stdout] 24 | | } [INFO] [stdout] 25 | | } [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] 20 ~ if let Ok(Some(cached_data)) = redis_repo::get(&mut conn, key_prefix, CACHE_KEY).await [INFO] [stdout] 21 ~ && let Ok(items) = serde_json::from_str::>(&cached_data) { [INFO] [stdout] 22 | log::debug!("radius_vendors:get_all:cache_hit"); [INFO] [stdout] 23 | return Ok(items); [INFO] [stdout] 24 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/services/get_radius_vendors.rs:32:5 [INFO] [stdout] | [INFO] [stdout] 32 | / if let Ok(mut conn) = redis_pool.get().await { [INFO] [stdout] 33 | | if let Ok(json_data) = serde_json::to_string(&items) { [INFO] [stdout] 34 | | let _ = redis_repo::create(&mut conn, key_prefix, CACHE_KEY, &json_data, Some(CACHE_TTL)).await; [INFO] [stdout] 35 | | } [INFO] [stdout] 36 | | } [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] 32 ~ if let Ok(mut conn) = redis_pool.get().await [INFO] [stdout] 33 ~ && let Ok(json_data) = serde_json::to_string(&items) { [INFO] [stdout] 34 | let _ = redis_repo::create(&mut conn, key_prefix, CACHE_KEY, &json_data, Some(CACHE_TTL)).await; [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/services/update_device_port.rs:55:5 [INFO] [stdout] | [INFO] [stdout] 55 | / if let Some(ref specification_id) = input.port_specification_id { [INFO] [stdout] 56 | | if !port_spec_repository::exists(conn, specification_id).await? { [INFO] [stdout] 57 | | return Err(UpdateDevicePortError::PortSpecificationNotFound); [INFO] [stdout] 58 | | } [INFO] [stdout] 59 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 55 ~ if let Some(ref specification_id) = input.port_specification_id [INFO] [stdout] 56 ~ && !port_spec_repository::exists(conn, specification_id).await? { [INFO] [stdout] 57 | return Err(UpdateDevicePortError::PortSpecificationNotFound); [INFO] [stdout] 58 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/http_response_helper.rs:362:5 [INFO] [stdout] | [INFO] [stdout] 362 | / if let Some(exp) = cookie_expire { [INFO] [stdout] 363 | | if exp > 0 { [INFO] [stdout] 364 | | builder = builder.max_age(Duration::seconds(exp as i64)); [INFO] [stdout] 365 | | } [INFO] [stdout] 366 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 362 ~ if let Some(exp) = cookie_expire [INFO] [stdout] 363 ~ && exp > 0 { [INFO] [stdout] 364 | builder = builder.max_age(Duration::seconds(exp as i64)); [INFO] [stdout] 365 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/utils/sql_security_helper.rs:11:8 [INFO] [stdout] | [INFO] [stdout] 11 | if allowed.iter().any(|c| *c == column) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `allowed.contains(&column)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] = note: `#[warn(clippy::manual_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used consecutive `str::replace` call [INFO] [stdout] --> src/utils/sql_security_helper.rs:54:39 [INFO] [stdout] | [INFO] [stdout] 54 | let without_wildcards = collapsed.replace('%', "").replace('_', ""); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['%', '_'], "")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace [INFO] [stdout] = note: `#[warn(clippy::collapsible_str_replace)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used consecutive `str::replace` call [INFO] [stdout] --> src/utils/xss_security_helper.rs:44:11 [INFO] [stdout] | [INFO] [stdout] 44 | input.replace('<', "").replace('>', "") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['<', '>'], "")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/validations/device/activate_radius_client_validation.rs:20:42 [INFO] [stdout] | [INFO] [stdout] 20 | } else if safe_device_id.len() != 36 { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 21 | | errors.push("device_id must be a valid UUID".to_string()); [INFO] [stdout] 22 | | } else if uuid::Uuid::parse_str(&safe_device_id).is_err() { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/validations/device/activate_radius_client_validation.rs:22:63 [INFO] [stdout] | [INFO] [stdout] 22 | } else if uuid::Uuid::parse_str(&safe_device_id).is_err() { [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 23 | | errors.push("device_id must be a valid UUID".to_string()); [INFO] [stdout] 24 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/validations/device/assign_openvpn_client_validation.rs:20:42 [INFO] [stdout] | [INFO] [stdout] 20 | } else if safe_device_id.len() != 36 { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 21 | | errors.push("device_id must be a valid UUID".to_string()); [INFO] [stdout] 22 | | } else if uuid::Uuid::parse_str(&safe_device_id).is_err() { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/validations/device/assign_openvpn_client_validation.rs:22:63 [INFO] [stdout] | [INFO] [stdout] 22 | } else if uuid::Uuid::parse_str(&safe_device_id).is_err() { [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 23 | | errors.push("device_id must be a valid UUID".to_string()); [INFO] [stdout] 24 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/validations/device/assign_openvpn_client_validation.rs:31:42 [INFO] [stdout] | [INFO] [stdout] 31 | } else if safe_client_id.len() != 36 { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 32 | | errors.push("openvpn_client_id must be a valid UUID".to_string()); [INFO] [stdout] 33 | | } else if uuid::Uuid::parse_str(&safe_client_id).is_err() { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/validations/device/assign_openvpn_client_validation.rs:33:63 [INFO] [stdout] | [INFO] [stdout] 33 | } else if uuid::Uuid::parse_str(&safe_client_id).is_err() { [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 34 | | errors.push("openvpn_client_id must be a valid UUID".to_string()); [INFO] [stdout] 35 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/validations/device/deactivate_radius_client_validation.rs:18:42 [INFO] [stdout] | [INFO] [stdout] 18 | } else if safe_device_id.len() != 36 { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 19 | | errors.push("device_id must be a valid UUID".to_string()); [INFO] [stdout] 20 | | } else if uuid::Uuid::parse_str(&safe_device_id).is_err() { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/validations/device/deactivate_radius_client_validation.rs:20:63 [INFO] [stdout] | [INFO] [stdout] 20 | } else if uuid::Uuid::parse_str(&safe_device_id).is_err() { [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 21 | | errors.push("device_id must be a valid UUID".to_string()); [INFO] [stdout] 22 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/validations/device/store_validation.rs:49:32 [INFO] [stdout] | [INFO] [stdout] 49 | Ok(lat) if lat >= -90.0 && lat <= 90.0 => {}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(-90.0..=90.0).contains(&lat)` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/validations/device/store_validation.rs:53:32 [INFO] [stdout] | [INFO] [stdout] 53 | Ok(lon) if lon >= -180.0 && lon <= 180.0 => {}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(-180.0..=180.0).contains(&lon)` [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 `if` has identical blocks [INFO] [stdout] --> src/validations/device/unassign_openvpn_client_validation.rs:20:42 [INFO] [stdout] | [INFO] [stdout] 20 | } else if safe_device_id.len() != 36 { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 21 | | errors.push("device_id must be a valid UUID".to_string()); [INFO] [stdout] 22 | | } else if uuid::Uuid::parse_str(&safe_device_id).is_err() { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/validations/device/unassign_openvpn_client_validation.rs:22:63 [INFO] [stdout] | [INFO] [stdout] 22 | } else if uuid::Uuid::parse_str(&safe_device_id).is_err() { [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 23 | | errors.push("device_id must be a valid UUID".to_string()); [INFO] [stdout] 24 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/validations/device/unassign_openvpn_client_validation.rs:31:42 [INFO] [stdout] | [INFO] [stdout] 31 | } else if safe_client_id.len() != 36 { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 32 | | errors.push("openvpn_client_id must be a valid UUID".to_string()); [INFO] [stdout] 33 | | } else if uuid::Uuid::parse_str(&safe_client_id).is_err() { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/validations/device/unassign_openvpn_client_validation.rs:33:63 [INFO] [stdout] | [INFO] [stdout] 33 | } else if uuid::Uuid::parse_str(&safe_client_id).is_err() { [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 34 | | errors.push("openvpn_client_id must be a valid UUID".to_string()); [INFO] [stdout] 35 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/validations/device/update_validation.rs:49:32 [INFO] [stdout] | [INFO] [stdout] 49 | Ok(lat) if lat >= -90.0 && lat <= 90.0 => {}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(-90.0..=90.0).contains(&lat)` [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/validations/device/update_validation.rs:53:32 [INFO] [stdout] | [INFO] [stdout] 53 | Ok(lon) if lon >= -180.0 && lon <= 180.0 => {}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(-180.0..=180.0).contains(&lon)` [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 `if` statement can be collapsed [INFO] [stdout] --> src/middlewares/include_request_id_middleware.rs:74:13 [INFO] [stdout] | [INFO] [stdout] 74 | / if let Some(ctx) = req.extensions().get::() { [INFO] [stdout] 75 | | if let Ok(mut m) = ctx.lock() { [INFO] [stdout] 76 | | m.request_id = request_id.clone(); [INFO] [stdout] 77 | | } [INFO] [stdout] 78 | | } [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] 74 ~ if let Some(ctx) = req.extensions().get::() [INFO] [stdout] 75 ~ && let Ok(mut m) = ctx.lock() { [INFO] [stdout] 76 | m.request_id = request_id.clone(); [INFO] [stdout] 77 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/middlewares/log_middleware.rs:70:9 [INFO] [stdout] | [INFO] [stdout] 70 | doc.timestamp = Utc::now().to_rfc3339_opts(SecondsFormat::Millis, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `infrastructures::elastic_search::RequestLogDoc { timestamp: Utc::now().to_rfc3339_opts(SecondsFormat::Millis, true), method: method, path: path, ip: ip, user_agent: user_agent, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/middlewares/log_middleware.rs:69:9 [INFO] [stdout] | [INFO] [stdout] 69 | let mut doc = RequestLogDoc::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: this `if` statement can be collapsed [INFO] [stdout] --> src/middlewares/log_middleware.rs:85:13 [INFO] [stdout] | [INFO] [stdout] 85 | / if let Some(ctx) = res.request().extensions().get::() { [INFO] [stdout] 86 | | if let Ok(mut m) = ctx.lock() { [INFO] [stdout] 87 | | m.status = Some(res.status().as_u16()); [INFO] [stdout] 88 | | } [INFO] [stdout] 89 | | } [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] 85 ~ if let Some(ctx) = res.request().extensions().get::() [INFO] [stdout] 86 ~ && let Ok(mut m) = ctx.lock() { [INFO] [stdout] 87 | m.status = Some(res.status().as_u16()); [INFO] [stdout] 88 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/middlewares/log_middleware.rs:92:13 [INFO] [stdout] | [INFO] [stdout] 92 | / if let Some(data) = res [INFO] [stdout] 93 | | .request() [INFO] [stdout] 94 | | .app_data::>>() [INFO] [stdout] ... | [INFO] [stdout] 127 | | } [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] 94 ~ .app_data::>>() [INFO] [stdout] 95 ~ && let Some(es) = data.get_ref().as_ref() { [INFO] [stdout] 96 | // Build final doc clone to avoid holding the lock across await [INFO] [stdout] ... [INFO] [stdout] 124 | } [INFO] [stdout] 125 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/middlewares/log_middleware.rs:137:5 [INFO] [stdout] | [INFO] [stdout] 137 | / if let Some(ctx) = req.extensions().get::() { [INFO] [stdout] 138 | | if let Ok(mut m) = ctx.lock() { [INFO] [stdout] 139 | | m.notes.push(note.as_ref().to_string()); [INFO] [stdout] 140 | | } [INFO] [stdout] 141 | | } [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] 137 ~ if let Some(ctx) = req.extensions().get::() [INFO] [stdout] 138 ~ && let Ok(mut m) = ctx.lock() { [INFO] [stdout] 139 | m.notes.push(note.as_ref().to_string()); [INFO] [stdout] 140 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/middlewares/log_middleware.rs:150:5 [INFO] [stdout] | [INFO] [stdout] 150 | / if let Some(ctx) = req.extensions().get::() { [INFO] [stdout] 151 | | if let Ok(mut m) = ctx.lock() { [INFO] [stdout] 152 | | if m.extras.is_null() || !m.extras.is_object() { [INFO] [stdout] 153 | | m.extras = serde_json::json!({}); [INFO] [stdout] ... | [INFO] [stdout] 159 | | } [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] 150 ~ if let Some(ctx) = req.extensions().get::() [INFO] [stdout] 151 ~ && let Ok(mut m) = ctx.lock() { [INFO] [stdout] 152 | if m.extras.is_null() || !m.extras.is_object() { [INFO] [stdout] ... [INFO] [stdout] 157 | } [INFO] [stdout] 158 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/validations/device_port/store_validation.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | / if let Some(position) = payload.position { [INFO] [stdout] 55 | | if position < 0 { [INFO] [stdout] 56 | | errors.push("position must be zero or positive".to_string()); [INFO] [stdout] 57 | | } [INFO] [stdout] 58 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 54 ~ if let Some(position) = payload.position [INFO] [stdout] 55 ~ && position < 0 { [INFO] [stdout] 56 | errors.push("position must be zero or positive".to_string()); [INFO] [stdout] 57 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/validations/device_port/update_validation.rs:56:5 [INFO] [stdout] | [INFO] [stdout] 56 | / if let Some(position) = payload.position { [INFO] [stdout] 57 | | if position < 0 { [INFO] [stdout] 58 | | errors.push("position must be zero or positive".to_string()); [INFO] [stdout] 59 | | } [INFO] [stdout] 60 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 56 ~ if let Some(position) = payload.position [INFO] [stdout] 57 ~ && position < 0 { [INFO] [stdout] 58 | errors.push("position must be zero or positive".to_string()); [INFO] [stdout] 59 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this function has too many arguments (12/7) [INFO] [stdout] --> src/repositories/postgresql/openvpn_server_postgres_repository.rs:70:1 [INFO] [stdout] | [INFO] [stdout] 70 | / pub async fn update<'a, E>( [INFO] [stdout] 71 | | executor: E, [INFO] [stdout] 72 | | id: &str, [INFO] [stdout] 73 | | host: &str, [INFO] [stdout] ... | [INFO] [stdout] 84 | | where [INFO] [stdout] 85 | | E: Executor<'a, Database = Postgres>, [INFO] [stdout] | |_________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments [INFO] [stdout] = note: `#[warn(clippy::too_many_arguments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/activate_device_radius_client.rs:128:18 [INFO] [stdout] | [INFO] [stdout] 128 | .map_err(|e| ActivateDeviceRadiusClientError::Encryption(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `ActivateDeviceRadiusClientError::Encryption` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/services/add_device_port.rs:53:5 [INFO] [stdout] | [INFO] [stdout] 53 | / if let Some(ref specification_id) = input.port_specification_id { [INFO] [stdout] 54 | | if !port_spec_repository::exists(conn, specification_id).await? { [INFO] [stdout] 55 | | return Err(AddDevicePortError::PortSpecificationNotFound); [INFO] [stdout] 56 | | } [INFO] [stdout] 57 | | } [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] 53 ~ if let Some(ref specification_id) = input.port_specification_id [INFO] [stdout] 54 ~ && !port_spec_repository::exists(conn, specification_id).await? { [INFO] [stdout] 55 | return Err(AddDevicePortError::PortSpecificationNotFound); [INFO] [stdout] 56 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/get_openvpn_client_passphrase.rs:47:18 [INFO] [stdout] | [INFO] [stdout] 47 | .map_err(|e| GetOpenvpnClientPassphraseError::Hash(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `GetOpenvpnClientPassphraseError::Hash` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/get_openvpn_client_passphrase.rs:69:14 [INFO] [stdout] | [INFO] [stdout] 69 | .map_err(|e| GetOpenvpnClientPassphraseError::Decryption(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `GetOpenvpnClientPassphraseError::Decryption` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/get_openvpn_server_passphrase.rs:55:18 [INFO] [stdout] | [INFO] [stdout] 55 | .map_err(|e| GetOpenvpnServerPassphraseError::Hash(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `GetOpenvpnServerPassphraseError::Hash` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/services/get_openvpn_server_passphrase.rs:77:14 [INFO] [stdout] | [INFO] [stdout] 77 | .map_err(|e| GetOpenvpnServerPassphraseError::Decryption(e))?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `GetOpenvpnServerPassphraseError::Decryption` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/services/get_radius_clients.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | / if let Ok(mut conn) = redis_pool.get().await { [INFO] [stdout] 20 | | if let Ok(Some(cached_data)) = redis_repo::get(&mut conn, key_prefix, CACHE_KEY).await { [INFO] [stdout] 21 | | if let Ok(items) = serde_json::from_str::>(&cached_data) { [INFO] [stdout] 22 | | log::debug!("radius_clients:get_all:cache_hit"); [INFO] [stdout] ... | [INFO] [stdout] 26 | | } [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] 19 ~ if let Ok(mut conn) = redis_pool.get().await [INFO] [stdout] 20 ~ && let Ok(Some(cached_data)) = redis_repo::get(&mut conn, key_prefix, CACHE_KEY).await { [INFO] [stdout] 21 | if let Ok(items) = serde_json::from_str::>(&cached_data) { [INFO] [stdout] ... [INFO] [stdout] 24 | } [INFO] [stdout] 25 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/services/get_radius_clients.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | / if let Ok(Some(cached_data)) = redis_repo::get(&mut conn, key_prefix, CACHE_KEY).await { [INFO] [stdout] 21 | | if let Ok(items) = serde_json::from_str::>(&cached_data) { [INFO] [stdout] 22 | | log::debug!("radius_clients:get_all:cache_hit"); [INFO] [stdout] 23 | | return Ok(items); [INFO] [stdout] 24 | | } [INFO] [stdout] 25 | | } [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] 20 ~ if let Ok(Some(cached_data)) = redis_repo::get(&mut conn, key_prefix, CACHE_KEY).await [INFO] [stdout] 21 ~ && let Ok(items) = serde_json::from_str::>(&cached_data) { [INFO] [stdout] 22 | log::debug!("radius_clients:get_all:cache_hit"); [INFO] [stdout] 23 | return Ok(items); [INFO] [stdout] 24 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/services/get_radius_clients.rs:32:5 [INFO] [stdout] | [INFO] [stdout] 32 | / if let Ok(mut conn) = redis_pool.get().await { [INFO] [stdout] 33 | | if let Ok(json_data) = serde_json::to_string(&items) { [INFO] [stdout] 34 | | let _ = redis_repo::create(&mut conn, key_prefix, CACHE_KEY, &json_data, Some(CACHE_TTL)).await; [INFO] [stdout] 35 | | } [INFO] [stdout] 36 | | } [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] 32 ~ if let Ok(mut conn) = redis_pool.get().await [INFO] [stdout] 33 ~ && let Ok(json_data) = serde_json::to_string(&items) { [INFO] [stdout] 34 | let _ = redis_repo::create(&mut conn, key_prefix, CACHE_KEY, &json_data, Some(CACHE_TTL)).await; [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/services/get_radius_vendors.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | / if let Ok(mut conn) = redis_pool.get().await { [INFO] [stdout] 20 | | if let Ok(Some(cached_data)) = redis_repo::get(&mut conn, key_prefix, CACHE_KEY).await { [INFO] [stdout] 21 | | if let Ok(items) = serde_json::from_str::>(&cached_data) { [INFO] [stdout] 22 | | log::debug!("radius_vendors:get_all:cache_hit"); [INFO] [stdout] ... | [INFO] [stdout] 26 | | } [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] 19 ~ if let Ok(mut conn) = redis_pool.get().await [INFO] [stdout] 20 ~ && let Ok(Some(cached_data)) = redis_repo::get(&mut conn, key_prefix, CACHE_KEY).await { [INFO] [stdout] 21 | if let Ok(items) = serde_json::from_str::>(&cached_data) { [INFO] [stdout] ... [INFO] [stdout] 24 | } [INFO] [stdout] 25 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/services/get_radius_vendors.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | / if let Ok(Some(cached_data)) = redis_repo::get(&mut conn, key_prefix, CACHE_KEY).await { [INFO] [stdout] 21 | | if let Ok(items) = serde_json::from_str::>(&cached_data) { [INFO] [stdout] 22 | | log::debug!("radius_vendors:get_all:cache_hit"); [INFO] [stdout] 23 | | return Ok(items); [INFO] [stdout] 24 | | } [INFO] [stdout] 25 | | } [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] 20 ~ if let Ok(Some(cached_data)) = redis_repo::get(&mut conn, key_prefix, CACHE_KEY).await [INFO] [stdout] 21 ~ && let Ok(items) = serde_json::from_str::>(&cached_data) { [INFO] [stdout] 22 | log::debug!("radius_vendors:get_all:cache_hit"); [INFO] [stdout] 23 | return Ok(items); [INFO] [stdout] 24 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/services/get_radius_vendors.rs:32:5 [INFO] [stdout] | [INFO] [stdout] 32 | / if let Ok(mut conn) = redis_pool.get().await { [INFO] [stdout] 33 | | if let Ok(json_data) = serde_json::to_string(&items) { [INFO] [stdout] 34 | | let _ = redis_repo::create(&mut conn, key_prefix, CACHE_KEY, &json_data, Some(CACHE_TTL)).await; [INFO] [stdout] 35 | | } [INFO] [stdout] 36 | | } [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] 32 ~ if let Ok(mut conn) = redis_pool.get().await [INFO] [stdout] 33 ~ && let Ok(json_data) = serde_json::to_string(&items) { [INFO] [stdout] 34 | let _ = redis_repo::create(&mut conn, key_prefix, CACHE_KEY, &json_data, Some(CACHE_TTL)).await; [INFO] [stdout] 35 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/services/update_device_port.rs:55:5 [INFO] [stdout] | [INFO] [stdout] 55 | / if let Some(ref specification_id) = input.port_specification_id { [INFO] [stdout] 56 | | if !port_spec_repository::exists(conn, specification_id).await? { [INFO] [stdout] 57 | | return Err(UpdateDevicePortError::PortSpecificationNotFound); [INFO] [stdout] 58 | | } [INFO] [stdout] 59 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 55 ~ if let Some(ref specification_id) = input.port_specification_id [INFO] [stdout] 56 ~ && !port_spec_repository::exists(conn, specification_id).await? { [INFO] [stdout] 57 | return Err(UpdateDevicePortError::PortSpecificationNotFound); [INFO] [stdout] 58 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/utils/http_response_helper.rs:362:5 [INFO] [stdout] | [INFO] [stdout] 362 | / if let Some(exp) = cookie_expire { [INFO] [stdout] 363 | | if exp > 0 { [INFO] [stdout] 364 | | builder = builder.max_age(Duration::seconds(exp as i64)); [INFO] [stdout] 365 | | } [INFO] [stdout] 366 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 362 ~ if let Some(exp) = cookie_expire [INFO] [stdout] 363 ~ && exp > 0 { [INFO] [stdout] 364 | builder = builder.max_age(Duration::seconds(exp as i64)); [INFO] [stdout] 365 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `contains()` instead of `iter().any()` is more efficient [INFO] [stdout] --> src/utils/sql_security_helper.rs:11:8 [INFO] [stdout] | [INFO] [stdout] 11 | if allowed.iter().any(|c| *c == column) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `allowed.contains(&column)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains [INFO] [stdout] = note: `#[warn(clippy::manual_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used consecutive `str::replace` call [INFO] [stdout] --> src/utils/sql_security_helper.rs:54:39 [INFO] [stdout] | [INFO] [stdout] 54 | let without_wildcards = collapsed.replace('%', "").replace('_', ""); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['%', '_'], "")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace [INFO] [stdout] = note: `#[warn(clippy::collapsible_str_replace)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used consecutive `str::replace` call [INFO] [stdout] --> src/utils/xss_security_helper.rs:44:11 [INFO] [stdout] | [INFO] [stdout] 44 | input.replace('<', "").replace('>', "") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `replace(['<', '>'], "")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_str_replace [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/validations/device/activate_radius_client_validation.rs:20:42 [INFO] [stdout] | [INFO] [stdout] 20 | } else if safe_device_id.len() != 36 { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 21 | | errors.push("device_id must be a valid UUID".to_string()); [INFO] [stdout] 22 | | } else if uuid::Uuid::parse_str(&safe_device_id).is_err() { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/validations/device/activate_radius_client_validation.rs:22:63 [INFO] [stdout] | [INFO] [stdout] 22 | } else if uuid::Uuid::parse_str(&safe_device_id).is_err() { [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 23 | | errors.push("device_id must be a valid UUID".to_string()); [INFO] [stdout] 24 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/validations/device/assign_openvpn_client_validation.rs:20:42 [INFO] [stdout] | [INFO] [stdout] 20 | } else if safe_device_id.len() != 36 { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 21 | | errors.push("device_id must be a valid UUID".to_string()); [INFO] [stdout] 22 | | } else if uuid::Uuid::parse_str(&safe_device_id).is_err() { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/validations/device/assign_openvpn_client_validation.rs:22:63 [INFO] [stdout] | [INFO] [stdout] 22 | } else if uuid::Uuid::parse_str(&safe_device_id).is_err() { [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 23 | | errors.push("device_id must be a valid UUID".to_string()); [INFO] [stdout] 24 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/validations/device/assign_openvpn_client_validation.rs:31:42 [INFO] [stdout] | [INFO] [stdout] 31 | } else if safe_client_id.len() != 36 { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 32 | | errors.push("openvpn_client_id must be a valid UUID".to_string()); [INFO] [stdout] 33 | | } else if uuid::Uuid::parse_str(&safe_client_id).is_err() { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/validations/device/assign_openvpn_client_validation.rs:33:63 [INFO] [stdout] | [INFO] [stdout] 33 | } else if uuid::Uuid::parse_str(&safe_client_id).is_err() { [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 34 | | errors.push("openvpn_client_id must be a valid UUID".to_string()); [INFO] [stdout] 35 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/validations/device/deactivate_radius_client_validation.rs:18:42 [INFO] [stdout] | [INFO] [stdout] 18 | } else if safe_device_id.len() != 36 { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 19 | | errors.push("device_id must be a valid UUID".to_string()); [INFO] [stdout] 20 | | } else if uuid::Uuid::parse_str(&safe_device_id).is_err() { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/validations/device/deactivate_radius_client_validation.rs:20:63 [INFO] [stdout] | [INFO] [stdout] 20 | } else if uuid::Uuid::parse_str(&safe_device_id).is_err() { [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 21 | | errors.push("device_id must be a valid UUID".to_string()); [INFO] [stdout] 22 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/validations/device/store_validation.rs:49:32 [INFO] [stdout] | [INFO] [stdout] 49 | Ok(lat) if lat >= -90.0 && lat <= 90.0 => {}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(-90.0..=90.0).contains(&lat)` [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: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/validations/device/store_validation.rs:53:32 [INFO] [stdout] | [INFO] [stdout] 53 | Ok(lon) if lon >= -180.0 && lon <= 180.0 => {}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(-180.0..=180.0).contains(&lon)` [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 `if` has identical blocks [INFO] [stdout] --> src/validations/device/unassign_openvpn_client_validation.rs:20:42 [INFO] [stdout] | [INFO] [stdout] 20 | } else if safe_device_id.len() != 36 { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 21 | | errors.push("device_id must be a valid UUID".to_string()); [INFO] [stdout] 22 | | } else if uuid::Uuid::parse_str(&safe_device_id).is_err() { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/validations/device/unassign_openvpn_client_validation.rs:22:63 [INFO] [stdout] | [INFO] [stdout] 22 | } else if uuid::Uuid::parse_str(&safe_device_id).is_err() { [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 23 | | errors.push("device_id must be a valid UUID".to_string()); [INFO] [stdout] 24 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/validations/device/unassign_openvpn_client_validation.rs:31:42 [INFO] [stdout] | [INFO] [stdout] 31 | } else if safe_client_id.len() != 36 { [INFO] [stdout] | __________________________________________^ [INFO] [stdout] 32 | | errors.push("openvpn_client_id must be a valid UUID".to_string()); [INFO] [stdout] 33 | | } else if uuid::Uuid::parse_str(&safe_client_id).is_err() { [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/validations/device/unassign_openvpn_client_validation.rs:33:63 [INFO] [stdout] | [INFO] [stdout] 33 | } else if uuid::Uuid::parse_str(&safe_client_id).is_err() { [INFO] [stdout] | _______________________________________________________________^ [INFO] [stdout] 34 | | errors.push("openvpn_client_id must be a valid UUID".to_string()); [INFO] [stdout] 35 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/validations/device/update_validation.rs:49:32 [INFO] [stdout] | [INFO] [stdout] 49 | Ok(lat) if lat >= -90.0 && lat <= 90.0 => {}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(-90.0..=90.0).contains(&lat)` [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/validations/device/update_validation.rs:53:32 [INFO] [stdout] | [INFO] [stdout] 53 | Ok(lon) if lon >= -180.0 && lon <= 180.0 => {}, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(-180.0..=180.0).contains(&lon)` [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 `if` statement can be collapsed [INFO] [stdout] --> src/validations/device_port/store_validation.rs:54:5 [INFO] [stdout] | [INFO] [stdout] 54 | / if let Some(position) = payload.position { [INFO] [stdout] 55 | | if position < 0 { [INFO] [stdout] 56 | | errors.push("position must be zero or positive".to_string()); [INFO] [stdout] 57 | | } [INFO] [stdout] 58 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 54 ~ if let Some(position) = payload.position [INFO] [stdout] 55 ~ && position < 0 { [INFO] [stdout] 56 | errors.push("position must be zero or positive".to_string()); [INFO] [stdout] 57 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/validations/device_port/update_validation.rs:56:5 [INFO] [stdout] | [INFO] [stdout] 56 | / if let Some(position) = payload.position { [INFO] [stdout] 57 | | if position < 0 { [INFO] [stdout] 58 | | errors.push("position must be zero or positive".to_string()); [INFO] [stdout] 59 | | } [INFO] [stdout] 60 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 56 ~ if let Some(position) = payload.position [INFO] [stdout] 57 ~ && position < 0 { [INFO] [stdout] 58 | errors.push("position must be zero or positive".to_string()); [INFO] [stdout] 59 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 3m 31s [INFO] [stderr] warning: the following packages contain code that will be rejected by a future version of Rust: sqlx-postgres v0.7.4 [INFO] [stderr] note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 2` [INFO] running `Command { std: "docker" "inspect" "7eab9be34308f4adab1f241902b1e233b1108c754cce12dc1d7332f388873a43", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "7eab9be34308f4adab1f241902b1e233b1108c754cce12dc1d7332f388873a43", kill_on_drop: false }` [INFO] [stdout] 7eab9be34308f4adab1f241902b1e233b1108c754cce12dc1d7332f388873a43