[INFO] cloning repository https://github.com/umi-labs/porter [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/umi-labs/porter" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fumi-labs%2Fporter", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fumi-labs%2Fporter'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 4fe8ea0fc77478064f5dd19d43258e5936480074 [INFO] linting umi-labs/porter against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fumi-labs%2Fporter" "/workspace/builds/worker-5-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/umi-labs/porter [INFO] finished tweaking git repo https://github.com/umi-labs/porter [INFO] tweaked toml for git repo https://github.com/umi-labs/porter written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/umi-labs/porter 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/umi-labs/porter 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 triomphe v0.1.14 [INFO] [stderr] Downloaded swc_visit_macros v0.5.13 [INFO] [stderr] Downloaded swc_macros_common v0.3.14 [INFO] [stderr] Downloaded hstr v0.2.17 [INFO] [stderr] Downloaded swc_ecma_visit v0.98.7 [INFO] [stderr] Downloaded swc_eq_ignore_macros v0.1.4 [INFO] [stderr] Downloaded swc_ecma_ast v0.112.8 [INFO] [stderr] Downloaded proc-macro2 v1.0.97 [INFO] [stderr] Downloaded ast_node v0.9.9 [INFO] [stderr] Downloaded swc_core v0.90.37 [INFO] [stderr] Downloaded from_variant v0.1.9 [INFO] [stderr] Downloaded better_scoped_tls v0.1.2 [INFO] [stderr] Downloaded unicode-id v0.3.5 [INFO] [stderr] Downloaded pest_meta v2.8.2 [INFO] [stderr] Downloaded vergen v8.3.2 [INFO] [stderr] Downloaded pest_generator v2.8.2 [INFO] [stderr] Downloaded pest_derive v2.8.2 [INFO] [stderr] Downloaded swc_ecma_utils v0.127.20 [INFO] [stderr] Downloaded swc_ecma_transforms_base v0.137.21 [INFO] [stderr] Downloaded syn v2.0.105 [INFO] [stderr] Downloaded camino v1.1.12 [INFO] [stderr] Downloaded pest v2.8.2 [INFO] [stderr] Downloaded psm v0.1.26 [INFO] [stderr] Downloaded swc_ecma_parser v0.143.16 [INFO] [stderr] Downloaded stacker v0.1.21 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] 566feb7b4b4bf439085af64dcb5f3a6856f04c2e67427b2dd9306d728d6f02f1 [INFO] running `Command { std: "docker" "start" "-a" "566feb7b4b4bf439085af64dcb5f3a6856f04c2e67427b2dd9306d728d6f02f1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "566feb7b4b4bf439085af64dcb5f3a6856f04c2e67427b2dd9306d728d6f02f1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "566feb7b4b4bf439085af64dcb5f3a6856f04c2e67427b2dd9306d728d6f02f1", kill_on_drop: false }` [INFO] [stdout] 566feb7b4b4bf439085af64dcb5f3a6856f04c2e67427b2dd9306d728d6f02f1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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] ff284c2accdd50d8d26c5ba629678ff48ce609f8354ea7ed0632afb601b88d80 [INFO] running `Command { std: "docker" "start" "-a" "ff284c2accdd50d8d26c5ba629678ff48ce609f8354ea7ed0632afb601b88d80", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.97 [INFO] [stderr] Compiling libc v0.2.175 [INFO] [stderr] Compiling memchr v2.7.5 [INFO] [stderr] Compiling regex-syntax v0.8.5 [INFO] [stderr] Compiling cc v1.2.32 [INFO] [stderr] Compiling rand_core v0.6.4 [INFO] [stderr] Checking tracing-core v0.1.34 [INFO] [stderr] Compiling lock_api v0.4.13 [INFO] [stderr] Compiling phf_shared v0.11.3 [INFO] [stderr] Checking hashbrown v0.15.5 [INFO] [stderr] Checking ahash v0.8.12 [INFO] [stderr] Compiling parking_lot_core v0.9.11 [INFO] [stderr] Checking either v1.15.0 [INFO] [stderr] Compiling thiserror v2.0.16 [INFO] [stderr] Checking scoped-tls v1.0.1 [INFO] [stderr] Compiling camino v1.1.12 [INFO] [stderr] Compiling anyhow v1.0.99 [INFO] [stderr] Compiling rand v0.8.5 [INFO] [stderr] Checking hashbrown v0.14.5 [INFO] [stderr] Checking indexmap v2.10.0 [INFO] [stderr] Compiling serde_json v1.0.142 [INFO] [stderr] Compiling semver v1.0.26 [INFO] [stderr] Compiling rustversion v1.0.22 [INFO] [stderr] Checking better_scoped_tls v0.1.2 [INFO] [stderr] Checking unicode-id-start v1.4.0 [INFO] [stderr] Checking http v0.2.12 [INFO] [stderr] Compiling smartstring v1.0.1 [INFO] [stderr] Compiling rustls v0.21.12 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking anstyle v1.0.11 [INFO] [stderr] Compiling rustix v1.0.8 [INFO] [stderr] Checking anstream v0.6.20 [INFO] [stderr] Checking typed-arena v2.0.2 [INFO] [stderr] Checking unicode-id v0.3.5 [INFO] [stderr] Compiling phf_generator v0.11.3 [INFO] [stderr] Checking thread_local v1.1.9 [INFO] [stderr] Checking clap_lex v0.7.5 [INFO] [stderr] Checking unicode-width v0.2.1 [INFO] [stderr] Checking winnow v0.7.12 [INFO] [stderr] Compiling quote v1.0.40 [INFO] [stderr] Compiling vergen v8.3.2 [INFO] [stderr] Compiling syn v2.0.105 [INFO] [stderr] Checking getrandom v0.2.16 [INFO] [stderr] Checking atty v0.2.14 [INFO] [stderr] Checking parking_lot v0.12.4 [INFO] [stderr] Checking signal-hook-registry v1.4.6 [INFO] [stderr] Checking socket2 v0.6.0 [INFO] [stderr] Checking mio v1.0.4 [INFO] [stderr] Checking socket2 v0.5.10 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking num_cpus v1.17.0 [INFO] [stderr] Checking getrandom v0.3.3 [INFO] [stderr] Checking clap_builder v4.5.44 [INFO] [stderr] Checking console v0.15.11 [INFO] [stderr] Checking fuzzy-matcher v0.3.7 [INFO] [stderr] Checking encoding_rs v0.8.35 [INFO] [stderr] Checking jiff v0.2.15 [INFO] [stderr] Checking http-body v0.4.6 [INFO] [stderr] Checking unsafe-libyaml v0.2.11 [INFO] [stderr] Checking rayon v1.11.0 [INFO] [stderr] Checking dashmap v5.5.3 [INFO] [stderr] Checking libloading v0.8.8 [INFO] [stderr] Checking glob v0.3.3 [INFO] [stderr] Compiling ring v0.17.14 [INFO] [stderr] Compiling psm v0.1.26 [INFO] [stderr] Compiling stacker v0.1.21 [INFO] [stderr] Checking tempfile v3.20.0 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Checking env_filter v0.1.3 [INFO] [stderr] Checking env_logger v0.11.8 [INFO] [stderr] Checking sct v0.7.1 [INFO] [stderr] Checking rustls-webpki v0.101.7 [INFO] [stderr] Compiling Inflector v0.11.4 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Compiling swc_macros_common v0.3.14 [INFO] [stderr] Compiling serde_derive v1.0.219 [INFO] [stderr] Compiling zerovec-derive v0.11.1 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling tracing-attributes v0.1.30 [INFO] [stderr] Compiling phf_macros v0.11.3 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Compiling thiserror-impl v2.0.16 [INFO] [stderr] Compiling swc_eq_ignore_macros v0.1.4 [INFO] [stderr] Compiling futures-macro v0.3.31 [INFO] [stderr] Compiling tokio-macros v2.5.0 [INFO] [stderr] Compiling is-macro v0.3.7 [INFO] [stderr] Compiling clap_derive v4.5.45 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.8.0 [INFO] [stderr] Compiling swc_visit_macros v0.5.13 [INFO] [stderr] Compiling ast_node v0.9.9 [INFO] [stderr] Compiling from_variant v0.1.9 [INFO] [stderr] Checking phf v0.11.3 [INFO] [stderr] Checking tokio v1.47.1 [INFO] [stderr] Compiling string_enum v0.4.4 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Compiling thiserror v1.0.69 [INFO] [stderr] Checking dialoguer v0.11.0 [INFO] [stderr] Checking yoke v0.8.0 [INFO] [stderr] Checking tracing v0.1.41 [INFO] [stderr] Checking clap v4.5.45 [INFO] [stderr] Checking zerovec v0.11.4 [INFO] [stderr] Checking zerotrie v0.2.2 [INFO] [stderr] Checking pest v2.8.2 [INFO] [stderr] Checking swc_visit v0.5.14 [INFO] [stderr] Checking serde v1.0.219 [INFO] [stderr] Checking tinystr v0.8.1 [INFO] [stderr] Checking potential_utf v0.1.2 [INFO] [stderr] Checking icu_collections v2.0.0 [INFO] [stderr] Checking icu_locale_core v2.0.0 [INFO] [stderr] Compiling pest_meta v2.8.2 [INFO] [stderr] Checking icu_provider v2.0.0 [INFO] [stderr] Checking icu_properties v2.0.1 [INFO] [stderr] Checking icu_normalizer v2.0.0 [INFO] [stderr] Compiling pest_generator v2.8.2 [INFO] [stderr] Checking futures-executor v0.3.31 [INFO] [stderr] Checking futures v0.3.31 [INFO] [stderr] Compiling pest_derive v2.8.2 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Checking idna v1.0.3 [INFO] [stderr] Checking url v2.5.4 [INFO] [stderr] Compiling cargo-platform v0.1.9 [INFO] [stderr] Checking tokio-util v0.7.16 [INFO] [stderr] Checking tokio-rustls v0.24.1 [INFO] [stderr] Checking triomphe v0.1.14 [INFO] [stderr] Checking num-bigint v0.4.6 [INFO] [stderr] Checking serde_spanned v0.6.9 [INFO] [stderr] Checking toml_datetime v0.6.11 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking serde_yaml v0.9.34+deprecated [INFO] [stderr] Checking chrono v0.4.41 [INFO] [stderr] Checking json5 v0.4.1 [INFO] [stderr] Checking toml_edit v0.22.27 [INFO] [stderr] Checking hstr v0.2.17 [INFO] [stderr] Checking swc_atoms v0.6.7 [INFO] [stderr] Checking h2 v0.3.27 [INFO] [stderr] Compiling cargo_metadata v0.18.1 [INFO] [stderr] Checking swc_common v0.33.26 [INFO] [stderr] Compiling swc_core v0.90.37 [INFO] [stderr] Checking toml v0.8.23 [INFO] [stderr] Checking hyper v0.14.32 [INFO] [stderr] Checking swc_ecma_ast v0.112.8 [INFO] [stderr] Checking hyper-rustls v0.24.2 [INFO] [stderr] Checking reqwest v0.11.27 [INFO] [stderr] Checking swc_ecma_visit v0.98.7 [INFO] [stderr] Checking swc_ecma_parser v0.143.16 [INFO] [stderr] Checking swc_ecma_utils v0.127.20 [INFO] [stderr] Checking swc_ecma_transforms_base v0.137.21 [INFO] [stderr] Checking porter v1.0.46 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused imports: `dlog_result`, `dlog_success`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/mapping/generator.rs:15:13 [INFO] [stdout] | [INFO] [stdout] 15 | use crate::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `FlattenedTemplate` [INFO] [stdout] --> src/mapping/graph.rs:6:42 [INFO] [stdout] | [INFO] [stdout] 6 | use crate::parser::{PayloadSchemaParser, FlattenedTemplate}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `dlog_data`, `dlog_error`, `dlog_file`, `dlog_info`, `dlog_result`, `dlog_step`, `dlog_success`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/mapping/graph.rs:89:17 [INFO] [stdout] | [INFO] [stdout] 89 | ...te::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `dlog_data`, `dlog_error`, `dlog_file`, `dlog_info`, `dlog_result`, `dlog_step`, `dlog_success`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/mapping/graph.rs:182:17 [INFO] [stdout] | [INFO] [stdout] 182 | ...te::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `dlog_data`, `dlog_error`, `dlog_file`, `dlog_info`, `dlog_result`, `dlog_step`, `dlog_success`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/mapping/schema_introspect.rs:7:13 [INFO] [stdout] | [INFO] [stdout] 7 | use crate::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `dlog_result`, `dlog_success`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/mapping/generator.rs:15:13 [INFO] [stdout] | [INFO] [stdout] 15 | use crate::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `dlog_data`, `dlog_error`, `dlog_file`, `dlog_info`, `dlog_result`, `dlog_step`, `dlog_success`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/mapping/mod.rs:16:13 [INFO] [stdout] | [INFO] [stdout] 16 | use crate::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `FlattenedTemplate` [INFO] [stdout] --> src/mapping/graph.rs:6:42 [INFO] [stdout] | [INFO] [stdout] 6 | use crate::parser::{PayloadSchemaParser, FlattenedTemplate}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::HashMap` [INFO] [stdout] --> src/mapping/mod.rs:663:9 [INFO] [stdout] | [INFO] [stdout] 663 | use std::collections::HashMap; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `dlog_data`, `dlog_error`, `dlog_file`, `dlog_info`, `dlog_result`, `dlog_step`, `dlog_success`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/mapping/graph.rs:89:17 [INFO] [stdout] | [INFO] [stdout] 89 | ...te::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `dlog_data`, `dlog_error`, `dlog_file`, `dlog_info`, `dlog_result`, `dlog_step`, `dlog_success`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/mapping/graph.rs:182:17 [INFO] [stdout] | [INFO] [stdout] 182 | ...te::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `dlog_data`, `dlog_error`, `dlog_file`, `dlog_info`, `dlog_result`, `dlog_step`, `dlog_success`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/mapping/schema_introspect.rs:7:13 [INFO] [stdout] | [INFO] [stdout] 7 | use crate::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `dlog_data`, `dlog_error`, `dlog_file`, `dlog_info`, `dlog_result`, `dlog_step`, `dlog_success`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/mapping/mod.rs:16:13 [INFO] [stdout] | [INFO] [stdout] 16 | use crate::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::HashMap` [INFO] [stdout] --> src/mapping/mod.rs:663:9 [INFO] [stdout] | [INFO] [stdout] 663 | use std::collections::HashMap; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `AccessConfig`, `AdminConfig`, `CollectionSchema`, `DateAdmin`, `DateConfig`, and `HooksConfig` [INFO] [stdout] --> src/parser/ast_analyzer.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | CollectionSchema, FieldDefinition, FieldAdmin, FieldType, BlockDefinition, BlockLabels, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] 3 | TabDefinition, SelectOption, DateAdmin, DateConfig, HooksConfig, AccessConfig, AdminConfig, [INFO] [stdout] | ^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `SchemaParseError` [INFO] [stdout] --> src/parser/ast_analyzer.rs:6:29 [INFO] [stdout] | [INFO] [stdout] 6 | use super::errors::{Result, SchemaParseError}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `VisitWith` and `Visit` [INFO] [stdout] --> src/parser/ast_analyzer.rs:8:29 [INFO] [stdout] | [INFO] [stdout] 8 | use swc_core::ecma::visit::{Visit, VisitWith}; [INFO] [stdout] | ^^^^^ ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `dlog_error`, `dlog_file`, `dlog_result`, `dlog_step`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/parser/ast_analyzer.rs:10:13 [INFO] [stdout] | [INFO] [stdout] 10 | use crate::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::HashMap` [INFO] [stdout] --> src/mapping/mod.rs:1614:13 [INFO] [stdout] | [INFO] [stdout] 1614 | use std::collections::HashMap; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `AccessConfig`, `AdminConfig`, `BlockDefinition`, `BlockLabels`, `DateAdmin`, `DateConfig`, `HooksConfig`, `ImportInfo`, `SelectOption`, and `TabDefinition` [INFO] [stdout] --> src/parser/import_resolver.rs:2:63 [INFO] [stdout] | [INFO] [stdout] 2 | CollectionSchema, FieldDefinition, FieldAdmin, FieldType, BlockDefinition, BlockLabels, [INFO] [stdout] | ^^^^^^^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] 3 | TabDefinition, SelectOption, DateAdmin, DateConfig, HooksConfig, AccessConfig, AdminConfig, [INFO] [stdout] | ^^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] 4 | ImportInfo, ImportSpecifier, SourceLocation [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `PathAliasMapping` [INFO] [stdout] --> src/parser/import_resolver.rs:8:40 [INFO] [stdout] | [INFO] [stdout] 8 | use crate::config::{TypescriptSection, PathAliasMapping}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `HashSet` [INFO] [stdout] --> src/parser/import_resolver.rs:9:33 [INFO] [stdout] | [INFO] [stdout] 9 | use std::collections::{HashMap, HashSet}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `dlog_result`, `dlog_step`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/parser/import_resolver.rs:15:13 [INFO] [stdout] | [INFO] [stdout] 15 | use crate::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `FieldAdmin` [INFO] [stdout] --> src/parser/import_resolver.rs:551:48 [INFO] [stdout] | [INFO] [stdout] 551 | use crate::parser::schema::{FieldType, FieldAdmin}; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `FieldAdmin` [INFO] [stdout] --> src/parser/import_resolver.rs:650:48 [INFO] [stdout] | [INFO] [stdout] 650 | use crate::parser::schema::{FieldType, FieldAdmin}; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `dlog_data`, `dlog_error`, `dlog_file`, `dlog_info`, `dlog_result`, `dlog_step`, `dlog_success`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/parser/template_generator.rs:5:13 [INFO] [stdout] | [INFO] [stdout] 5 | use crate::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ast_analyzer::AstAnalyzer` [INFO] [stdout] --> src/parser/mod.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | use ast_analyzer::AstAnalyzer; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `dlog_data`, `dlog_error`, `dlog_file`, `dlog_info`, `dlog_result`, `dlog_step`, `dlog_success`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/parser/mod.rs:18:13 [INFO] [stdout] | [INFO] [stdout] 18 | use crate::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `AccessConfig`, `AdminConfig`, `CollectionSchema`, `DateAdmin`, `DateConfig`, and `HooksConfig` [INFO] [stdout] --> src/parser/ast_analyzer.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | CollectionSchema, FieldDefinition, FieldAdmin, FieldType, BlockDefinition, BlockLabels, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] 3 | TabDefinition, SelectOption, DateAdmin, DateConfig, HooksConfig, AccessConfig, AdminConfig, [INFO] [stdout] | ^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `SchemaParseError` [INFO] [stdout] --> src/parser/ast_analyzer.rs:6:29 [INFO] [stdout] | [INFO] [stdout] 6 | use super::errors::{Result, SchemaParseError}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `VisitWith` and `Visit` [INFO] [stdout] --> src/parser/ast_analyzer.rs:8:29 [INFO] [stdout] | [INFO] [stdout] 8 | use swc_core::ecma::visit::{Visit, VisitWith}; [INFO] [stdout] | ^^^^^ ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `dlog_error`, `dlog_file`, `dlog_result`, `dlog_step`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/parser/ast_analyzer.rs:10:13 [INFO] [stdout] | [INFO] [stdout] 10 | use crate::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `AccessConfig`, `AdminConfig`, `BlockDefinition`, `BlockLabels`, `DateAdmin`, `DateConfig`, `HooksConfig`, `ImportInfo`, `SelectOption`, and `TabDefinition` [INFO] [stdout] --> src/parser/import_resolver.rs:2:63 [INFO] [stdout] | [INFO] [stdout] 2 | CollectionSchema, FieldDefinition, FieldAdmin, FieldType, BlockDefinition, BlockLabels, [INFO] [stdout] | ^^^^^^^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] 3 | TabDefinition, SelectOption, DateAdmin, DateConfig, HooksConfig, AccessConfig, AdminConfig, [INFO] [stdout] | ^^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] 4 | ImportInfo, ImportSpecifier, SourceLocation [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `PathAliasMapping` [INFO] [stdout] --> src/parser/import_resolver.rs:8:40 [INFO] [stdout] | [INFO] [stdout] 8 | use crate::config::{TypescriptSection, PathAliasMapping}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `HashSet` [INFO] [stdout] --> src/parser/import_resolver.rs:9:33 [INFO] [stdout] | [INFO] [stdout] 9 | use std::collections::{HashMap, HashSet}; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `dlog_result`, `dlog_step`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/parser/import_resolver.rs:15:13 [INFO] [stdout] | [INFO] [stdout] 15 | use crate::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `FieldAdmin` [INFO] [stdout] --> src/parser/import_resolver.rs:551:48 [INFO] [stdout] | [INFO] [stdout] 551 | use crate::parser::schema::{FieldType, FieldAdmin}; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `FieldAdmin` [INFO] [stdout] --> src/parser/import_resolver.rs:650:48 [INFO] [stdout] | [INFO] [stdout] 650 | use crate::parser::schema::{FieldType, FieldAdmin}; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `dlog_data`, `dlog_error`, `dlog_file`, `dlog_info`, `dlog_result`, `dlog_step`, `dlog_success`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/parser/template_generator.rs:5:13 [INFO] [stdout] | [INFO] [stdout] 5 | use crate::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::parser::errors::Result` [INFO] [stdout] --> src/parser/tests.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | use crate::parser::errors::Result; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::path::PathBuf` [INFO] [stdout] --> src/parser/tests.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | use std::path::PathBuf; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ast_analyzer::AstAnalyzer` [INFO] [stdout] --> src/parser/mod.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | use ast_analyzer::AstAnalyzer; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `dlog_data`, `dlog_error`, `dlog_file`, `dlog_info`, `dlog_result`, `dlog_step`, `dlog_success`, `dlog_warning`, and `dlog` [INFO] [stdout] --> src/parser/mod.rs:18:13 [INFO] [stdout] | [INFO] [stdout] 18 | use crate::{dlog, dlog_info, dlog_success, dlog_warning, dlog_error, dlog_step, dlog_data, dlog_file, dlog_processing, dlog_result}; [INFO] [stdout] | ^^^^ ^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `class` [INFO] [stdout] --> src/parser/ast_analyzer.rs:203:32 [INFO] [stdout] | [INFO] [stdout] 203 | DefaultDecl::Class(class) => { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_class` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `func` [INFO] [stdout] --> src/parser/ast_analyzer.rs:206:29 [INFO] [stdout] | [INFO] [stdout] 206 | DefaultDecl::Fn(func) => { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_func` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `type_str` is never read [INFO] [stdout] --> src/parser/ast_analyzer.rs:701:28 [INFO] [stdout] | [INFO] [stdout] 701 | let mut type_str = String::new(); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `schema` [INFO] [stdout] --> src/parser/import_resolver.rs:473:38 [INFO] [stdout] | [INFO] [stdout] 473 | fn merge_namespace_import(&self, schema: &mut CollectionSchema, parsed: &ParsedFile, local: &str) -> Result<()> { [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_schema` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `parsed` [INFO] [stdout] --> src/parser/import_resolver.rs:473:69 [INFO] [stdout] | [INFO] [stdout] 473 | fn merge_namespace_import(&self, schema: &mut CollectionSchema, parsed: &ParsedFile, local: &str) -> Result<()> { [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_parsed` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `class` [INFO] [stdout] --> src/parser/ast_analyzer.rs:203:32 [INFO] [stdout] | [INFO] [stdout] 203 | DefaultDecl::Class(class) => { [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_class` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `func` [INFO] [stdout] --> src/parser/ast_analyzer.rs:206:29 [INFO] [stdout] | [INFO] [stdout] 206 | DefaultDecl::Fn(func) => { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_func` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `type_str` is never read [INFO] [stdout] --> src/parser/ast_analyzer.rs:701:28 [INFO] [stdout] | [INFO] [stdout] 701 | let mut type_str = String::new(); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `schema` [INFO] [stdout] --> src/parser/import_resolver.rs:473:38 [INFO] [stdout] | [INFO] [stdout] 473 | fn merge_namespace_import(&self, schema: &mut CollectionSchema, parsed: &ParsedFile, local: &str) -> Result<()> { [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_schema` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `parsed` [INFO] [stdout] --> src/parser/import_resolver.rs:473:69 [INFO] [stdout] | [INFO] [stdout] 473 | fn merge_namespace_import(&self, schema: &mut CollectionSchema, parsed: &ParsedFile, local: &str) -> Result<()> { [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_parsed` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `base_dir` is never read [INFO] [stdout] --> src/parser/mod.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 20 | pub struct PayloadSchemaParser { [INFO] [stdout] | ------------------- field in this struct [INFO] [stdout] 21 | base_dir: PathBuf, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `current_path` is never read [INFO] [stdout] --> src/parser/ast_analyzer.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 13 | pub struct AstAnalyzer { [INFO] [stdout] | ----------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 18 | current_path: Vec, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `AstAnalyzer` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `0` and `1` are never read [INFO] [stdout] --> src/parser/ast_analyzer.rs:26:14 [INFO] [stdout] | [INFO] [stdout] 26 | Function(String, Module), // function name and its AST [INFO] [stdout] | -------- ^^^^^^ ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | fields in this variant [INFO] [stdout] | [INFO] [stdout] = note: `ExportedItem` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields [INFO] [stdout] | [INFO] [stdout] 26 - Function(String, Module), // function name and its AST [INFO] [stdout] 26 + Function((), ()), // function name and its AST [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/parser/ast_analyzer.rs:28:11 [INFO] [stdout] | [INFO] [stdout] 28 | Array(ArrayLit), [INFO] [stdout] | ----- ^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `ExportedItem` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 28 - Array(ArrayLit), [INFO] [stdout] 28 + Array(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Field` is never constructed [INFO] [stdout] --> src/parser/ast_analyzer.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 22 | pub enum ExportedItem { [INFO] [stdout] | ------------ variant in this enum [INFO] [stdout] 23 | Field(FieldDefinition), [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ExportedItem` 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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/adapters/source.rs:68:10 [INFO] [stdout] | [INFO] [stdout] 68 | ) -> Pin< [INFO] [stdout] | __________^ [INFO] [stdout] 69 | | Box< [INFO] [stdout] 70 | | dyn Future> + Send>>>> [INFO] [stdout] 71 | | + Send [INFO] [stdout] 72 | | + '_, [INFO] [stdout] 73 | | >, [INFO] [stdout] 74 | | >; [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/adapters/source.rs:98:10 [INFO] [stdout] | [INFO] [stdout] 98 | ) -> Pin< [INFO] [stdout] | __________^ [INFO] [stdout] 99 | | Box< [INFO] [stdout] 100 | | dyn Future> + Send>>>> [INFO] [stdout] 101 | | + Send [INFO] [stdout] 102 | | + '_, [INFO] [stdout] 103 | | >, [INFO] [stdout] 104 | | >; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `base_dir` is never read [INFO] [stdout] --> src/parser/mod.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 20 | pub struct PayloadSchemaParser { [INFO] [stdout] | ------------------- field in this struct [INFO] [stdout] 21 | base_dir: PathBuf, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `current_path` is never read [INFO] [stdout] --> src/parser/ast_analyzer.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 13 | pub struct AstAnalyzer { [INFO] [stdout] | ----------- field in this struct [INFO] [stdout] ... [INFO] [stdout] 18 | current_path: Vec, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `AstAnalyzer` has a derived impl for the trait `Clone`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `0` and `1` are never read [INFO] [stdout] --> src/parser/ast_analyzer.rs:26:14 [INFO] [stdout] | [INFO] [stdout] 26 | Function(String, Module), // function name and its AST [INFO] [stdout] | -------- ^^^^^^ ^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | fields in this variant [INFO] [stdout] | [INFO] [stdout] = note: `ExportedItem` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the fields to be of unit type to suppress this warning while preserving the field numbering, or remove the fields [INFO] [stdout] | [INFO] [stdout] 26 - Function(String, Module), // function name and its AST [INFO] [stdout] 26 + Function((), ()), // function name and its AST [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/parser/ast_analyzer.rs:28:11 [INFO] [stdout] | [INFO] [stdout] 28 | Array(ArrayLit), [INFO] [stdout] | ----- ^^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `ExportedItem` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 28 - Array(ArrayLit), [INFO] [stdout] 28 + Array(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Field` is never constructed [INFO] [stdout] --> src/parser/ast_analyzer.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 22 | pub enum ExportedItem { [INFO] [stdout] | ------------ variant in this enum [INFO] [stdout] 23 | Field(FieldDefinition), [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `ExportedItem` 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: function `create_span` is never used [INFO] [stdout] --> src/parser/tests.rs:38:8 [INFO] [stdout] | [INFO] [stdout] 38 | fn create_span() -> Span { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: items after a test module [INFO] [stdout] --> src/lib.rs:15:1 [INFO] [stdout] | [INFO] [stdout] 15 | mod tests { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 25 | pub use adapter::{SourceReader, TargetOptions, TargetWriter}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 26 | pub use plugin::{PluginManager, PluginRegistrar}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 27 | pub use sources::umbraco::UmbracoSource; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 28 | pub use sources::wordpress::WordPressSource; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] 29 | pub use targets::payload::PayloadTarget; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#items_after_test_module [INFO] [stdout] = note: `#[warn(clippy::items_after_test_module)]` on by default [INFO] [stdout] = help: move the items to before the test module was defined [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/adapters/source.rs:68:10 [INFO] [stdout] | [INFO] [stdout] 68 | ) -> Pin< [INFO] [stdout] | __________^ [INFO] [stdout] 69 | | Box< [INFO] [stdout] 70 | | dyn Future> + Send>>>> [INFO] [stdout] 71 | | + Send [INFO] [stdout] 72 | | + '_, [INFO] [stdout] 73 | | >, [INFO] [stdout] 74 | | >; [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/adapters/source.rs:98:10 [INFO] [stdout] | [INFO] [stdout] 98 | ) -> Pin< [INFO] [stdout] | __________^ [INFO] [stdout] 99 | | Box< [INFO] [stdout] 100 | | dyn Future> + Send>>>> [INFO] [stdout] 101 | | + Send [INFO] [stdout] 102 | | + '_, [INFO] [stdout] 103 | | >, [INFO] [stdout] 104 | | >; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/batch/mod.rs:114:36 [INFO] [stdout] | [INFO] [stdout] 114 | self.stats.total_batches = (all_documents.len() + self.config.batch_size - 1) / self.config.batch_size; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `all_documents.len().div_ceil(self.config.batch_size)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/batch/mod.rs:136:13 [INFO] [stdout] | [INFO] [stdout] 136 | / if let Some(ref checkpoint) = checkpoint { [INFO] [stdout] 137 | | if batch_index < checkpoint.last_completed_batch { [INFO] [stdout] 138 | | info!("Skipping batch {} (already completed)", batch_index + 1); [INFO] [stdout] 139 | | self.stats.processed_documents += end_idx - start_idx; [INFO] [stdout] ... | [INFO] [stdout] 142 | | } [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] 136 ~ if let Some(ref checkpoint) = checkpoint [INFO] [stdout] 137 ~ && batch_index < checkpoint.last_completed_batch { [INFO] [stdout] 138 | info!("Skipping batch {} (already completed)", batch_index + 1); [INFO] [stdout] 139 | self.stats.processed_documents += end_idx - start_idx; [INFO] [stdout] 140 | continue; [INFO] [stdout] 141 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `clone` can be replaced with `std::slice::from_ref` [INFO] [stdout] --> src/batch/mod.rs:214:51 [INFO] [stdout] | [INFO] [stdout] 214 | let documents = source.read_documents(&[file_path.clone()])?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `std::slice::from_ref(file_path)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cloned_ref_to_slice_refs [INFO] [stdout] = note: `#[warn(clippy::cloned_ref_to_slice_refs)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/batch/mod.rs:114:36 [INFO] [stdout] | [INFO] [stdout] 114 | self.stats.total_batches = (all_documents.len() + self.config.batch_size - 1) / self.config.batch_size; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `all_documents.len().div_ceil(self.config.batch_size)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/batch/mod.rs:136:13 [INFO] [stdout] | [INFO] [stdout] 136 | / if let Some(ref checkpoint) = checkpoint { [INFO] [stdout] 137 | | if batch_index < checkpoint.last_completed_batch { [INFO] [stdout] 138 | | info!("Skipping batch {} (already completed)", batch_index + 1); [INFO] [stdout] 139 | | self.stats.processed_documents += end_idx - start_idx; [INFO] [stdout] ... | [INFO] [stdout] 142 | | } [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] 136 ~ if let Some(ref checkpoint) = checkpoint [INFO] [stdout] 137 ~ && batch_index < checkpoint.last_completed_batch { [INFO] [stdout] 138 | info!("Skipping batch {} (already completed)", batch_index + 1); [INFO] [stdout] 139 | self.stats.processed_documents += end_idx - start_idx; [INFO] [stdout] 140 | continue; [INFO] [stdout] 141 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this call to `clone` can be replaced with `std::slice::from_ref` [INFO] [stdout] --> src/batch/mod.rs:214:51 [INFO] [stdout] | [INFO] [stdout] 214 | let documents = source.read_documents(&[file_path.clone()])?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try: `std::slice::from_ref(file_path)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cloned_ref_to_slice_refs [INFO] [stdout] = note: `#[warn(clippy::cloned_ref_to_slice_refs)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/config.rs:391:69 [INFO] [stdout] | [INFO] [stdout] 391 | let auth_config = config.metadata.as_ref().and_then(|m| build_auth_config_from_metadata(m)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `build_auth_config_from_metadata` [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/config.rs:465:13 [INFO] [stdout] | [INFO] [stdout] 465 | / if std::path::Path::new(&tsconfig_path).exists() { [INFO] [stdout] 466 | | if let Ok(raw) = std::fs::read_to_string(&tsconfig_path) { [INFO] [stdout] 467 | | let parsed: Option = serde_json::from_str::(&raw).ok() [INFO] [stdout] 468 | | .or_else(|| json5::from_str::(&raw).ok()); [INFO] [stdout] ... | [INFO] [stdout] 493 | | } [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] 465 ~ if std::path::Path::new(&tsconfig_path).exists() [INFO] [stdout] 466 ~ && let Ok(raw) = std::fs::read_to_string(&tsconfig_path) { [INFO] [stdout] 467 | let parsed: Option = serde_json::from_str::(&raw).ok() [INFO] [stdout] ... [INFO] [stdout] 491 | } [INFO] [stdout] 492 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/config.rs:469:21 [INFO] [stdout] | [INFO] [stdout] 469 | / if let Some(json) = parsed { [INFO] [stdout] 470 | | if let Some(paths) = json [INFO] [stdout] 471 | | .get("compilerOptions") [INFO] [stdout] 472 | | .and_then(|c| c.get("paths")) [INFO] [stdout] ... | [INFO] [stdout] 491 | | } [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] 469 ~ if let Some(json) = parsed [INFO] [stdout] 470 ~ && let Some(paths) = json [INFO] [stdout] 471 | .get("compilerOptions") [INFO] [stdout] ... [INFO] [stdout] 489 | } [INFO] [stdout] 490 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/config.rs:588:25 [INFO] [stdout] | [INFO] [stdout] 588 | .unwrap_or_else(|| Vec::new()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vec::new` [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/mapping/generator.rs:93:13 [INFO] [stdout] | [INFO] [stdout] 93 | / if let Some(schema_path) = &collection.collection_path { [INFO] [stdout] 94 | | if Path::new(schema_path).exists() { [INFO] [stdout] 95 | | let graph_path = format!("{}/{}.json", graphs_dir_path, collection.name); [INFO] [stdout] 96 | | let tpl_path = format!("{}/{}.template.json", templates_dir_path, collection.name); [INFO] [stdout] ... | [INFO] [stdout] 129 | | } [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] 93 ~ if let Some(schema_path) = &collection.collection_path [INFO] [stdout] 94 ~ && Path::new(schema_path).exists() { [INFO] [stdout] 95 | let graph_path = format!("{}/{}.json", graphs_dir_path, collection.name); [INFO] [stdout] ... [INFO] [stdout] 127 | } [INFO] [stdout] 128 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/generator.rs:106:25 [INFO] [stdout] | [INFO] [stdout] 106 | / if let Some(ts) = &self.config.typescript { [INFO] [stdout] 107 | | if !ts.tsconfig_path.is_empty() { [INFO] [stdout] 108 | | let _ = crate::mapping::schema_introspect::configure_ts_paths_from_file(&ts.tsconfig_path); [INFO] [stdout] 109 | | } [INFO] [stdout] 110 | | } [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] 106 ~ if let Some(ts) = &self.config.typescript [INFO] [stdout] 107 ~ && !ts.tsconfig_path.is_empty() { [INFO] [stdout] 108 | let _ = crate::mapping::schema_introspect::configure_ts_paths_from_file(&ts.tsconfig_path); [INFO] [stdout] 109 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/mapping/generator.rs:135:49 [INFO] [stdout] | [INFO] [stdout] 135 | println!("{} {}", "📁 Check the".cyan(), format!("{}", mappings_base).cyan()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `mappings_base.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/generator.rs:558:21 [INFO] [stdout] | [INFO] [stdout] 558 | / if let Some(ts) = &self.config.typescript { [INFO] [stdout] 559 | | if !ts.tsconfig_path.is_empty() { [INFO] [stdout] 560 | | let _ = crate::mapping::schema_introspect::configure_ts_paths_from_file(&ts.tsconfig_path); [INFO] [stdout] 561 | | } [INFO] [stdout] 562 | | } [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] 558 ~ if let Some(ts) = &self.config.typescript [INFO] [stdout] 559 ~ && !ts.tsconfig_path.is_empty() { [INFO] [stdout] 560 | let _ = crate::mapping::schema_introspect::configure_ts_paths_from_file(&ts.tsconfig_path); [INFO] [stdout] 561 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/mapping/generator.rs:600:26 [INFO] [stdout] | [INFO] [stdout] 600 | let porter_dir = self.config.metadata.as_ref() [INFO] [stdout] | __________________________^ [INFO] [stdout] 601 | | .and_then(|m| m.get("porter_format_dir")).map(|s| s.clone()) [INFO] [stdout] | |________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] help: consider calling the dedicated `cloned` method [INFO] [stdout] | [INFO] [stdout] 600 ~ let porter_dir = self.config.metadata.as_ref() [INFO] [stdout] 601 + .and_then(|m| m.get("porter_format_dir")).cloned() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/graph.rs:196:13 [INFO] [stdout] | [INFO] [stdout] 196 | / if let Ok(content) = std::fs::read_to_string(&config_path) { [INFO] [stdout] 197 | | if let Ok(config) = toml::from_str::(&content) { [INFO] [stdout] 198 | | return config.typescript; [INFO] [stdout] 199 | | } [INFO] [stdout] 200 | | } [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] 196 ~ if let Ok(content) = std::fs::read_to_string(&config_path) [INFO] [stdout] 197 ~ && let Ok(config) = toml::from_str::(&content) { [INFO] [stdout] 198 | return config.typescript; [INFO] [stdout] 199 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/config.rs:391:69 [INFO] [stdout] | [INFO] [stdout] 391 | let auth_config = config.metadata.as_ref().and_then(|m| build_auth_config_from_metadata(m)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `build_auth_config_from_metadata` [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/config.rs:465:13 [INFO] [stdout] | [INFO] [stdout] 465 | / if std::path::Path::new(&tsconfig_path).exists() { [INFO] [stdout] 466 | | if let Ok(raw) = std::fs::read_to_string(&tsconfig_path) { [INFO] [stdout] 467 | | let parsed: Option = serde_json::from_str::(&raw).ok() [INFO] [stdout] 468 | | .or_else(|| json5::from_str::(&raw).ok()); [INFO] [stdout] ... | [INFO] [stdout] 493 | | } [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] 465 ~ if std::path::Path::new(&tsconfig_path).exists() [INFO] [stdout] 466 ~ && let Ok(raw) = std::fs::read_to_string(&tsconfig_path) { [INFO] [stdout] 467 | let parsed: Option = serde_json::from_str::(&raw).ok() [INFO] [stdout] ... [INFO] [stdout] 491 | } [INFO] [stdout] 492 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/config.rs:469:21 [INFO] [stdout] | [INFO] [stdout] 469 | / if let Some(json) = parsed { [INFO] [stdout] 470 | | if let Some(paths) = json [INFO] [stdout] 471 | | .get("compilerOptions") [INFO] [stdout] 472 | | .and_then(|c| c.get("paths")) [INFO] [stdout] ... | [INFO] [stdout] 491 | | } [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] 469 ~ if let Some(json) = parsed [INFO] [stdout] 470 ~ && let Some(paths) = json [INFO] [stdout] 471 | .get("compilerOptions") [INFO] [stdout] ... [INFO] [stdout] 489 | } [INFO] [stdout] 490 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/config.rs:588:25 [INFO] [stdout] | [INFO] [stdout] 588 | .unwrap_or_else(|| Vec::new()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `Vec::new` [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: stripping a prefix manually [INFO] [stdout] --> src/mapping/schema_introspect.rs:49:44 [INFO] [stdout] | [INFO] [stdout] 49 | let candidate = d.join(&source[2..]); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/mapping/schema_introspect.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 43 | if source.starts_with("@/") { [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] 43 ~ if let Some() = source.strip_prefix("@/") { [INFO] [stdout] 44 | // Find the nearest ancestor that IS the 'src' directory and resolve from there [INFO] [stdout] ... [INFO] [stdout] 48 | if name == "src" { [INFO] [stdout] 49 ~ let candidate = d.join(); [INFO] [stdout] 50 | if let Some(res) = try_with_extensions(&candidate) { [INFO] [stdout] ... [INFO] [stdout] 58 | if let Ok(root) = std::env::current_dir() { [INFO] [stdout] 59 ~ let p = root.join("src").join(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:47:13 [INFO] [stdout] | [INFO] [stdout] 47 | / if let Some(name) = d.file_name().and_then(|s| s.to_str()) { [INFO] [stdout] 48 | | if name == "src" { [INFO] [stdout] 49 | | let candidate = d.join(&source[2..]); [INFO] [stdout] 50 | | if let Some(res) = try_with_extensions(&candidate) { [INFO] [stdout] ... | [INFO] [stdout] 54 | | } [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] 47 ~ if let Some(name) = d.file_name().and_then(|s| s.to_str()) [INFO] [stdout] 48 ~ && name == "src" { [INFO] [stdout] 49 | let candidate = d.join(&source[2..]); [INFO] [stdout] ... [INFO] [stdout] 52 | } [INFO] [stdout] 53 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:66:5 [INFO] [stdout] | [INFO] [stdout] 66 | / if let Some(cfg) = TS_PATHS.get() { [INFO] [stdout] 67 | | if let Some(resolved) = resolve_via_ts_paths(cfg, source) { [INFO] [stdout] 68 | | return Some(resolved); [INFO] [stdout] 69 | | } [INFO] [stdout] 70 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 66 ~ if let Some(cfg) = TS_PATHS.get() [INFO] [stdout] 67 ~ && let Some(resolved) = resolve_via_ts_paths(cfg, source) { [INFO] [stdout] 68 | return Some(resolved); [INFO] [stdout] 69 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Iterator::find` [INFO] [stdout] --> src/mapping/schema_introspect.rs:86:5 [INFO] [stdout] | [INFO] [stdout] 86 | / for c in candidates { [INFO] [stdout] 87 | | if c.exists() { [INFO] [stdout] 88 | | return Some(c); [INFO] [stdout] ... | [INFO] [stdout] 91 | | None [INFO] [stdout] | |________^ help: replace with an iterator: `candidates.into_iter().find(|c| c.exists())` [INFO] [stdout] | [INFO] [stdout] = note: you may need to dereference some variables [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_find [INFO] [stdout] = note: `#[warn(clippy::manual_find)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/config.rs:750:9 [INFO] [stdout] | [INFO] [stdout] 750 | assert_eq!(config.interactive, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 750 - assert_eq!(config.interactive, true); [INFO] [stdout] 750 + assert!(config.interactive); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/config.rs:751:9 [INFO] [stdout] | [INFO] [stdout] 751 | assert_eq!(config.verbose, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 751 - assert_eq!(config.verbose, true); [INFO] [stdout] 751 + assert!(config.verbose); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/config.rs:752:9 [INFO] [stdout] | [INFO] [stdout] 752 | assert_eq!(config.dry_run, false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 752 - assert_eq!(config.dry_run, false); [INFO] [stdout] 752 + assert!(!config.dry_run); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/config.rs:753:9 [INFO] [stdout] | [INFO] [stdout] 753 | assert_eq!(config.debug, false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 753 - assert_eq!(config.debug, false); [INFO] [stdout] 753 + assert!(!config.debug); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/mapping/schema_introspect.rs:107:13 [INFO] [stdout] | [INFO] [stdout] 107 | / for el in &arr.elems { [INFO] [stdout] 108 | | if let Some(e) = el { [INFO] [stdout] 109 | | if let Some(v) = expr_to_json_ctx(&e.expr, current_file, import_map) { out.push(v); } [INFO] [stdout] 110 | | } [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/mapping/schema_introspect.rs:108:17 [INFO] [stdout] | [INFO] [stdout] 108 | / if let Some(e) = el { [INFO] [stdout] 109 | | if let Some(v) = expr_to_json_ctx(&e.expr, current_file, import_map) { out.push(v); } [INFO] [stdout] 110 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 107 ~ for e in arr.elems.iter().flatten() { [INFO] [stdout] 108 + if let Some(v) = expr_to_json_ctx(&e.expr, current_file, import_map) { out.push(v); } [INFO] [stdout] 109 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:108:17 [INFO] [stdout] | [INFO] [stdout] 108 | / if let Some(e) = el { [INFO] [stdout] 109 | | if let Some(v) = expr_to_json_ctx(&e.expr, current_file, import_map) { out.push(v); } [INFO] [stdout] 110 | | } [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] 108 ~ if let Some(e) = el [INFO] [stdout] 109 ~ && let Some(v) = expr_to_json_ctx(&e.expr, current_file, import_map) { out.push(v); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:117:17 [INFO] [stdout] | [INFO] [stdout] 117 | / ... if let PropOrSpread::Prop(p) = prop { [INFO] [stdout] 118 | | ... if let Prop::KeyValue(kv) = &**p { [INFO] [stdout] 119 | | ... let key = match &kv.key { PropName::Ident(i) => i.sym.to_string(), PropName::Str(s) => s.value.to_string(), _ => co... [INFO] [stdout] 120 | | ... if let Some(v) = expr_to_json_ctx(&kv.value, current_file, import_map) { map.insert(key, v); } [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 let PropOrSpread::Prop(p) = prop [INFO] [stdout] 118 ~ && let Prop::KeyValue(kv) = &**p { [INFO] [stdout] 119 | let key = match &kv.key { PropName::Ident(i) => i.sym.to_string(), PropName::Str(s) => s.value.to_string(), _ => continue }; [INFO] [stdout] 120 | if let Some(v) = expr_to_json_ctx(&kv.value, current_file, import_map) { map.insert(key, v); } [INFO] [stdout] 121 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/config.rs:754:9 [INFO] [stdout] | [INFO] [stdout] 754 | assert_eq!(config.fixtures, false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 754 - assert_eq!(config.fixtures, false); [INFO] [stdout] 754 + assert!(!config.fixtures); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:129:17 [INFO] [stdout] | [INFO] [stdout] 129 | / if let Some(path) = map.get(&name) { [INFO] [stdout] 130 | | if let Ok(m) = parse_module(path) { [INFO] [stdout] 131 | | if let Some(e) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] 132 | | let next_map = build_import_map(&m, path); [INFO] [stdout] ... | [INFO] [stdout] 136 | | } [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] 129 ~ if let Some(path) = map.get(&name) [INFO] [stdout] 130 ~ && let Ok(m) = parse_module(path) { [INFO] [stdout] 131 | if let Some(e) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] ... [INFO] [stdout] 134 | } [INFO] [stdout] 135 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:130:21 [INFO] [stdout] | [INFO] [stdout] 130 | / if let Ok(m) = parse_module(path) { [INFO] [stdout] 131 | | if let Some(e) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] 132 | | let next_map = build_import_map(&m, path); [INFO] [stdout] 133 | | return expr_to_json_ctx(&e, Some(path), Some(&next_map)); [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] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 130 ~ if let Ok(m) = parse_module(path) [INFO] [stdout] 131 ~ && let Some(e) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] 132 | let next_map = build_import_map(&m, path); [INFO] [stdout] 133 | return expr_to_json_ctx(&e, Some(path), Some(&next_map)); [INFO] [stdout] 134 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/config.rs:770:9 [INFO] [stdout] | [INFO] [stdout] 770 | base.source = "umbraco".to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `config::PorterConfig { source: "umbraco".to_string(), target: "payload".to_string(), interactive: true, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/config.rs:769:9 [INFO] [stdout] | [INFO] [stdout] 769 | let mut base = PorterConfig::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: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/config.rs:786:9 [INFO] [stdout] | [INFO] [stdout] 786 | assert_eq!(base.interactive, false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 786 - assert_eq!(base.interactive, false); [INFO] [stdout] 786 + assert!(!base.interactive); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:178:25 [INFO] [stdout] | [INFO] [stdout] 178 | / if let Pat::Ident(bi) = &d.name { [INFO] [stdout] 179 | | if bi.id.sym == *name { [INFO] [stdout] 180 | | if let Some(init) = &d.init { return Some((**init).clone()); } [INFO] [stdout] 181 | | } [INFO] [stdout] 182 | | } [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] 178 ~ if let Pat::Ident(bi) = &d.name [INFO] [stdout] 179 ~ && bi.id.sym == *name { [INFO] [stdout] 180 | if let Some(init) = &d.init { return Some((**init).clone()); } [INFO] [stdout] 181 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/config.rs:787:9 [INFO] [stdout] | [INFO] [stdout] 787 | assert_eq!(base.verbose, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 787 - assert_eq!(base.verbose, true); [INFO] [stdout] 787 + assert!(base.verbose); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:179:29 [INFO] [stdout] | [INFO] [stdout] 179 | / ... if bi.id.sym == *name { [INFO] [stdout] 180 | | ... if let Some(init) = &d.init { return Some((**init).clone()); } [INFO] [stdout] 181 | | ... } [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] 179 ~ if bi.id.sym == *name [INFO] [stdout] 180 ~ && let Some(init) = &d.init { return Some((**init).clone()); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:188:21 [INFO] [stdout] | [INFO] [stdout] 188 | / if let Pat::Ident(bi) = &d.name { [INFO] [stdout] 189 | | if bi.id.sym == *name { [INFO] [stdout] 190 | | if let Some(init) = &d.init { return Some((**init).clone()); } [INFO] [stdout] 191 | | } [INFO] [stdout] 192 | | } [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] 188 ~ if let Pat::Ident(bi) = &d.name [INFO] [stdout] 189 ~ && bi.id.sym == *name { [INFO] [stdout] 190 | if let Some(init) = &d.init { return Some((**init).clone()); } [INFO] [stdout] 191 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:189:25 [INFO] [stdout] | [INFO] [stdout] 189 | / if bi.id.sym == *name { [INFO] [stdout] 190 | | if let Some(init) = &d.init { return Some((**init).clone()); } [INFO] [stdout] 191 | | } [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] 189 ~ if bi.id.sym == *name [INFO] [stdout] 190 ~ && let Some(init) = &d.init { return Some((**init).clone()); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:212:9 [INFO] [stdout] | [INFO] [stdout] 212 | / if let ModuleItem::Stmt(Stmt::Decl(Decl::Fn(f))) = item { [INFO] [stdout] 213 | | if f.ident.sym == *name { [INFO] [stdout] 214 | | // naive: find first return statement with object literal [INFO] [stdout] 215 | | let mut obj: Option = None; [INFO] [stdout] ... | [INFO] [stdout] 230 | | } [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] 212 ~ if let ModuleItem::Stmt(Stmt::Decl(Decl::Fn(f))) = item [INFO] [stdout] 213 ~ && f.ident.sym == *name { [INFO] [stdout] 214 | // naive: find first return statement with object literal [INFO] [stdout] ... [INFO] [stdout] 228 | if obj.is_some() { return obj; } [INFO] [stdout] 229 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:219:29 [INFO] [stdout] | [INFO] [stdout] 219 | / ... if let Some(arg) = &ret.arg { [INFO] [stdout] 220 | | ... if matches!(&**arg, Expr::Object(_)) { *obj = Some((**arg).clone()); } [INFO] [stdout] 221 | | ... } [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] 219 ~ if let Some(arg) = &ret.arg [INFO] [stdout] 220 ~ && matches!(&**arg, Expr::Object(_)) { *obj = Some((**arg).clone()); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:240:13 [INFO] [stdout] | [INFO] [stdout] 240 | / if let Some(path) = import_map.get(&name) { [INFO] [stdout] 241 | | if let Ok(m) = parse_module(path) { [INFO] [stdout] 242 | | if let Some(e) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] 243 | | return resolve_expr(&e, path, &build_import_map(&m, path)); [INFO] [stdout] ... | [INFO] [stdout] 246 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 240 ~ if let Some(path) = import_map.get(&name) [INFO] [stdout] 241 ~ && let Ok(m) = parse_module(path) { [INFO] [stdout] 242 | if let Some(e) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] 243 | return resolve_expr(&e, path, &build_import_map(&m, path)); [INFO] [stdout] 244 | } [INFO] [stdout] 245 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:241:17 [INFO] [stdout] | [INFO] [stdout] 241 | / if let Ok(m) = parse_module(path) { [INFO] [stdout] 242 | | if let Some(e) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] 243 | | return resolve_expr(&e, path, &build_import_map(&m, path)); [INFO] [stdout] 244 | | } [INFO] [stdout] 245 | | } [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] 241 ~ if let Ok(m) = parse_module(path) [INFO] [stdout] 242 ~ && let Some(e) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] 243 | return resolve_expr(&e, path, &build_import_map(&m, path)); [INFO] [stdout] 244 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:251:13 [INFO] [stdout] | [INFO] [stdout] 251 | / if let Callee::Expr(callee_expr) = &call.callee { [INFO] [stdout] 252 | | if let Expr::Ident(id) = &**callee_expr { [INFO] [stdout] 253 | | let name = id.sym.to_string(); [INFO] [stdout] 254 | | if let Some(path) = import_map.get(&name) { [INFO] [stdout] ... | [INFO] [stdout] 271 | | } [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] 251 ~ if let Callee::Expr(callee_expr) = &call.callee [INFO] [stdout] 252 ~ && let Expr::Ident(id) = &**callee_expr { [INFO] [stdout] 253 | let name = id.sym.to_string(); [INFO] [stdout] ... [INFO] [stdout] 269 | } [INFO] [stdout] 270 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:254:21 [INFO] [stdout] | [INFO] [stdout] 254 | / if let Some(path) = import_map.get(&name) { [INFO] [stdout] 255 | | if let Ok(m) = parse_module(path) { [INFO] [stdout] 256 | | // 1) Try function declaration matching the name [INFO] [stdout] 257 | | if let Some(ret) = find_function_return_object(&m, &name) { [INFO] [stdout] ... | [INFO] [stdout] 269 | | } [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] 254 ~ if let Some(path) = import_map.get(&name) [INFO] [stdout] 255 ~ && let Ok(m) = parse_module(path) { [INFO] [stdout] 256 | // 1) Try function declaration matching the name [INFO] [stdout] ... [INFO] [stdout] 267 | } [INFO] [stdout] 268 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:262:29 [INFO] [stdout] | [INFO] [stdout] 262 | / ... if let Some(init_expr) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] 263 | | ... if let Some(ret_expr) = extract_return_from_function_expr(&init_expr) { [INFO] [stdout] 264 | | ... let resolved = resolve_expr(&ret_expr, path, &build_import_map(&m, path)); [INFO] [stdout] 265 | | ... return resolved; [INFO] [stdout] 266 | | ... } [INFO] [stdout] 267 | | ... } [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] 262 ~ if let Some(init_expr) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) [INFO] [stdout] 263 ~ && let Some(ret_expr) = extract_return_from_function_expr(&init_expr) { [INFO] [stdout] 264 | let resolved = resolve_expr(&ret_expr, path, &build_import_map(&m, path)); [INFO] [stdout] 265 | return resolved; [INFO] [stdout] 266 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:273:13 [INFO] [stdout] | [INFO] [stdout] 273 | / if let Some(arg0) = call.args.get(0) { [INFO] [stdout] 274 | | if let Some(v) = expr_to_json_ctx(&arg0.expr, Some(current_file), Some(import_map)) { return Some(v); } [INFO] [stdout] 275 | | } [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] 273 ~ if let Some(arg0) = call.args.get(0) [INFO] [stdout] 274 ~ && let Some(v) = expr_to_json_ctx(&arg0.expr, Some(current_file), Some(import_map)) { return Some(v); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `call.args.get(0)` [INFO] [stdout] --> src/mapping/schema_introspect.rs:273:33 [INFO] [stdout] | [INFO] [stdout] 273 | if let Some(arg0) = call.args.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `call.args.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:288:9 [INFO] [stdout] | [INFO] [stdout] 288 | / if let ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(ed)) = item { [INFO] [stdout] 289 | | if let Decl::Var(var) = &ed.decl { [INFO] [stdout] 290 | | for d in &var.decls { [INFO] [stdout] 291 | | if let Some(init) = &d.init { [INFO] [stdout] ... | [INFO] [stdout] 320 | | } [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] 288 ~ if let ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(ed)) = item [INFO] [stdout] 289 ~ && let Decl::Var(var) = &ed.decl { [INFO] [stdout] 290 | for d in &var.decls { [INFO] [stdout] ... [INFO] [stdout] 318 | } [INFO] [stdout] 319 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:291:21 [INFO] [stdout] | [INFO] [stdout] 291 | / if let Some(init) = &d.init { [INFO] [stdout] 292 | | if let Expr::Object(obj) = &**init { [INFO] [stdout] 293 | | for prop in &obj.props { [INFO] [stdout] 294 | | if let PropOrSpread::Prop(p) = prop { [INFO] [stdout] ... | [INFO] [stdout] 317 | | } [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] 291 ~ if let Some(init) = &d.init [INFO] [stdout] 292 ~ && let Expr::Object(obj) = &**init { [INFO] [stdout] 293 | for prop in &obj.props { [INFO] [stdout] ... [INFO] [stdout] 315 | } [INFO] [stdout] 316 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:294:33 [INFO] [stdout] | [INFO] [stdout] 294 | / ... if let PropOrSpread::Prop(p) = prop { [INFO] [stdout] 295 | | ... if let Prop::KeyValue(kv) = &**p { [INFO] [stdout] 296 | | ... if let PropName::Ident(id) = &kv.key { [INFO] [stdout] 297 | | ... if id.sym == *"fields" { [INFO] [stdout] ... | [INFO] [stdout] 314 | | ... } [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] 294 ~ if let PropOrSpread::Prop(p) = prop [INFO] [stdout] 295 ~ && let Prop::KeyValue(kv) = &**p { [INFO] [stdout] 296 | if let PropName::Ident(id) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 312 | } [INFO] [stdout] 313 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:295:37 [INFO] [stdout] | [INFO] [stdout] 295 | / ... if let Prop::KeyValue(kv) = &**p { [INFO] [stdout] 296 | | ... if let PropName::Ident(id) = &kv.key { [INFO] [stdout] 297 | | ... if id.sym == *"fields" { [INFO] [stdout] 298 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 313 | | ... } [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] 295 ~ if let Prop::KeyValue(kv) = &**p [INFO] [stdout] 296 ~ && let PropName::Ident(id) = &kv.key { [INFO] [stdout] 297 | if id.sym == *"fields" { [INFO] [stdout] ... [INFO] [stdout] 311 | } [INFO] [stdout] 312 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:296:41 [INFO] [stdout] | [INFO] [stdout] 296 | / ... if let PropName::Ident(id) = &kv.key { [INFO] [stdout] 297 | | ... if id.sym == *"fields" { [INFO] [stdout] 298 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 299 | | ... let mut out = Vec::new(); [INFO] [stdout] ... | [INFO] [stdout] 312 | | ... } [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] 296 ~ if let PropName::Ident(id) = &kv.key [INFO] [stdout] 297 ~ && id.sym == *"fields" { [INFO] [stdout] 298 | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... [INFO] [stdout] 310 | } [INFO] [stdout] 311 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:297:45 [INFO] [stdout] | [INFO] [stdout] 297 | / ... if id.sym == *"fields" { [INFO] [stdout] 298 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 299 | | ... let mut out = Vec::new(); [INFO] [stdout] 300 | | ... for el in &arr.elems { [INFO] [stdout] ... | [INFO] [stdout] 311 | | ... } [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] 297 ~ if id.sym == *"fields" [INFO] [stdout] 298 ~ && let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 299 | let mut out = Vec::new(); [INFO] [stdout] ... [INFO] [stdout] 309 | return Ok(out); [INFO] [stdout] 310 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/mapping/schema_introspect.rs:300:53 [INFO] [stdout] | [INFO] [stdout] 300 | / ... for el in &arr.elems { [INFO] [stdout] 301 | | ... if let Some(e) = el { [INFO] [stdout] 302 | | ... // Resolve identifiers/calls; otherwise attempt JSON fallback [INFO] [stdout] 303 | | ... if let Some(v) = resolve_expr(&e.expr, schema_path, &import_map) [INFO] [stdout] ... | [INFO] [stdout] 308 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/mapping/schema_introspect.rs:301:57 [INFO] [stdout] | [INFO] [stdout] 301 | / ... if let Some(e) = el { [INFO] [stdout] 302 | | ... // Resolve identifiers/calls; otherwise attempt JSON fallback [INFO] [stdout] 303 | | ... if let Some(v) = resolve_expr(&e.expr, schema_path, &import_map) [INFO] [stdout] 304 | | ... .or_else(|| expr_to_json_ctx(&e.expr, Some(schema_path), Some(&import_map))) { [INFO] [stdout] ... | [INFO] [stdout] 307 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 300 ~ for e in arr.elems.iter().flatten() { [INFO] [stdout] 301 + // Resolve identifiers/calls; otherwise attempt JSON fallback [INFO] [stdout] 302 + if let Some(v) = resolve_expr(&e.expr, schema_path, &import_map) [INFO] [stdout] 303 + .or_else(|| expr_to_json_ctx(&e.expr, Some(schema_path), Some(&import_map))) { [INFO] [stdout] 304 + out.push(v); [INFO] [stdout] 305 + } [INFO] [stdout] 306 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:326:9 [INFO] [stdout] | [INFO] [stdout] 326 | / if let ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(ed)) = item { [INFO] [stdout] 327 | | if let Decl::Var(var) = &ed.decl { [INFO] [stdout] 328 | | for d in &var.decls { [INFO] [stdout] 329 | | if let Some(init) = &d.init { [INFO] [stdout] ... | [INFO] [stdout] 361 | | } [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] 326 ~ if let ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(ed)) = item [INFO] [stdout] 327 ~ && let Decl::Var(var) = &ed.decl { [INFO] [stdout] 328 | for d in &var.decls { [INFO] [stdout] ... [INFO] [stdout] 359 | } [INFO] [stdout] 360 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:329:21 [INFO] [stdout] | [INFO] [stdout] 329 | / if let Some(init) = &d.init { [INFO] [stdout] 330 | | if let Expr::Object(obj) = &**init { [INFO] [stdout] 331 | | // find 'fields: []' and resolve each [INFO] [stdout] 332 | | for prop in &obj.props { [INFO] [stdout] ... | [INFO] [stdout] 358 | | } [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] 329 ~ if let Some(init) = &d.init [INFO] [stdout] 330 ~ && let Expr::Object(obj) = &**init { [INFO] [stdout] 331 | // find 'fields: []' and resolve each [INFO] [stdout] ... [INFO] [stdout] 356 | } [INFO] [stdout] 357 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:333:33 [INFO] [stdout] | [INFO] [stdout] 333 | / ... if let PropOrSpread::Prop(p) = prop { [INFO] [stdout] 334 | | ... if let Prop::KeyValue(kv) = &**p { [INFO] [stdout] 335 | | ... if let PropName::Ident(id) = &kv.key { [INFO] [stdout] 336 | | ... if id.sym == *"fields" { [INFO] [stdout] ... | [INFO] [stdout] 355 | | ... } [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] 333 ~ if let PropOrSpread::Prop(p) = prop [INFO] [stdout] 334 ~ && let Prop::KeyValue(kv) = &**p { [INFO] [stdout] 335 | if let PropName::Ident(id) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 353 | } [INFO] [stdout] 354 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:334:37 [INFO] [stdout] | [INFO] [stdout] 334 | / ... if let Prop::KeyValue(kv) = &**p { [INFO] [stdout] 335 | | ... if let PropName::Ident(id) = &kv.key { [INFO] [stdout] 336 | | ... if id.sym == *"fields" { [INFO] [stdout] 337 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 354 | | ... } [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] 334 ~ if let Prop::KeyValue(kv) = &**p [INFO] [stdout] 335 ~ && let PropName::Ident(id) = &kv.key { [INFO] [stdout] 336 | if id.sym == *"fields" { [INFO] [stdout] ... [INFO] [stdout] 352 | } [INFO] [stdout] 353 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:335:41 [INFO] [stdout] | [INFO] [stdout] 335 | / ... if let PropName::Ident(id) = &kv.key { [INFO] [stdout] 336 | | ... if id.sym == *"fields" { [INFO] [stdout] 337 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 338 | | ... let mut out = Vec::new(); [INFO] [stdout] ... | [INFO] [stdout] 353 | | ... } [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] 335 ~ if let PropName::Ident(id) = &kv.key [INFO] [stdout] 336 ~ && id.sym == *"fields" { [INFO] [stdout] 337 | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... [INFO] [stdout] 351 | } [INFO] [stdout] 352 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:336:45 [INFO] [stdout] | [INFO] [stdout] 336 | / ... if id.sym == *"fields" { [INFO] [stdout] 337 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 338 | | ... let mut out = Vec::new(); [INFO] [stdout] 339 | | ... for el in &arr.elems { [INFO] [stdout] ... | [INFO] [stdout] 352 | | ... } [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] 336 ~ if id.sym == *"fields" [INFO] [stdout] 337 ~ && let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 338 | let mut out = Vec::new(); [INFO] [stdout] ... [INFO] [stdout] 350 | if !out.is_empty() { return Ok(out); } [INFO] [stdout] 351 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/mapping/schema_introspect.rs:339:53 [INFO] [stdout] | [INFO] [stdout] 339 | / ... for el in &arr.elems { [INFO] [stdout] 340 | | ... if let Some(e) = el { [INFO] [stdout] 341 | | ... if let Some(v) = resolve_expr(&e.expr, schema_path, &import_map) { [INFO] [stdout] 342 | | ... match v { [INFO] [stdout] ... | [INFO] [stdout] 349 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/mapping/schema_introspect.rs:340:57 [INFO] [stdout] | [INFO] [stdout] 340 | / ... if let Some(e) = el { [INFO] [stdout] 341 | | ... if let Some(v) = resolve_expr(&e.expr, schema_path, &import_map) { [INFO] [stdout] 342 | | ... match v { [INFO] [stdout] 343 | | ... Value::Array(items) => out.extend(items), [INFO] [stdout] ... | [INFO] [stdout] 348 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 339 ~ for e in arr.elems.iter().flatten() { [INFO] [stdout] 340 + if let Some(v) = resolve_expr(&e.expr, schema_path, &import_map) { [INFO] [stdout] 341 + match v { [INFO] [stdout] 342 + Value::Array(items) => out.extend(items), [INFO] [stdout] 343 + Value::Object(_) => out.push(v), [INFO] [stdout] 344 + _ => {} [INFO] [stdout] 345 + } [INFO] [stdout] 346 + } [INFO] [stdout] 347 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:340:57 [INFO] [stdout] | [INFO] [stdout] 340 | / ... if let Some(e) = el { [INFO] [stdout] 341 | | ... if let Some(v) = resolve_expr(&e.expr, schema_path, &import_map) { [INFO] [stdout] 342 | | ... match v { [INFO] [stdout] 343 | | ... Value::Array(items) => out.extend(items), [INFO] [stdout] ... | [INFO] [stdout] 348 | | ... } [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] 340 ~ if let Some(e) = el [INFO] [stdout] 341 ~ && let Some(v) = resolve_expr(&e.expr, schema_path, &import_map) { [INFO] [stdout] 342 | match v { [INFO] [stdout] ... [INFO] [stdout] 346 | } [INFO] [stdout] 347 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:372:21 [INFO] [stdout] | [INFO] [stdout] 372 | / if let Stmt::Return(ret) = st { [INFO] [stdout] 373 | | if let Some(arg) = &ret.arg { return Some((**arg).clone()); } [INFO] [stdout] 374 | | } [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] 372 ~ if let Stmt::Return(ret) = st [INFO] [stdout] 373 ~ && let Some(arg) = &ret.arg { return Some((**arg).clone()); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:384:25 [INFO] [stdout] | [INFO] [stdout] 384 | / if let Stmt::Return(ret) = st { [INFO] [stdout] 385 | | if let Some(arg) = &ret.arg { return Some((**arg).clone()); } [INFO] [stdout] 386 | | } [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] 384 ~ if let Stmt::Return(ret) = st [INFO] [stdout] 385 ~ && let Some(arg) = &ret.arg { return Some((**arg).clone()); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/generator.rs:93:13 [INFO] [stdout] | [INFO] [stdout] 93 | / if let Some(schema_path) = &collection.collection_path { [INFO] [stdout] 94 | | if Path::new(schema_path).exists() { [INFO] [stdout] 95 | | let graph_path = format!("{}/{}.json", graphs_dir_path, collection.name); [INFO] [stdout] 96 | | let tpl_path = format!("{}/{}.template.json", templates_dir_path, collection.name); [INFO] [stdout] ... | [INFO] [stdout] 129 | | } [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] 93 ~ if let Some(schema_path) = &collection.collection_path [INFO] [stdout] 94 ~ && Path::new(schema_path).exists() { [INFO] [stdout] 95 | let graph_path = format!("{}/{}.json", graphs_dir_path, collection.name); [INFO] [stdout] ... [INFO] [stdout] 127 | } [INFO] [stdout] 128 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/generator.rs:106:25 [INFO] [stdout] | [INFO] [stdout] 106 | / if let Some(ts) = &self.config.typescript { [INFO] [stdout] 107 | | if !ts.tsconfig_path.is_empty() { [INFO] [stdout] 108 | | let _ = crate::mapping::schema_introspect::configure_ts_paths_from_file(&ts.tsconfig_path); [INFO] [stdout] 109 | | } [INFO] [stdout] 110 | | } [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] 106 ~ if let Some(ts) = &self.config.typescript [INFO] [stdout] 107 ~ && !ts.tsconfig_path.is_empty() { [INFO] [stdout] 108 | let _ = crate::mapping::schema_introspect::configure_ts_paths_from_file(&ts.tsconfig_path); [INFO] [stdout] 109 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant redefinition of a binding `base_dir` [INFO] [stdout] --> src/mapping/schema_introspect.rs:459:5 [INFO] [stdout] | [INFO] [stdout] 459 | let base_dir = base_dir; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: `base_dir` is initially defined here [INFO] [stdout] --> src/mapping/schema_introspect.rs:458:9 [INFO] [stdout] | [INFO] [stdout] 458 | let base_dir = tsconfig_path.parent().unwrap_or(Path::new(".")).join(base_url); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals [INFO] [stdout] = note: `#[warn(clippy::redundant_locals)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/mapping/generator.rs:135:49 [INFO] [stdout] | [INFO] [stdout] 135 | println!("{} {}", "📁 Check the".cyan(), format!("{}", mappings_base).cyan()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `mappings_base.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] = note: `#[warn(clippy::useless_format)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:481:5 [INFO] [stdout] | [INFO] [stdout] 481 | / if let Some(ts) = &cfg.typescript { [INFO] [stdout] 482 | | if let Some(pm) = &ts.path_mappings { [INFO] [stdout] 483 | | let base = std::path::Path::new(&ts.tsconfig_path).parent().unwrap_or(std::path::Path::new(".")).to_path_buf(); [INFO] [stdout] 484 | | let mappings: Vec<(String, Vec)> = pm.iter().map(|m| (m.alias.clone(), m.paths.clone())).collect(); [INFO] [stdout] ... | [INFO] [stdout] 487 | | } [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] 481 ~ if let Some(ts) = &cfg.typescript [INFO] [stdout] 482 ~ && let Some(pm) = &ts.path_mappings { [INFO] [stdout] 483 | let base = std::path::Path::new(&ts.tsconfig_path).parent().unwrap_or(std::path::Path::new(".")).to_path_buf(); [INFO] [stdout] 484 | let mappings: Vec<(String, Vec)> = pm.iter().map(|m| (m.alias.clone(), m.paths.clone())).collect(); [INFO] [stdout] 485 | let _ = TS_PATHS.set(TsPathsConfig { base_dir: base, mappings }); [INFO] [stdout] 486 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `BlockMappings` [INFO] [stdout] --> src/mapping/json_mapping.rs:44:5 [INFO] [stdout] | [INFO] [stdout] 44 | / pub fn new() -> Self { [INFO] [stdout] 45 | | Self { [INFO] [stdout] 46 | | layout_to_block_type: HashMap::new(), [INFO] [stdout] 47 | | block_field_mappings: HashMap::new(), [INFO] [stdout] 48 | | } [INFO] [stdout] 49 | | } [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] 43 + impl Default for BlockMappings { [INFO] [stdout] 44 + fn default() -> Self { [INFO] [stdout] 45 + Self::new() [INFO] [stdout] 46 + } [INFO] [stdout] 47 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/generator.rs:558:21 [INFO] [stdout] | [INFO] [stdout] 558 | / if let Some(ts) = &self.config.typescript { [INFO] [stdout] 559 | | if !ts.tsconfig_path.is_empty() { [INFO] [stdout] 560 | | let _ = crate::mapping::schema_introspect::configure_ts_paths_from_file(&ts.tsconfig_path); [INFO] [stdout] 561 | | } [INFO] [stdout] 562 | | } [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] 558 ~ if let Some(ts) = &self.config.typescript [INFO] [stdout] 559 ~ && !ts.tsconfig_path.is_empty() { [INFO] [stdout] 560 | let _ = crate::mapping::schema_introspect::configure_ts_paths_from_file(&ts.tsconfig_path); [INFO] [stdout] 561 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/nested.rs:130:21 [INFO] [stdout] | [INFO] [stdout] 130 | / if let Some(array) = value.as_array() { [INFO] [stdout] 131 | | if *index < array.len() { [INFO] [stdout] 132 | | new_results.push(array[*index].clone()); [INFO] [stdout] 133 | | } [INFO] [stdout] 134 | | } [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] 130 ~ if let Some(array) = value.as_array() [INFO] [stdout] 131 ~ && *index < array.len() { [INFO] [stdout] 132 | new_results.push(array[*index].clone()); [INFO] [stdout] 133 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/mapping/generator.rs:600:26 [INFO] [stdout] | [INFO] [stdout] 600 | let porter_dir = self.config.metadata.as_ref() [INFO] [stdout] | __________________________^ [INFO] [stdout] 601 | | .and_then(|m| m.get("porter_format_dir")).map(|s| s.clone()) [INFO] [stdout] | |________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] help: consider calling the dedicated `cloned` method [INFO] [stdout] | [INFO] [stdout] 600 ~ let porter_dir = self.config.metadata.as_ref() [INFO] [stdout] 601 + .and_then(|m| m.get("porter_format_dir")).cloned() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/mapping/nested.rs:233:24 [INFO] [stdout] | [INFO] [stdout] 233 | if !current.get(field_name).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `current.get(field_name).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/nested.rs:307:13 [INFO] [stdout] | [INFO] [stdout] 307 | / if let Value::Object(nested_obj) = nested_result { [INFO] [stdout] 308 | | if let Value::Object(main_obj) = &mut result { [INFO] [stdout] 309 | | main_obj.extend(nested_obj); [INFO] [stdout] 310 | | } [INFO] [stdout] 311 | | } [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] 307 ~ if let Value::Object(nested_obj) = nested_result [INFO] [stdout] 308 ~ && let Value::Object(main_obj) = &mut result { [INFO] [stdout] 309 | main_obj.extend(nested_obj); [INFO] [stdout] 310 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/nested.rs:317:17 [INFO] [stdout] | [INFO] [stdout] 317 | / if let Some(fallback) = &field_mapping.fallback { [INFO] [stdout] 318 | | if let Value::Object(main_obj) = &mut result { [INFO] [stdout] 319 | | main_obj.insert(field_mapping.to.clone(), Value::String(fallback.clone())); [INFO] [stdout] 320 | | } [INFO] [stdout] 321 | | } [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] 317 ~ if let Some(fallback) = &field_mapping.fallback [INFO] [stdout] 318 ~ && let Value::Object(main_obj) = &mut result { [INFO] [stdout] 319 | main_obj.insert(field_mapping.to.clone(), Value::String(fallback.clone())); [INFO] [stdout] 320 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/nested.rs:346:17 [INFO] [stdout] | [INFO] [stdout] 346 | / if let Value::String(path_str) = path { [INFO] [stdout] 347 | | if path_str.contains('.') || path_str.contains('[') { [INFO] [stdout] 348 | | return Ok(Some(NestedPath::from_dot_notation(path_str)?)); [INFO] [stdout] 349 | | } [INFO] [stdout] 350 | | } [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] 346 ~ if let Value::String(path_str) = path [INFO] [stdout] 347 ~ && (path_str.contains('.') || path_str.contains('[')) { [INFO] [stdout] 348 | return Ok(Some(NestedPath::from_dot_notation(path_str)?)); [INFO] [stdout] 349 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/mapping/transforms.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | if let Some(idx) = part.parse::().ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(idx)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 8 - if let Some(idx) = part.parse::().ok() { [INFO] [stdout] 8 + if let Ok(idx) = part.parse::() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:141:21 [INFO] [stdout] | [INFO] [stdout] 141 | / if let PropOrSpread::Prop(prop_box) = prop { [INFO] [stdout] 142 | | if let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 143 | | if let PropName::Ident(ident) = &key_value.key { [INFO] [stdout] 144 | | let key_name = ident.sym.to_string(); [INFO] [stdout] ... | [INFO] [stdout] 174 | | } [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] 141 ~ if let PropOrSpread::Prop(prop_box) = prop [INFO] [stdout] 142 ~ && let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 143 | if let PropName::Ident(ident) = &key_value.key { [INFO] [stdout] ... [INFO] [stdout] 172 | } [INFO] [stdout] 173 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:142:25 [INFO] [stdout] | [INFO] [stdout] 142 | / if let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 143 | | if let PropName::Ident(ident) = &key_value.key { [INFO] [stdout] 144 | | let key_name = ident.sym.to_string(); [INFO] [stdout] 145 | | debug!("Found property: {}", key_name); [INFO] [stdout] ... | [INFO] [stdout] 173 | | } [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] 142 ~ if let Prop::KeyValue(key_value) = &**prop_box [INFO] [stdout] 143 ~ && let PropName::Ident(ident) = &key_value.key { [INFO] [stdout] 144 | let key_name = ident.sym.to_string(); [INFO] [stdout] ... [INFO] [stdout] 171 | } [INFO] [stdout] 172 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:194:9 [INFO] [stdout] | [INFO] [stdout] 194 | / if let PropOrSpread::Prop(prop_box) = prop { [INFO] [stdout] 195 | | if let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 196 | | // Extract property key [INFO] [stdout] 197 | | let key = match &key_value.key { [INFO] [stdout] ... | [INFO] [stdout] 253 | | } [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] 194 ~ if let PropOrSpread::Prop(prop_box) = prop [INFO] [stdout] 195 ~ && let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 196 | // Extract property key [INFO] [stdout] ... [INFO] [stdout] 251 | } [INFO] [stdout] 252 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:227:32 [INFO] [stdout] | [INFO] [stdout] 227 | } else if let Some(relations) = extract_string_array(&key_value.value) { [INFO] [stdout] | ________________________________^ [INFO] [stdout] 228 | | if !relations.is_empty() { [INFO] [stdout] 229 | | relationship = Some(RelationshipInfo { [INFO] [stdout] 230 | | collection: relations[0].clone(), [INFO] [stdout] ... | [INFO] [stdout] 234 | | } [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] 227 ~ } else if let Some(relations) = extract_string_array(&key_value.value) [INFO] [stdout] 228 ~ && !relations.is_empty() { [INFO] [stdout] 229 | relationship = Some(RelationshipInfo { [INFO] [stdout] ... [INFO] [stdout] 232 | }); [INFO] [stdout] 233 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:237:25 [INFO] [stdout] | [INFO] [stdout] 237 | / if let Some(has_many) = extract_boolean_value(&key_value.value) { [INFO] [stdout] 238 | | if has_many && relationship.is_some() { [INFO] [stdout] 239 | | let mut rel = relationship.unwrap(); [INFO] [stdout] 240 | | rel.relationship_type = "hasMany".to_string(); [INFO] [stdout] ... | [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_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 237 ~ if let Some(has_many) = extract_boolean_value(&key_value.value) [INFO] [stdout] 238 ~ && has_many && relationship.is_some() { [INFO] [stdout] 239 | let mut rel = relationship.unwrap(); [INFO] [stdout] 240 | rel.relationship_type = "hasMany".to_string(); [INFO] [stdout] 241 | relationship = Some(rel); [INFO] [stdout] 242 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/mapping/typescript.rs:292:13 [INFO] [stdout] | [INFO] [stdout] 292 | / for elem in &array_lit.elems { [INFO] [stdout] 293 | | if let Some(expr) = elem { [INFO] [stdout] 294 | | if let Expr::Lit(Lit::Str(str_lit)) = &*expr.expr { [INFO] [stdout] 295 | | strings.push(str_lit.value.to_string()); [INFO] [stdout] ... | [INFO] [stdout] 298 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/mapping/typescript.rs:293:17 [INFO] [stdout] | [INFO] [stdout] 293 | / if let Some(expr) = elem { [INFO] [stdout] 294 | | if let Expr::Lit(Lit::Str(str_lit)) = &*expr.expr { [INFO] [stdout] 295 | | strings.push(str_lit.value.to_string()); [INFO] [stdout] 296 | | } [INFO] [stdout] 297 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 292 ~ for expr in array_lit.elems.iter().flatten() { [INFO] [stdout] 293 + if let Expr::Lit(Lit::Str(str_lit)) = &*expr.expr { [INFO] [stdout] 294 + strings.push(str_lit.value.to_string()); [INFO] [stdout] 295 + } [INFO] [stdout] 296 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:293:17 [INFO] [stdout] | [INFO] [stdout] 293 | / if let Some(expr) = elem { [INFO] [stdout] 294 | | if let Expr::Lit(Lit::Str(str_lit)) = &*expr.expr { [INFO] [stdout] 295 | | strings.push(str_lit.value.to_string()); [INFO] [stdout] 296 | | } [INFO] [stdout] 297 | | } [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] 293 ~ if let Some(expr) = elem [INFO] [stdout] 294 ~ && let Expr::Lit(Lit::Str(str_lit)) = &*expr.expr { [INFO] [stdout] 295 | strings.push(str_lit.value.to_string()); [INFO] [stdout] 296 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:312:17 [INFO] [stdout] | [INFO] [stdout] 312 | / if let PropOrSpread::Prop(prop_box) = prop { [INFO] [stdout] 313 | | if let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 314 | | let key = match &key_value.key { [INFO] [stdout] 315 | | PropName::Ident(ident) => ident.sym.to_string(), [INFO] [stdout] ... | [INFO] [stdout] 324 | | } [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] 312 ~ if let PropOrSpread::Prop(prop_box) = prop [INFO] [stdout] 313 ~ && let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 314 | let key = match &key_value.key { [INFO] [stdout] ... [INFO] [stdout] 322 | } [INFO] [stdout] 323 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/mapping/typescript.rs:345:13 [INFO] [stdout] | [INFO] [stdout] 345 | / for elem in &array_lit.elems { [INFO] [stdout] 346 | | if let Some(expr) = elem { [INFO] [stdout] 347 | | if let Some(value) = extract_json_value(&expr.expr) { [INFO] [stdout] 348 | | values.push(value); [INFO] [stdout] ... | [INFO] [stdout] 351 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/mapping/typescript.rs:346:17 [INFO] [stdout] | [INFO] [stdout] 346 | / if let Some(expr) = elem { [INFO] [stdout] 347 | | if let Some(value) = extract_json_value(&expr.expr) { [INFO] [stdout] 348 | | values.push(value); [INFO] [stdout] 349 | | } [INFO] [stdout] 350 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 345 ~ for expr in array_lit.elems.iter().flatten() { [INFO] [stdout] 346 + if let Some(value) = extract_json_value(&expr.expr) { [INFO] [stdout] 347 + values.push(value); [INFO] [stdout] 348 + } [INFO] [stdout] 349 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:346:17 [INFO] [stdout] | [INFO] [stdout] 346 | / if let Some(expr) = elem { [INFO] [stdout] 347 | | if let Some(value) = extract_json_value(&expr.expr) { [INFO] [stdout] 348 | | values.push(value); [INFO] [stdout] 349 | | } [INFO] [stdout] 350 | | } [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] 346 ~ if let Some(expr) = elem [INFO] [stdout] 347 ~ && let Some(value) = extract_json_value(&expr.expr) { [INFO] [stdout] 348 | values.push(value); [INFO] [stdout] 349 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:357:17 [INFO] [stdout] | [INFO] [stdout] 357 | / if let PropOrSpread::Prop(prop_box) = prop { [INFO] [stdout] 358 | | if let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 359 | | let key = match &key_value.key { [INFO] [stdout] 360 | | PropName::Ident(ident) => ident.sym.to_string(), [INFO] [stdout] ... | [INFO] [stdout] 369 | | } [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] 357 ~ if let PropOrSpread::Prop(prop_box) = prop [INFO] [stdout] 358 ~ && let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 359 | let key = match &key_value.key { [INFO] [stdout] ... [INFO] [stdout] 367 | } [INFO] [stdout] 368 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/graph.rs:196:13 [INFO] [stdout] | [INFO] [stdout] 196 | / if let Ok(content) = std::fs::read_to_string(&config_path) { [INFO] [stdout] 197 | | if let Ok(config) = toml::from_str::(&content) { [INFO] [stdout] 198 | | return config.typescript; [INFO] [stdout] 199 | | } [INFO] [stdout] 200 | | } [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] 196 ~ if let Ok(content) = std::fs::read_to_string(&config_path) [INFO] [stdout] 197 ~ && let Ok(config) = toml::from_str::(&content) { [INFO] [stdout] 198 | return config.typescript; [INFO] [stdout] 199 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's keys [INFO] [stdout] --> src/mapping/validation.rs:316:40 [INFO] [stdout] | [INFO] [stdout] 316 | for (source_field, _field_info) in &source_schema.fields { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 316 - for (source_field, _field_info) in &source_schema.fields { [INFO] [stdout] 316 + for source_field in source_schema.fields.keys() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `collection_path` after checking its variant with `is_some` [INFO] [stdout] --> src/mapping/mod.rs:85:32 [INFO] [stdout] | [INFO] [stdout] 84 | let target_fields = if target == "payload" && collection_path.is_some() { [INFO] [stdout] | ------------------------- the check is happening here [INFO] [stdout] 85 | extract_payload_fields(collection_path.unwrap())? [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [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: stripping a prefix manually [INFO] [stdout] --> src/mapping/schema_introspect.rs:49:44 [INFO] [stdout] | [INFO] [stdout] 49 | let candidate = d.join(&source[2..]); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/mapping/schema_introspect.rs:43:5 [INFO] [stdout] | [INFO] [stdout] 43 | if source.starts_with("@/") { [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] 43 ~ if let Some() = source.strip_prefix("@/") { [INFO] [stdout] 44 | // Find the nearest ancestor that IS the 'src' directory and resolve from there [INFO] [stdout] ... [INFO] [stdout] 48 | if name == "src" { [INFO] [stdout] 49 ~ let candidate = d.join(); [INFO] [stdout] 50 | if let Some(res) = try_with_extensions(&candidate) { [INFO] [stdout] ... [INFO] [stdout] 58 | if let Ok(root) = std::env::current_dir() { [INFO] [stdout] 59 ~ let p = root.join("src").join(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:47:13 [INFO] [stdout] | [INFO] [stdout] 47 | / if let Some(name) = d.file_name().and_then(|s| s.to_str()) { [INFO] [stdout] 48 | | if name == "src" { [INFO] [stdout] 49 | | let candidate = d.join(&source[2..]); [INFO] [stdout] 50 | | if let Some(res) = try_with_extensions(&candidate) { [INFO] [stdout] ... | [INFO] [stdout] 54 | | } [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] 47 ~ if let Some(name) = d.file_name().and_then(|s| s.to_str()) [INFO] [stdout] 48 ~ && name == "src" { [INFO] [stdout] 49 | let candidate = d.join(&source[2..]); [INFO] [stdout] ... [INFO] [stdout] 52 | } [INFO] [stdout] 53 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:66:5 [INFO] [stdout] | [INFO] [stdout] 66 | / if let Some(cfg) = TS_PATHS.get() { [INFO] [stdout] 67 | | if let Some(resolved) = resolve_via_ts_paths(cfg, source) { [INFO] [stdout] 68 | | return Some(resolved); [INFO] [stdout] 69 | | } [INFO] [stdout] 70 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 66 ~ if let Some(cfg) = TS_PATHS.get() [INFO] [stdout] 67 ~ && let Some(resolved) = resolve_via_ts_paths(cfg, source) { [INFO] [stdout] 68 | return Some(resolved); [INFO] [stdout] 69 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Iterator::find` [INFO] [stdout] --> src/mapping/schema_introspect.rs:86:5 [INFO] [stdout] | [INFO] [stdout] 86 | / for c in candidates { [INFO] [stdout] 87 | | if c.exists() { [INFO] [stdout] 88 | | return Some(c); [INFO] [stdout] ... | [INFO] [stdout] 91 | | None [INFO] [stdout] | |________^ help: replace with an iterator: `candidates.into_iter().find(|c| c.exists())` [INFO] [stdout] | [INFO] [stdout] = note: you may need to dereference some variables [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_find [INFO] [stdout] = note: `#[warn(clippy::manual_find)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/mapping/schema_introspect.rs:107:13 [INFO] [stdout] | [INFO] [stdout] 107 | / for el in &arr.elems { [INFO] [stdout] 108 | | if let Some(e) = el { [INFO] [stdout] 109 | | if let Some(v) = expr_to_json_ctx(&e.expr, current_file, import_map) { out.push(v); } [INFO] [stdout] 110 | | } [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/mapping/schema_introspect.rs:108:17 [INFO] [stdout] | [INFO] [stdout] 108 | / if let Some(e) = el { [INFO] [stdout] 109 | | if let Some(v) = expr_to_json_ctx(&e.expr, current_file, import_map) { out.push(v); } [INFO] [stdout] 110 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] = note: `#[warn(clippy::manual_flatten)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 107 ~ for e in arr.elems.iter().flatten() { [INFO] [stdout] 108 + if let Some(v) = expr_to_json_ctx(&e.expr, current_file, import_map) { out.push(v); } [INFO] [stdout] 109 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:108:17 [INFO] [stdout] | [INFO] [stdout] 108 | / if let Some(e) = el { [INFO] [stdout] 109 | | if let Some(v) = expr_to_json_ctx(&e.expr, current_file, import_map) { out.push(v); } [INFO] [stdout] 110 | | } [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] 108 ~ if let Some(e) = el [INFO] [stdout] 109 ~ && let Some(v) = expr_to_json_ctx(&e.expr, current_file, import_map) { out.push(v); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:117:17 [INFO] [stdout] | [INFO] [stdout] 117 | / ... if let PropOrSpread::Prop(p) = prop { [INFO] [stdout] 118 | | ... if let Prop::KeyValue(kv) = &**p { [INFO] [stdout] 119 | | ... let key = match &kv.key { PropName::Ident(i) => i.sym.to_string(), PropName::Str(s) => s.value.to_string(), _ => co... [INFO] [stdout] 120 | | ... if let Some(v) = expr_to_json_ctx(&kv.value, current_file, import_map) { map.insert(key, v); } [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 let PropOrSpread::Prop(p) = prop [INFO] [stdout] 118 ~ && let Prop::KeyValue(kv) = &**p { [INFO] [stdout] 119 | let key = match &kv.key { PropName::Ident(i) => i.sym.to_string(), PropName::Str(s) => s.value.to_string(), _ => continue }; [INFO] [stdout] 120 | if let Some(v) = expr_to_json_ctx(&kv.value, current_file, import_map) { map.insert(key, v); } [INFO] [stdout] 121 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:129:17 [INFO] [stdout] | [INFO] [stdout] 129 | / if let Some(path) = map.get(&name) { [INFO] [stdout] 130 | | if let Ok(m) = parse_module(path) { [INFO] [stdout] 131 | | if let Some(e) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] 132 | | let next_map = build_import_map(&m, path); [INFO] [stdout] ... | [INFO] [stdout] 136 | | } [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] 129 ~ if let Some(path) = map.get(&name) [INFO] [stdout] 130 ~ && let Ok(m) = parse_module(path) { [INFO] [stdout] 131 | if let Some(e) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] ... [INFO] [stdout] 134 | } [INFO] [stdout] 135 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:130:21 [INFO] [stdout] | [INFO] [stdout] 130 | / if let Ok(m) = parse_module(path) { [INFO] [stdout] 131 | | if let Some(e) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] 132 | | let next_map = build_import_map(&m, path); [INFO] [stdout] 133 | | return expr_to_json_ctx(&e, Some(path), Some(&next_map)); [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] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 130 ~ if let Ok(m) = parse_module(path) [INFO] [stdout] 131 ~ && let Some(e) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] 132 | let next_map = build_import_map(&m, path); [INFO] [stdout] 133 | return expr_to_json_ctx(&e, Some(path), Some(&next_map)); [INFO] [stdout] 134 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:313:17 [INFO] [stdout] | [INFO] [stdout] 313 | / if line.contains("name:") && line.contains("type:") { [INFO] [stdout] 314 | | if let Some(name_start) = line.find("name:") { [INFO] [stdout] 315 | | let name_part = &line[name_start + 5..]; [INFO] [stdout] 316 | | if let Some(quote_start) = name_part.find('\'') { [INFO] [stdout] ... | [INFO] [stdout] 328 | | } [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] 313 ~ if line.contains("name:") && line.contains("type:") [INFO] [stdout] 314 ~ && let Some(name_start) = line.find("name:") { [INFO] [stdout] 315 | let name_part = &line[name_start + 5..]; [INFO] [stdout] ... [INFO] [stdout] 326 | } [INFO] [stdout] 327 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:321:32 [INFO] [stdout] | [INFO] [stdout] 321 | } else if let Some(quote_start) = name_part.find('"') { [INFO] [stdout] | ________________________________^ [INFO] [stdout] 322 | | if let Some(quote_end) = name_part[quote_start + 1..].find('"') { [INFO] [stdout] 323 | | let field_name = &name_part[quote_start + 1..quote_start + 1 + quote_end]; [INFO] [stdout] 324 | | fields.push(field_name.to_string()); [INFO] [stdout] 325 | | } [INFO] [stdout] 326 | | } [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] 321 ~ } else if let Some(quote_start) = name_part.find('"') [INFO] [stdout] 322 ~ && let Some(quote_end) = name_part[quote_start + 1..].find('"') { [INFO] [stdout] 323 | let field_name = &name_part[quote_start + 1..quote_start + 1 + quote_end]; [INFO] [stdout] 324 | fields.push(field_name.to_string()); [INFO] [stdout] 325 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `fallback` after checking its variant with `is_some` [INFO] [stdout] --> src/mapping/mod.rs:545:37 [INFO] [stdout] | [INFO] [stdout] 544 | let fallback_info = if fallback.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = &fallback` [INFO] [stdout] 545 | format!("fallback: {}", fallback.as_ref().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] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:178:25 [INFO] [stdout] | [INFO] [stdout] 178 | / if let Pat::Ident(bi) = &d.name { [INFO] [stdout] 179 | | if bi.id.sym == *name { [INFO] [stdout] 180 | | if let Some(init) = &d.init { return Some((**init).clone()); } [INFO] [stdout] 181 | | } [INFO] [stdout] 182 | | } [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] 178 ~ if let Pat::Ident(bi) = &d.name [INFO] [stdout] 179 ~ && bi.id.sym == *name { [INFO] [stdout] 180 | if let Some(init) = &d.init { return Some((**init).clone()); } [INFO] [stdout] 181 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:179:29 [INFO] [stdout] | [INFO] [stdout] 179 | / ... if bi.id.sym == *name { [INFO] [stdout] 180 | | ... if let Some(init) = &d.init { return Some((**init).clone()); } [INFO] [stdout] 181 | | ... } [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] 179 ~ if bi.id.sym == *name [INFO] [stdout] 180 ~ && let Some(init) = &d.init { return Some((**init).clone()); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:188:21 [INFO] [stdout] | [INFO] [stdout] 188 | / if let Pat::Ident(bi) = &d.name { [INFO] [stdout] 189 | | if bi.id.sym == *name { [INFO] [stdout] 190 | | if let Some(init) = &d.init { return Some((**init).clone()); } [INFO] [stdout] 191 | | } [INFO] [stdout] 192 | | } [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] 188 ~ if let Pat::Ident(bi) = &d.name [INFO] [stdout] 189 ~ && bi.id.sym == *name { [INFO] [stdout] 190 | if let Some(init) = &d.init { return Some((**init).clone()); } [INFO] [stdout] 191 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:189:25 [INFO] [stdout] | [INFO] [stdout] 189 | / if bi.id.sym == *name { [INFO] [stdout] 190 | | if let Some(init) = &d.init { return Some((**init).clone()); } [INFO] [stdout] 191 | | } [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] 189 ~ if bi.id.sym == *name [INFO] [stdout] 190 ~ && let Some(init) = &d.init { return Some((**init).clone()); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:212:9 [INFO] [stdout] | [INFO] [stdout] 212 | / if let ModuleItem::Stmt(Stmt::Decl(Decl::Fn(f))) = item { [INFO] [stdout] 213 | | if f.ident.sym == *name { [INFO] [stdout] 214 | | // naive: find first return statement with object literal [INFO] [stdout] 215 | | let mut obj: Option = None; [INFO] [stdout] ... | [INFO] [stdout] 230 | | } [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] 212 ~ if let ModuleItem::Stmt(Stmt::Decl(Decl::Fn(f))) = item [INFO] [stdout] 213 ~ && f.ident.sym == *name { [INFO] [stdout] 214 | // naive: find first return statement with object literal [INFO] [stdout] ... [INFO] [stdout] 228 | if obj.is_some() { return obj; } [INFO] [stdout] 229 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:219:29 [INFO] [stdout] | [INFO] [stdout] 219 | / ... if let Some(arg) = &ret.arg { [INFO] [stdout] 220 | | ... if matches!(&**arg, Expr::Object(_)) { *obj = Some((**arg).clone()); } [INFO] [stdout] 221 | | ... } [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] 219 ~ if let Some(arg) = &ret.arg [INFO] [stdout] 220 ~ && matches!(&**arg, Expr::Object(_)) { *obj = Some((**arg).clone()); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:240:13 [INFO] [stdout] | [INFO] [stdout] 240 | / if let Some(path) = import_map.get(&name) { [INFO] [stdout] 241 | | if let Ok(m) = parse_module(path) { [INFO] [stdout] 242 | | if let Some(e) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] 243 | | return resolve_expr(&e, path, &build_import_map(&m, path)); [INFO] [stdout] ... | [INFO] [stdout] 246 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 240 ~ if let Some(path) = import_map.get(&name) [INFO] [stdout] 241 ~ && let Ok(m) = parse_module(path) { [INFO] [stdout] 242 | if let Some(e) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] 243 | return resolve_expr(&e, path, &build_import_map(&m, path)); [INFO] [stdout] 244 | } [INFO] [stdout] 245 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:241:17 [INFO] [stdout] | [INFO] [stdout] 241 | / if let Ok(m) = parse_module(path) { [INFO] [stdout] 242 | | if let Some(e) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] 243 | | return resolve_expr(&e, path, &build_import_map(&m, path)); [INFO] [stdout] 244 | | } [INFO] [stdout] 245 | | } [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] 241 ~ if let Ok(m) = parse_module(path) [INFO] [stdout] 242 ~ && let Some(e) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] 243 | return resolve_expr(&e, path, &build_import_map(&m, path)); [INFO] [stdout] 244 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:251:13 [INFO] [stdout] | [INFO] [stdout] 251 | / if let Callee::Expr(callee_expr) = &call.callee { [INFO] [stdout] 252 | | if let Expr::Ident(id) = &**callee_expr { [INFO] [stdout] 253 | | let name = id.sym.to_string(); [INFO] [stdout] 254 | | if let Some(path) = import_map.get(&name) { [INFO] [stdout] ... | [INFO] [stdout] 271 | | } [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] 251 ~ if let Callee::Expr(callee_expr) = &call.callee [INFO] [stdout] 252 ~ && let Expr::Ident(id) = &**callee_expr { [INFO] [stdout] 253 | let name = id.sym.to_string(); [INFO] [stdout] ... [INFO] [stdout] 269 | } [INFO] [stdout] 270 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:254:21 [INFO] [stdout] | [INFO] [stdout] 254 | / if let Some(path) = import_map.get(&name) { [INFO] [stdout] 255 | | if let Ok(m) = parse_module(path) { [INFO] [stdout] 256 | | // 1) Try function declaration matching the name [INFO] [stdout] 257 | | if let Some(ret) = find_function_return_object(&m, &name) { [INFO] [stdout] ... | [INFO] [stdout] 269 | | } [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] 254 ~ if let Some(path) = import_map.get(&name) [INFO] [stdout] 255 ~ && let Ok(m) = parse_module(path) { [INFO] [stdout] 256 | // 1) Try function declaration matching the name [INFO] [stdout] ... [INFO] [stdout] 267 | } [INFO] [stdout] 268 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:262:29 [INFO] [stdout] | [INFO] [stdout] 262 | / ... if let Some(init_expr) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) { [INFO] [stdout] 263 | | ... if let Some(ret_expr) = extract_return_from_function_expr(&init_expr) { [INFO] [stdout] 264 | | ... let resolved = resolve_expr(&ret_expr, path, &build_import_map(&m, path)); [INFO] [stdout] 265 | | ... return resolved; [INFO] [stdout] 266 | | ... } [INFO] [stdout] 267 | | ... } [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] 262 ~ if let Some(init_expr) = find_export_expr_by_name(&m, &name).or_else(|| find_default_export_expr(&m)) [INFO] [stdout] 263 ~ && let Some(ret_expr) = extract_return_from_function_expr(&init_expr) { [INFO] [stdout] 264 | let resolved = resolve_expr(&ret_expr, path, &build_import_map(&m, path)); [INFO] [stdout] 265 | return resolved; [INFO] [stdout] 266 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:273:13 [INFO] [stdout] | [INFO] [stdout] 273 | / if let Some(arg0) = call.args.get(0) { [INFO] [stdout] 274 | | if let Some(v) = expr_to_json_ctx(&arg0.expr, Some(current_file), Some(import_map)) { return Some(v); } [INFO] [stdout] 275 | | } [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] 273 ~ if let Some(arg0) = call.args.get(0) [INFO] [stdout] 274 ~ && let Some(v) = expr_to_json_ctx(&arg0.expr, Some(current_file), Some(import_map)) { return Some(v); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `call.args.get(0)` [INFO] [stdout] --> src/mapping/schema_introspect.rs:273:33 [INFO] [stdout] | [INFO] [stdout] 273 | if let Some(arg0) = call.args.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try: `call.args.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:288:9 [INFO] [stdout] | [INFO] [stdout] 288 | / if let ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(ed)) = item { [INFO] [stdout] 289 | | if let Decl::Var(var) = &ed.decl { [INFO] [stdout] 290 | | for d in &var.decls { [INFO] [stdout] 291 | | if let Some(init) = &d.init { [INFO] [stdout] ... | [INFO] [stdout] 320 | | } [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] 288 ~ if let ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(ed)) = item [INFO] [stdout] 289 ~ && let Decl::Var(var) = &ed.decl { [INFO] [stdout] 290 | for d in &var.decls { [INFO] [stdout] ... [INFO] [stdout] 318 | } [INFO] [stdout] 319 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:291:21 [INFO] [stdout] | [INFO] [stdout] 291 | / if let Some(init) = &d.init { [INFO] [stdout] 292 | | if let Expr::Object(obj) = &**init { [INFO] [stdout] 293 | | for prop in &obj.props { [INFO] [stdout] 294 | | if let PropOrSpread::Prop(p) = prop { [INFO] [stdout] ... | [INFO] [stdout] 317 | | } [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] 291 ~ if let Some(init) = &d.init [INFO] [stdout] 292 ~ && let Expr::Object(obj) = &**init { [INFO] [stdout] 293 | for prop in &obj.props { [INFO] [stdout] ... [INFO] [stdout] 315 | } [INFO] [stdout] 316 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:294:33 [INFO] [stdout] | [INFO] [stdout] 294 | / ... if let PropOrSpread::Prop(p) = prop { [INFO] [stdout] 295 | | ... if let Prop::KeyValue(kv) = &**p { [INFO] [stdout] 296 | | ... if let PropName::Ident(id) = &kv.key { [INFO] [stdout] 297 | | ... if id.sym == *"fields" { [INFO] [stdout] ... | [INFO] [stdout] 314 | | ... } [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] 294 ~ if let PropOrSpread::Prop(p) = prop [INFO] [stdout] 295 ~ && let Prop::KeyValue(kv) = &**p { [INFO] [stdout] 296 | if let PropName::Ident(id) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 312 | } [INFO] [stdout] 313 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:295:37 [INFO] [stdout] | [INFO] [stdout] 295 | / ... if let Prop::KeyValue(kv) = &**p { [INFO] [stdout] 296 | | ... if let PropName::Ident(id) = &kv.key { [INFO] [stdout] 297 | | ... if id.sym == *"fields" { [INFO] [stdout] 298 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 313 | | ... } [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] 295 ~ if let Prop::KeyValue(kv) = &**p [INFO] [stdout] 296 ~ && let PropName::Ident(id) = &kv.key { [INFO] [stdout] 297 | if id.sym == *"fields" { [INFO] [stdout] ... [INFO] [stdout] 311 | } [INFO] [stdout] 312 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:296:41 [INFO] [stdout] | [INFO] [stdout] 296 | / ... if let PropName::Ident(id) = &kv.key { [INFO] [stdout] 297 | | ... if id.sym == *"fields" { [INFO] [stdout] 298 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 299 | | ... let mut out = Vec::new(); [INFO] [stdout] ... | [INFO] [stdout] 312 | | ... } [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] 296 ~ if let PropName::Ident(id) = &kv.key [INFO] [stdout] 297 ~ && id.sym == *"fields" { [INFO] [stdout] 298 | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... [INFO] [stdout] 310 | } [INFO] [stdout] 311 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:297:45 [INFO] [stdout] | [INFO] [stdout] 297 | / ... if id.sym == *"fields" { [INFO] [stdout] 298 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 299 | | ... let mut out = Vec::new(); [INFO] [stdout] 300 | | ... for el in &arr.elems { [INFO] [stdout] ... | [INFO] [stdout] 311 | | ... } [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] 297 ~ if id.sym == *"fields" [INFO] [stdout] 298 ~ && let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 299 | let mut out = Vec::new(); [INFO] [stdout] ... [INFO] [stdout] 309 | return Ok(out); [INFO] [stdout] 310 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/mapping/schema_introspect.rs:300:53 [INFO] [stdout] | [INFO] [stdout] 300 | / ... for el in &arr.elems { [INFO] [stdout] 301 | | ... if let Some(e) = el { [INFO] [stdout] 302 | | ... // Resolve identifiers/calls; otherwise attempt JSON fallback [INFO] [stdout] 303 | | ... if let Some(v) = resolve_expr(&e.expr, schema_path, &import_map) [INFO] [stdout] ... | [INFO] [stdout] 308 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/mapping/schema_introspect.rs:301:57 [INFO] [stdout] | [INFO] [stdout] 301 | / ... if let Some(e) = el { [INFO] [stdout] 302 | | ... // Resolve identifiers/calls; otherwise attempt JSON fallback [INFO] [stdout] 303 | | ... if let Some(v) = resolve_expr(&e.expr, schema_path, &import_map) [INFO] [stdout] 304 | | ... .or_else(|| expr_to_json_ctx(&e.expr, Some(schema_path), Some(&import_map))) { [INFO] [stdout] ... | [INFO] [stdout] 307 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 300 ~ for e in arr.elems.iter().flatten() { [INFO] [stdout] 301 + // Resolve identifiers/calls; otherwise attempt JSON fallback [INFO] [stdout] 302 + if let Some(v) = resolve_expr(&e.expr, schema_path, &import_map) [INFO] [stdout] 303 + .or_else(|| expr_to_json_ctx(&e.expr, Some(schema_path), Some(&import_map))) { [INFO] [stdout] 304 + out.push(v); [INFO] [stdout] 305 + } [INFO] [stdout] 306 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:326:9 [INFO] [stdout] | [INFO] [stdout] 326 | / if let ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(ed)) = item { [INFO] [stdout] 327 | | if let Decl::Var(var) = &ed.decl { [INFO] [stdout] 328 | | for d in &var.decls { [INFO] [stdout] 329 | | if let Some(init) = &d.init { [INFO] [stdout] ... | [INFO] [stdout] 361 | | } [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] 326 ~ if let ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(ed)) = item [INFO] [stdout] 327 ~ && let Decl::Var(var) = &ed.decl { [INFO] [stdout] 328 | for d in &var.decls { [INFO] [stdout] ... [INFO] [stdout] 359 | } [INFO] [stdout] 360 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:329:21 [INFO] [stdout] | [INFO] [stdout] 329 | / if let Some(init) = &d.init { [INFO] [stdout] 330 | | if let Expr::Object(obj) = &**init { [INFO] [stdout] 331 | | // find 'fields: []' and resolve each [INFO] [stdout] 332 | | for prop in &obj.props { [INFO] [stdout] ... | [INFO] [stdout] 358 | | } [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] 329 ~ if let Some(init) = &d.init [INFO] [stdout] 330 ~ && let Expr::Object(obj) = &**init { [INFO] [stdout] 331 | // find 'fields: []' and resolve each [INFO] [stdout] ... [INFO] [stdout] 356 | } [INFO] [stdout] 357 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:333:33 [INFO] [stdout] | [INFO] [stdout] 333 | / ... if let PropOrSpread::Prop(p) = prop { [INFO] [stdout] 334 | | ... if let Prop::KeyValue(kv) = &**p { [INFO] [stdout] 335 | | ... if let PropName::Ident(id) = &kv.key { [INFO] [stdout] 336 | | ... if id.sym == *"fields" { [INFO] [stdout] ... | [INFO] [stdout] 355 | | ... } [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] 333 ~ if let PropOrSpread::Prop(p) = prop [INFO] [stdout] 334 ~ && let Prop::KeyValue(kv) = &**p { [INFO] [stdout] 335 | if let PropName::Ident(id) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 353 | } [INFO] [stdout] 354 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:334:37 [INFO] [stdout] | [INFO] [stdout] 334 | / ... if let Prop::KeyValue(kv) = &**p { [INFO] [stdout] 335 | | ... if let PropName::Ident(id) = &kv.key { [INFO] [stdout] 336 | | ... if id.sym == *"fields" { [INFO] [stdout] 337 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 354 | | ... } [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] 334 ~ if let Prop::KeyValue(kv) = &**p [INFO] [stdout] 335 ~ && let PropName::Ident(id) = &kv.key { [INFO] [stdout] 336 | if id.sym == *"fields" { [INFO] [stdout] ... [INFO] [stdout] 352 | } [INFO] [stdout] 353 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:335:41 [INFO] [stdout] | [INFO] [stdout] 335 | / ... if let PropName::Ident(id) = &kv.key { [INFO] [stdout] 336 | | ... if id.sym == *"fields" { [INFO] [stdout] 337 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 338 | | ... let mut out = Vec::new(); [INFO] [stdout] ... | [INFO] [stdout] 353 | | ... } [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] 335 ~ if let PropName::Ident(id) = &kv.key [INFO] [stdout] 336 ~ && id.sym == *"fields" { [INFO] [stdout] 337 | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... [INFO] [stdout] 351 | } [INFO] [stdout] 352 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:336:45 [INFO] [stdout] | [INFO] [stdout] 336 | / ... if id.sym == *"fields" { [INFO] [stdout] 337 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 338 | | ... let mut out = Vec::new(); [INFO] [stdout] 339 | | ... for el in &arr.elems { [INFO] [stdout] ... | [INFO] [stdout] 352 | | ... } [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] 336 ~ if id.sym == *"fields" [INFO] [stdout] 337 ~ && let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 338 | let mut out = Vec::new(); [INFO] [stdout] ... [INFO] [stdout] 350 | if !out.is_empty() { return Ok(out); } [INFO] [stdout] 351 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/mapping/schema_introspect.rs:339:53 [INFO] [stdout] | [INFO] [stdout] 339 | / ... for el in &arr.elems { [INFO] [stdout] 340 | | ... if let Some(e) = el { [INFO] [stdout] 341 | | ... if let Some(v) = resolve_expr(&e.expr, schema_path, &import_map) { [INFO] [stdout] 342 | | ... match v { [INFO] [stdout] ... | [INFO] [stdout] 349 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/mapping/schema_introspect.rs:340:57 [INFO] [stdout] | [INFO] [stdout] 340 | / ... if let Some(e) = el { [INFO] [stdout] 341 | | ... if let Some(v) = resolve_expr(&e.expr, schema_path, &import_map) { [INFO] [stdout] 342 | | ... match v { [INFO] [stdout] 343 | | ... Value::Array(items) => out.extend(items), [INFO] [stdout] ... | [INFO] [stdout] 348 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 339 ~ for e in arr.elems.iter().flatten() { [INFO] [stdout] 340 + if let Some(v) = resolve_expr(&e.expr, schema_path, &import_map) { [INFO] [stdout] 341 + match v { [INFO] [stdout] 342 + Value::Array(items) => out.extend(items), [INFO] [stdout] 343 + Value::Object(_) => out.push(v), [INFO] [stdout] 344 + _ => {} [INFO] [stdout] 345 + } [INFO] [stdout] 346 + } [INFO] [stdout] 347 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:340:57 [INFO] [stdout] | [INFO] [stdout] 340 | / ... if let Some(e) = el { [INFO] [stdout] 341 | | ... if let Some(v) = resolve_expr(&e.expr, schema_path, &import_map) { [INFO] [stdout] 342 | | ... match v { [INFO] [stdout] 343 | | ... Value::Array(items) => out.extend(items), [INFO] [stdout] ... | [INFO] [stdout] 348 | | ... } [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] 340 ~ if let Some(e) = el [INFO] [stdout] 341 ~ && let Some(v) = resolve_expr(&e.expr, schema_path, &import_map) { [INFO] [stdout] 342 | match v { [INFO] [stdout] ... [INFO] [stdout] 346 | } [INFO] [stdout] 347 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:372:21 [INFO] [stdout] | [INFO] [stdout] 372 | / if let Stmt::Return(ret) = st { [INFO] [stdout] 373 | | if let Some(arg) = &ret.arg { return Some((**arg).clone()); } [INFO] [stdout] 374 | | } [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] 372 ~ if let Stmt::Return(ret) = st [INFO] [stdout] 373 ~ && let Some(arg) = &ret.arg { return Some((**arg).clone()); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/mapping/mod.rs:434:67 [INFO] [stdout] | [INFO] [stdout] 434 | if source.to_lowercase() == target.to_lowercase() { [INFO] [stdout] | ___________________________________________________________________^ [INFO] [stdout] 435 | | suggestions.push(source.clone()); [INFO] [stdout] 436 | | } else if source.to_lowercase().contains(&target.to_lowercase()) { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/mapping/mod.rs:436:82 [INFO] [stdout] | [INFO] [stdout] 436 | } else if source.to_lowercase().contains(&target.to_lowercase()) { [INFO] [stdout] | __________________________________________________________________________________^ [INFO] [stdout] 437 | | suggestions.push(source.clone()); [INFO] [stdout] 438 | | } else if target.to_lowercase().contains(&source.to_lowercase()) { [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/mapping/mod.rs:436:82 [INFO] [stdout] | [INFO] [stdout] 436 | } else if source.to_lowercase().contains(&target.to_lowercase()) { [INFO] [stdout] | __________________________________________________________________________________^ [INFO] [stdout] 437 | | suggestions.push(source.clone()); [INFO] [stdout] 438 | | } else if target.to_lowercase().contains(&source.to_lowercase()) { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/mapping/mod.rs:438:82 [INFO] [stdout] | [INFO] [stdout] 438 | } else if target.to_lowercase().contains(&source.to_lowercase()) { [INFO] [stdout] | __________________________________________________________________________________^ [INFO] [stdout] 439 | | suggestions.push(source.clone()); [INFO] [stdout] 440 | | } [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/mapping/mod.rs:454:53 [INFO] [stdout] | [INFO] [stdout] 454 | ... display_progress_table(&completed_mappings, &target_fields, current_field, total_fields, collection_name, collection_progress); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `target_fields` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:384:25 [INFO] [stdout] | [INFO] [stdout] 384 | / if let Stmt::Return(ret) = st { [INFO] [stdout] 385 | | if let Some(arg) = &ret.arg { return Some((**arg).clone()); } [INFO] [stdout] 386 | | } [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] 384 ~ if let Stmt::Return(ret) = st [INFO] [stdout] 385 ~ && let Some(arg) = &ret.arg { return Some((**arg).clone()); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/mapping/mod.rs:502:86 [INFO] [stdout] | [INFO] [stdout] 502 | let combine_result = handle_combine_coordinates(selected_source, &source_fields)?; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `source_fields` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant redefinition of a binding `base_dir` [INFO] [stdout] --> src/mapping/schema_introspect.rs:459:5 [INFO] [stdout] | [INFO] [stdout] 459 | let base_dir = base_dir; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: `base_dir` is initially defined here [INFO] [stdout] --> src/mapping/schema_introspect.rs:458:9 [INFO] [stdout] | [INFO] [stdout] 458 | let base_dir = tsconfig_path.parent().unwrap_or(Path::new(".")).join(base_url); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_locals [INFO] [stdout] = note: `#[warn(clippy::redundant_locals)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/schema_introspect.rs:481:5 [INFO] [stdout] | [INFO] [stdout] 481 | / if let Some(ts) = &cfg.typescript { [INFO] [stdout] 482 | | if let Some(pm) = &ts.path_mappings { [INFO] [stdout] 483 | | let base = std::path::Path::new(&ts.tsconfig_path).parent().unwrap_or(std::path::Path::new(".")).to_path_buf(); [INFO] [stdout] 484 | | let mappings: Vec<(String, Vec)> = pm.iter().map(|m| (m.alias.clone(), m.paths.clone())).collect(); [INFO] [stdout] ... | [INFO] [stdout] 487 | | } [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] 481 ~ if let Some(ts) = &cfg.typescript [INFO] [stdout] 482 ~ && let Some(pm) = &ts.path_mappings { [INFO] [stdout] 483 | let base = std::path::Path::new(&ts.tsconfig_path).parent().unwrap_or(std::path::Path::new(".")).to_path_buf(); [INFO] [stdout] 484 | let mappings: Vec<(String, Vec)> = pm.iter().map(|m| (m.alias.clone(), m.paths.clone())).collect(); [INFO] [stdout] 485 | let _ = TS_PATHS.set(TsPathsConfig { base_dir: base, mappings }); [INFO] [stdout] 486 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `source_data.get(0)` [INFO] [stdout] --> src/mapping/mod.rs:579:61 [INFO] [stdout] | [INFO] [stdout] 579 | ... dlog_processing!("Source data structure: {:?}", source_data.get(0).and_then(|d| d.as_object()).map(|obj| obj.keys().collect::... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `source_data.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:606:9 [INFO] [stdout] | [INFO] [stdout] 606 | / if let Some(acf_field) = doc.get("acf") { [INFO] [stdout] 607 | | if let Some(flexible_content) = acf_field.get("flexible_content") { [INFO] [stdout] 608 | | if let Some(flexible_array) = flexible_content.as_array() { [INFO] [stdout] 609 | | for block_data in flexible_array { [INFO] [stdout] ... | [INFO] [stdout] 621 | | } [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] 606 ~ if let Some(acf_field) = doc.get("acf") [INFO] [stdout] 607 ~ && let Some(flexible_content) = acf_field.get("flexible_content") { [INFO] [stdout] 608 | if let Some(flexible_array) = flexible_content.as_array() { [INFO] [stdout] ... [INFO] [stdout] 619 | } [INFO] [stdout] 620 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:607:13 [INFO] [stdout] | [INFO] [stdout] 607 | / if let Some(flexible_content) = acf_field.get("flexible_content") { [INFO] [stdout] 608 | | if let Some(flexible_array) = flexible_content.as_array() { [INFO] [stdout] 609 | | for block_data in flexible_array { [INFO] [stdout] 610 | | if let Some(layout) = block_data.get("acf_fc_layout") { [INFO] [stdout] ... | [INFO] [stdout] 620 | | } [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] 607 ~ if let Some(flexible_content) = acf_field.get("flexible_content") [INFO] [stdout] 608 ~ && let Some(flexible_array) = flexible_content.as_array() { [INFO] [stdout] 609 | for block_data in flexible_array { [INFO] [stdout] ... [INFO] [stdout] 618 | } [INFO] [stdout] 619 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:610:25 [INFO] [stdout] | [INFO] [stdout] 610 | / if let Some(layout) = block_data.get("acf_fc_layout") { [INFO] [stdout] 611 | | if let Some(layout_str) = layout.as_str() { [INFO] [stdout] 612 | | blocks.push(crate::mapping::json_mapping::ACFFlexibleContentBlock { [INFO] [stdout] 613 | | acf_fc_layout: layout_str.to_string(), [INFO] [stdout] ... | [INFO] [stdout] 617 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 610 ~ if let Some(layout) = block_data.get("acf_fc_layout") [INFO] [stdout] 611 ~ && let Some(layout_str) = layout.as_str() { [INFO] [stdout] 612 | blocks.push(crate::mapping::json_mapping::ACFFlexibleContentBlock { [INFO] [stdout] ... [INFO] [stdout] 615 | }); [INFO] [stdout] 616 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/mapping/mod.rs:754:44 [INFO] [stdout] | [INFO] [stdout] 754 | let block_target_fields: Vec = target_fields [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 755 | | .iter() [INFO] [stdout] 756 | | .filter(|field| field.starts_with(&format!("blocks.{}.", payload_block_type))) [INFO] [stdout] 757 | | .map(|field| field.clone()) [INFO] [stdout] | |___________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] help: consider calling the dedicated `cloned` method [INFO] [stdout] | [INFO] [stdout] 754 ~ let block_target_fields: Vec = target_fields [INFO] [stdout] 755 + .iter() [INFO] [stdout] 756 + .filter(|field| field.starts_with(&format!("blocks.{}.", payload_block_type))).cloned() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:767:9 [INFO] [stdout] | [INFO] [stdout] 767 | / if let Some(acf_field) = doc.get("acf") { [INFO] [stdout] 768 | | if let Some(flexible_content) = acf_field.get("flexible_content") { [INFO] [stdout] 769 | | if let Some(flexible_array) = flexible_content.as_array() { [INFO] [stdout] 770 | | for block_data in flexible_array { [INFO] [stdout] ... | [INFO] [stdout] 788 | | } [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] 767 ~ if let Some(acf_field) = doc.get("acf") [INFO] [stdout] 768 ~ && let Some(flexible_content) = acf_field.get("flexible_content") { [INFO] [stdout] 769 | if let Some(flexible_array) = flexible_content.as_array() { [INFO] [stdout] ... [INFO] [stdout] 786 | } [INFO] [stdout] 787 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:768:13 [INFO] [stdout] | [INFO] [stdout] 768 | / if let Some(flexible_content) = acf_field.get("flexible_content") { [INFO] [stdout] 769 | | if let Some(flexible_array) = flexible_content.as_array() { [INFO] [stdout] 770 | | for block_data in flexible_array { [INFO] [stdout] 771 | | if let Some(layout) = block_data.get("acf_fc_layout") { [INFO] [stdout] ... | [INFO] [stdout] 787 | | } [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] 768 ~ if let Some(flexible_content) = acf_field.get("flexible_content") [INFO] [stdout] 769 ~ && let Some(flexible_array) = flexible_content.as_array() { [INFO] [stdout] 770 | for block_data in flexible_array { [INFO] [stdout] ... [INFO] [stdout] 785 | } [INFO] [stdout] 786 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:771:25 [INFO] [stdout] | [INFO] [stdout] 771 | / if let Some(layout) = block_data.get("acf_fc_layout") { [INFO] [stdout] 772 | | if let Some(layout_str) = layout.as_str() { [INFO] [stdout] 773 | | if layout_str == acf_layout { [INFO] [stdout] ... | [INFO] [stdout] 784 | | } [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] 771 ~ if let Some(layout) = block_data.get("acf_fc_layout") [INFO] [stdout] 772 ~ && let Some(layout_str) = layout.as_str() { [INFO] [stdout] 773 | if layout_str == acf_layout { [INFO] [stdout] ... [INFO] [stdout] 782 | } [INFO] [stdout] 783 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:772:29 [INFO] [stdout] | [INFO] [stdout] 772 | / ... if let Some(layout_str) = layout.as_str() { [INFO] [stdout] 773 | | ... if layout_str == acf_layout { [INFO] [stdout] 774 | | ... // Extract field names from this block [INFO] [stdout] 775 | | ... if let Some(obj) = block_data.as_object() { [INFO] [stdout] ... | [INFO] [stdout] 783 | | ... } [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] 772 ~ if let Some(layout_str) = layout.as_str() [INFO] [stdout] 773 ~ && layout_str == acf_layout { [INFO] [stdout] 774 | // Extract field names from this block [INFO] [stdout] ... [INFO] [stdout] 781 | } [INFO] [stdout] 782 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/mapping/mod.rs:809:26 [INFO] [stdout] | [INFO] [stdout] 809 | let field_name = target_field.split('.').last().unwrap_or(target_field); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 809 - let field_name = target_field.split('.').last().unwrap_or(target_field); [INFO] [stdout] 809 + let field_name = target_field.split('.').next_back().unwrap_or(target_field); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/mapping/mod.rs:816:67 [INFO] [stdout] | [INFO] [stdout] 816 | if source.to_lowercase() == field_name.to_lowercase() { [INFO] [stdout] | ___________________________________________________________________^ [INFO] [stdout] 817 | | suggestions.push(source.clone()); [INFO] [stdout] 818 | | } else if source.to_lowercase().contains(&field_name.to_lowercase()) { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/mapping/mod.rs:818:82 [INFO] [stdout] | [INFO] [stdout] 818 | } else if source.to_lowercase().contains(&field_name.to_lowercase()) { [INFO] [stdout] | __________________________________________________________________________________^ [INFO] [stdout] 819 | | suggestions.push(source.clone()); [INFO] [stdout] 820 | | } else if field_name.to_lowercase().contains(&source.to_lowercase()) { [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/mapping/mod.rs:818:82 [INFO] [stdout] | [INFO] [stdout] 818 | } else if source.to_lowercase().contains(&field_name.to_lowercase()) { [INFO] [stdout] | __________________________________________________________________________________^ [INFO] [stdout] 819 | | suggestions.push(source.clone()); [INFO] [stdout] 820 | | } else if field_name.to_lowercase().contains(&source.to_lowercase()) { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/mapping/mod.rs:820:82 [INFO] [stdout] | [INFO] [stdout] 820 | } else if field_name.to_lowercase().contains(&source.to_lowercase()) { [INFO] [stdout] | __________________________________________________________________________________^ [INFO] [stdout] 821 | | suggestions.push(source.clone()); [INFO] [stdout] 822 | | } [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: you should consider adding a `Default` implementation for `BlockMappings` [INFO] [stdout] --> src/mapping/json_mapping.rs:44:5 [INFO] [stdout] | [INFO] [stdout] 44 | / pub fn new() -> Self { [INFO] [stdout] 45 | | Self { [INFO] [stdout] 46 | | layout_to_block_type: HashMap::new(), [INFO] [stdout] 47 | | block_field_mappings: HashMap::new(), [INFO] [stdout] 48 | | } [INFO] [stdout] 49 | | } [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] 43 + impl Default for BlockMappings { [INFO] [stdout] 44 + fn default() -> Self { [INFO] [stdout] 45 + Self::new() [INFO] [stdout] 46 + } [INFO] [stdout] 47 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/nested.rs:130:21 [INFO] [stdout] | [INFO] [stdout] 130 | / if let Some(array) = value.as_array() { [INFO] [stdout] 131 | | if *index < array.len() { [INFO] [stdout] 132 | | new_results.push(array[*index].clone()); [INFO] [stdout] 133 | | } [INFO] [stdout] 134 | | } [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] 130 ~ if let Some(array) = value.as_array() [INFO] [stdout] 131 ~ && *index < array.len() { [INFO] [stdout] 132 | new_results.push(array[*index].clone()); [INFO] [stdout] 133 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/mapping/nested.rs:233:24 [INFO] [stdout] | [INFO] [stdout] 233 | if !current.get(field_name).is_some() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `current.get(field_name).is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:1076:13 [INFO] [stdout] | [INFO] [stdout] 1076 | / if let Value::Object(nested_obj) = nested_result { [INFO] [stdout] 1077 | | if let Value::Object(main_obj) = &mut result { [INFO] [stdout] 1078 | | main_obj.extend(nested_obj); [INFO] [stdout] 1079 | | } [INFO] [stdout] 1080 | | } [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] 1076 ~ if let Value::Object(nested_obj) = nested_result [INFO] [stdout] 1077 ~ && let Value::Object(main_obj) = &mut result { [INFO] [stdout] 1078 | main_obj.extend(nested_obj); [INFO] [stdout] 1079 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:1087:17 [INFO] [stdout] | [INFO] [stdout] 1087 | / if let Some(fallback) = &field_mapping.fallback { [INFO] [stdout] 1088 | | if let Value::Object(main_obj) = &mut result { [INFO] [stdout] 1089 | | main_obj.insert(field_mapping.to.clone(), Value::String(fallback.clone())); [INFO] [stdout] 1090 | | } [INFO] [stdout] 1091 | | } [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] 1087 ~ if let Some(fallback) = &field_mapping.fallback [INFO] [stdout] 1088 ~ && let Value::Object(main_obj) = &mut result { [INFO] [stdout] 1089 | main_obj.insert(field_mapping.to.clone(), Value::String(fallback.clone())); [INFO] [stdout] 1090 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/nested.rs:307:13 [INFO] [stdout] | [INFO] [stdout] 307 | / if let Value::Object(nested_obj) = nested_result { [INFO] [stdout] 308 | | if let Value::Object(main_obj) = &mut result { [INFO] [stdout] 309 | | main_obj.extend(nested_obj); [INFO] [stdout] 310 | | } [INFO] [stdout] 311 | | } [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] 307 ~ if let Value::Object(nested_obj) = nested_result [INFO] [stdout] 308 ~ && let Value::Object(main_obj) = &mut result { [INFO] [stdout] 309 | main_obj.extend(nested_obj); [INFO] [stdout] 310 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:1117:17 [INFO] [stdout] | [INFO] [stdout] 1117 | / if let Value::String(path_str) = path { [INFO] [stdout] 1118 | | if path_str.contains('.') || path_str.contains('[') { [INFO] [stdout] 1119 | | return Ok(Some(NestedPath::from_dot_notation(path_str)?)); [INFO] [stdout] 1120 | | } [INFO] [stdout] 1121 | | } [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] 1117 ~ if let Value::String(path_str) = path [INFO] [stdout] 1118 ~ && (path_str.contains('.') || path_str.contains('[')) { [INFO] [stdout] 1119 | return Ok(Some(NestedPath::from_dot_notation(path_str)?)); [INFO] [stdout] 1120 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:1141:17 [INFO] [stdout] | [INFO] [stdout] 1141 | / if let Value::String(p) = path { [INFO] [stdout] 1142 | | if let Some(v) = get_path(doc, p) { [INFO] [stdout] 1143 | | if !v.is_null() { [INFO] [stdout] 1144 | | result = v.clone(); [INFO] [stdout] ... | [INFO] [stdout] 1148 | | } [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] 1141 ~ if let Value::String(p) = path [INFO] [stdout] 1142 ~ && let Some(v) = get_path(doc, p) { [INFO] [stdout] 1143 | if !v.is_null() { [INFO] [stdout] ... [INFO] [stdout] 1146 | } [INFO] [stdout] 1147 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/nested.rs:317:17 [INFO] [stdout] | [INFO] [stdout] 317 | / if let Some(fallback) = &field_mapping.fallback { [INFO] [stdout] 318 | | if let Value::Object(main_obj) = &mut result { [INFO] [stdout] 319 | | main_obj.insert(field_mapping.to.clone(), Value::String(fallback.clone())); [INFO] [stdout] 320 | | } [INFO] [stdout] 321 | | } [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] 317 ~ if let Some(fallback) = &field_mapping.fallback [INFO] [stdout] 318 ~ && let Value::Object(main_obj) = &mut result { [INFO] [stdout] 319 | main_obj.insert(field_mapping.to.clone(), Value::String(fallback.clone())); [INFO] [stdout] 320 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:1142:21 [INFO] [stdout] | [INFO] [stdout] 1142 | / if let Some(v) = get_path(doc, p) { [INFO] [stdout] 1143 | | if !v.is_null() { [INFO] [stdout] 1144 | | result = v.clone(); [INFO] [stdout] 1145 | | break; [INFO] [stdout] 1146 | | } [INFO] [stdout] 1147 | | } [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] 1142 ~ if let Some(v) = get_path(doc, p) [INFO] [stdout] 1143 ~ && !v.is_null() { [INFO] [stdout] 1144 | result = v.clone(); [INFO] [stdout] 1145 | break; [INFO] [stdout] 1146 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/nested.rs:346:17 [INFO] [stdout] | [INFO] [stdout] 346 | / if let Value::String(path_str) = path { [INFO] [stdout] 347 | | if path_str.contains('.') || path_str.contains('[') { [INFO] [stdout] 348 | | return Ok(Some(NestedPath::from_dot_notation(path_str)?)); [INFO] [stdout] 349 | | } [INFO] [stdout] 350 | | } [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] 346 ~ if let Value::String(path_str) = path [INFO] [stdout] 347 ~ && (path_str.contains('.') || path_str.contains('[')) { [INFO] [stdout] 348 | return Ok(Some(NestedPath::from_dot_notation(path_str)?)); [INFO] [stdout] 349 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: matching on `Some` with `ok()` is redundant [INFO] [stdout] --> src/mapping/transforms.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | if let Some(idx) = part.parse::().ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok [INFO] [stdout] = note: `#[warn(clippy::match_result_ok)]` on by default [INFO] [stdout] help: consider matching on `Ok(idx)` and removing the call to `ok` instead [INFO] [stdout] | [INFO] [stdout] 8 - if let Some(idx) = part.parse::().ok() { [INFO] [stdout] 8 + if let Ok(idx) = part.parse::() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:141:21 [INFO] [stdout] | [INFO] [stdout] 141 | / if let PropOrSpread::Prop(prop_box) = prop { [INFO] [stdout] 142 | | if let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 143 | | if let PropName::Ident(ident) = &key_value.key { [INFO] [stdout] 144 | | let key_name = ident.sym.to_string(); [INFO] [stdout] ... | [INFO] [stdout] 174 | | } [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] 141 ~ if let PropOrSpread::Prop(prop_box) = prop [INFO] [stdout] 142 ~ && let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 143 | if let PropName::Ident(ident) = &key_value.key { [INFO] [stdout] ... [INFO] [stdout] 172 | } [INFO] [stdout] 173 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:142:25 [INFO] [stdout] | [INFO] [stdout] 142 | / if let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 143 | | if let PropName::Ident(ident) = &key_value.key { [INFO] [stdout] 144 | | let key_name = ident.sym.to_string(); [INFO] [stdout] 145 | | debug!("Found property: {}", key_name); [INFO] [stdout] ... | [INFO] [stdout] 173 | | } [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] 142 ~ if let Prop::KeyValue(key_value) = &**prop_box [INFO] [stdout] 143 ~ && let PropName::Ident(ident) = &key_value.key { [INFO] [stdout] 144 | let key_name = ident.sym.to_string(); [INFO] [stdout] ... [INFO] [stdout] 171 | } [INFO] [stdout] 172 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:194:9 [INFO] [stdout] | [INFO] [stdout] 194 | / if let PropOrSpread::Prop(prop_box) = prop { [INFO] [stdout] 195 | | if let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 196 | | // Extract property key [INFO] [stdout] 197 | | let key = match &key_value.key { [INFO] [stdout] ... | [INFO] [stdout] 253 | | } [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] 194 ~ if let PropOrSpread::Prop(prop_box) = prop [INFO] [stdout] 195 ~ && let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 196 | // Extract property key [INFO] [stdout] ... [INFO] [stdout] 251 | } [INFO] [stdout] 252 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:227:32 [INFO] [stdout] | [INFO] [stdout] 227 | } else if let Some(relations) = extract_string_array(&key_value.value) { [INFO] [stdout] | ________________________________^ [INFO] [stdout] 228 | | if !relations.is_empty() { [INFO] [stdout] 229 | | relationship = Some(RelationshipInfo { [INFO] [stdout] 230 | | collection: relations[0].clone(), [INFO] [stdout] ... | [INFO] [stdout] 234 | | } [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] 227 ~ } else if let Some(relations) = extract_string_array(&key_value.value) [INFO] [stdout] 228 ~ && !relations.is_empty() { [INFO] [stdout] 229 | relationship = Some(RelationshipInfo { [INFO] [stdout] ... [INFO] [stdout] 232 | }); [INFO] [stdout] 233 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:237:25 [INFO] [stdout] | [INFO] [stdout] 237 | / if let Some(has_many) = extract_boolean_value(&key_value.value) { [INFO] [stdout] 238 | | if has_many && relationship.is_some() { [INFO] [stdout] 239 | | let mut rel = relationship.unwrap(); [INFO] [stdout] 240 | | rel.relationship_type = "hasMany".to_string(); [INFO] [stdout] ... | [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_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 237 ~ if let Some(has_many) = extract_boolean_value(&key_value.value) [INFO] [stdout] 238 ~ && has_many && relationship.is_some() { [INFO] [stdout] 239 | let mut rel = relationship.unwrap(); [INFO] [stdout] 240 | rel.relationship_type = "hasMany".to_string(); [INFO] [stdout] 241 | relationship = Some(rel); [INFO] [stdout] 242 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/mapping/typescript.rs:292:13 [INFO] [stdout] | [INFO] [stdout] 292 | / for elem in &array_lit.elems { [INFO] [stdout] 293 | | if let Some(expr) = elem { [INFO] [stdout] 294 | | if let Expr::Lit(Lit::Str(str_lit)) = &*expr.expr { [INFO] [stdout] 295 | | strings.push(str_lit.value.to_string()); [INFO] [stdout] ... | [INFO] [stdout] 298 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/mapping/typescript.rs:293:17 [INFO] [stdout] | [INFO] [stdout] 293 | / if let Some(expr) = elem { [INFO] [stdout] 294 | | if let Expr::Lit(Lit::Str(str_lit)) = &*expr.expr { [INFO] [stdout] 295 | | strings.push(str_lit.value.to_string()); [INFO] [stdout] 296 | | } [INFO] [stdout] 297 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 292 ~ for expr in array_lit.elems.iter().flatten() { [INFO] [stdout] 293 + if let Expr::Lit(Lit::Str(str_lit)) = &*expr.expr { [INFO] [stdout] 294 + strings.push(str_lit.value.to_string()); [INFO] [stdout] 295 + } [INFO] [stdout] 296 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:293:17 [INFO] [stdout] | [INFO] [stdout] 293 | / if let Some(expr) = elem { [INFO] [stdout] 294 | | if let Expr::Lit(Lit::Str(str_lit)) = &*expr.expr { [INFO] [stdout] 295 | | strings.push(str_lit.value.to_string()); [INFO] [stdout] 296 | | } [INFO] [stdout] 297 | | } [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] 293 ~ if let Some(expr) = elem [INFO] [stdout] 294 ~ && let Expr::Lit(Lit::Str(str_lit)) = &*expr.expr { [INFO] [stdout] 295 | strings.push(str_lit.value.to_string()); [INFO] [stdout] 296 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:312:17 [INFO] [stdout] | [INFO] [stdout] 312 | / if let PropOrSpread::Prop(prop_box) = prop { [INFO] [stdout] 313 | | if let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 314 | | let key = match &key_value.key { [INFO] [stdout] 315 | | PropName::Ident(ident) => ident.sym.to_string(), [INFO] [stdout] ... | [INFO] [stdout] 324 | | } [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] 312 ~ if let PropOrSpread::Prop(prop_box) = prop [INFO] [stdout] 313 ~ && let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 314 | let key = match &key_value.key { [INFO] [stdout] ... [INFO] [stdout] 322 | } [INFO] [stdout] 323 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/mapping/typescript.rs:345:13 [INFO] [stdout] | [INFO] [stdout] 345 | / for elem in &array_lit.elems { [INFO] [stdout] 346 | | if let Some(expr) = elem { [INFO] [stdout] 347 | | if let Some(value) = extract_json_value(&expr.expr) { [INFO] [stdout] 348 | | values.push(value); [INFO] [stdout] ... | [INFO] [stdout] 351 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/mapping/typescript.rs:346:17 [INFO] [stdout] | [INFO] [stdout] 346 | / if let Some(expr) = elem { [INFO] [stdout] 347 | | if let Some(value) = extract_json_value(&expr.expr) { [INFO] [stdout] 348 | | values.push(value); [INFO] [stdout] 349 | | } [INFO] [stdout] 350 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 345 ~ for expr in array_lit.elems.iter().flatten() { [INFO] [stdout] 346 + if let Some(value) = extract_json_value(&expr.expr) { [INFO] [stdout] 347 + values.push(value); [INFO] [stdout] 348 + } [INFO] [stdout] 349 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:346:17 [INFO] [stdout] | [INFO] [stdout] 346 | / if let Some(expr) = elem { [INFO] [stdout] 347 | | if let Some(value) = extract_json_value(&expr.expr) { [INFO] [stdout] 348 | | values.push(value); [INFO] [stdout] 349 | | } [INFO] [stdout] 350 | | } [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] 346 ~ if let Some(expr) = elem [INFO] [stdout] 347 ~ && let Some(value) = extract_json_value(&expr.expr) { [INFO] [stdout] 348 | values.push(value); [INFO] [stdout] 349 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/typescript.rs:357:17 [INFO] [stdout] | [INFO] [stdout] 357 | / if let PropOrSpread::Prop(prop_box) = prop { [INFO] [stdout] 358 | | if let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 359 | | let key = match &key_value.key { [INFO] [stdout] 360 | | PropName::Ident(ident) => ident.sym.to_string(), [INFO] [stdout] ... | [INFO] [stdout] 369 | | } [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] 357 ~ if let PropOrSpread::Prop(prop_box) = prop [INFO] [stdout] 358 ~ && let Prop::KeyValue(key_value) = &**prop_box { [INFO] [stdout] 359 | let key = match &key_value.key { [INFO] [stdout] ... [INFO] [stdout] 367 | } [INFO] [stdout] 368 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to want to iterate on a map's keys [INFO] [stdout] --> src/mapping/validation.rs:316:40 [INFO] [stdout] | [INFO] [stdout] 316 | for (source_field, _field_info) in &source_schema.fields { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#for_kv_map [INFO] [stdout] = note: `#[warn(clippy::for_kv_map)]` on by default [INFO] [stdout] help: use the corresponding method [INFO] [stdout] | [INFO] [stdout] 316 - for (source_field, _field_info) in &source_schema.fields { [INFO] [stdout] 316 + for source_field in source_schema.fields.keys() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `collection_path` after checking its variant with `is_some` [INFO] [stdout] --> src/mapping/mod.rs:85:32 [INFO] [stdout] | [INFO] [stdout] 84 | let target_fields = if target == "payload" && collection_path.is_some() { [INFO] [stdout] | ------------------------- the check is happening here [INFO] [stdout] 85 | extract_payload_fields(collection_path.unwrap())? [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [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: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:313:17 [INFO] [stdout] | [INFO] [stdout] 313 | / if line.contains("name:") && line.contains("type:") { [INFO] [stdout] 314 | | if let Some(name_start) = line.find("name:") { [INFO] [stdout] 315 | | let name_part = &line[name_start + 5..]; [INFO] [stdout] 316 | | if let Some(quote_start) = name_part.find('\'') { [INFO] [stdout] ... | [INFO] [stdout] 328 | | } [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] 313 ~ if line.contains("name:") && line.contains("type:") [INFO] [stdout] 314 ~ && let Some(name_start) = line.find("name:") { [INFO] [stdout] 315 | let name_part = &line[name_start + 5..]; [INFO] [stdout] ... [INFO] [stdout] 326 | } [INFO] [stdout] 327 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:321:32 [INFO] [stdout] | [INFO] [stdout] 321 | } else if let Some(quote_start) = name_part.find('"') { [INFO] [stdout] | ________________________________^ [INFO] [stdout] 322 | | if let Some(quote_end) = name_part[quote_start + 1..].find('"') { [INFO] [stdout] 323 | | let field_name = &name_part[quote_start + 1..quote_start + 1 + quote_end]; [INFO] [stdout] 324 | | fields.push(field_name.to_string()); [INFO] [stdout] 325 | | } [INFO] [stdout] 326 | | } [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] 321 ~ } else if let Some(quote_start) = name_part.find('"') [INFO] [stdout] 322 ~ && let Some(quote_end) = name_part[quote_start + 1..].find('"') { [INFO] [stdout] 323 | let field_name = &name_part[quote_start + 1..quote_start + 1 + quote_end]; [INFO] [stdout] 324 | fields.push(field_name.to_string()); [INFO] [stdout] 325 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `fallback` after checking its variant with `is_some` [INFO] [stdout] --> src/mapping/mod.rs:545:37 [INFO] [stdout] | [INFO] [stdout] 544 | let fallback_info = if fallback.is_some() { [INFO] [stdout] | --------------------- help: try: `if let Some() = &fallback` [INFO] [stdout] 545 | format!("fallback: {}", fallback.as_ref().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] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/mapping/mod.rs:434:67 [INFO] [stdout] | [INFO] [stdout] 434 | if source.to_lowercase() == target.to_lowercase() { [INFO] [stdout] | ___________________________________________________________________^ [INFO] [stdout] 435 | | suggestions.push(source.clone()); [INFO] [stdout] 436 | | } else if source.to_lowercase().contains(&target.to_lowercase()) { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/mapping/mod.rs:436:82 [INFO] [stdout] | [INFO] [stdout] 436 | } else if source.to_lowercase().contains(&target.to_lowercase()) { [INFO] [stdout] | __________________________________________________________________________________^ [INFO] [stdout] 437 | | suggestions.push(source.clone()); [INFO] [stdout] 438 | | } else if target.to_lowercase().contains(&source.to_lowercase()) { [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/mapping/mod.rs:436:82 [INFO] [stdout] | [INFO] [stdout] 436 | } else if source.to_lowercase().contains(&target.to_lowercase()) { [INFO] [stdout] | __________________________________________________________________________________^ [INFO] [stdout] 437 | | suggestions.push(source.clone()); [INFO] [stdout] 438 | | } else if target.to_lowercase().contains(&source.to_lowercase()) { [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/mapping/mod.rs:438:82 [INFO] [stdout] | [INFO] [stdout] 438 | } else if target.to_lowercase().contains(&source.to_lowercase()) { [INFO] [stdout] | __________________________________________________________________________________^ [INFO] [stdout] 439 | | suggestions.push(source.clone()); [INFO] [stdout] 440 | | } [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/mapping/mod.rs:454:53 [INFO] [stdout] | [INFO] [stdout] 454 | ... display_progress_table(&completed_mappings, &target_fields, current_field, total_fields, collection_name, collection_progress); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `target_fields` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/mapping/mod.rs:502:86 [INFO] [stdout] | [INFO] [stdout] 502 | let combine_result = handle_combine_coordinates(selected_source, &source_fields)?; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `source_fields` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `source_data.get(0)` [INFO] [stdout] --> src/mapping/mod.rs:579:61 [INFO] [stdout] | [INFO] [stdout] 579 | ... dlog_processing!("Source data structure: {:?}", source_data.get(0).and_then(|d| d.as_object()).map(|obj| obj.keys().collect::... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `source_data.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:606:9 [INFO] [stdout] | [INFO] [stdout] 606 | / if let Some(acf_field) = doc.get("acf") { [INFO] [stdout] 607 | | if let Some(flexible_content) = acf_field.get("flexible_content") { [INFO] [stdout] 608 | | if let Some(flexible_array) = flexible_content.as_array() { [INFO] [stdout] 609 | | for block_data in flexible_array { [INFO] [stdout] ... | [INFO] [stdout] 621 | | } [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] 606 ~ if let Some(acf_field) = doc.get("acf") [INFO] [stdout] 607 ~ && let Some(flexible_content) = acf_field.get("flexible_content") { [INFO] [stdout] 608 | if let Some(flexible_array) = flexible_content.as_array() { [INFO] [stdout] ... [INFO] [stdout] 619 | } [INFO] [stdout] 620 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:607:13 [INFO] [stdout] | [INFO] [stdout] 607 | / if let Some(flexible_content) = acf_field.get("flexible_content") { [INFO] [stdout] 608 | | if let Some(flexible_array) = flexible_content.as_array() { [INFO] [stdout] 609 | | for block_data in flexible_array { [INFO] [stdout] 610 | | if let Some(layout) = block_data.get("acf_fc_layout") { [INFO] [stdout] ... | [INFO] [stdout] 620 | | } [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] 607 ~ if let Some(flexible_content) = acf_field.get("flexible_content") [INFO] [stdout] 608 ~ && let Some(flexible_array) = flexible_content.as_array() { [INFO] [stdout] 609 | for block_data in flexible_array { [INFO] [stdout] ... [INFO] [stdout] 618 | } [INFO] [stdout] 619 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:610:25 [INFO] [stdout] | [INFO] [stdout] 610 | / if let Some(layout) = block_data.get("acf_fc_layout") { [INFO] [stdout] 611 | | if let Some(layout_str) = layout.as_str() { [INFO] [stdout] 612 | | blocks.push(crate::mapping::json_mapping::ACFFlexibleContentBlock { [INFO] [stdout] 613 | | acf_fc_layout: layout_str.to_string(), [INFO] [stdout] ... | [INFO] [stdout] 617 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 610 ~ if let Some(layout) = block_data.get("acf_fc_layout") [INFO] [stdout] 611 ~ && let Some(layout_str) = layout.as_str() { [INFO] [stdout] 612 | blocks.push(crate::mapping::json_mapping::ACFFlexibleContentBlock { [INFO] [stdout] ... [INFO] [stdout] 615 | }); [INFO] [stdout] 616 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/mapping/mod.rs:754:44 [INFO] [stdout] | [INFO] [stdout] 754 | let block_target_fields: Vec = target_fields [INFO] [stdout] | ____________________________________________^ [INFO] [stdout] 755 | | .iter() [INFO] [stdout] 756 | | .filter(|field| field.starts_with(&format!("blocks.{}.", payload_block_type))) [INFO] [stdout] 757 | | .map(|field| field.clone()) [INFO] [stdout] | |___________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] help: consider calling the dedicated `cloned` method [INFO] [stdout] | [INFO] [stdout] 754 ~ let block_target_fields: Vec = target_fields [INFO] [stdout] 755 + .iter() [INFO] [stdout] 756 + .filter(|field| field.starts_with(&format!("blocks.{}.", payload_block_type))).cloned() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:767:9 [INFO] [stdout] | [INFO] [stdout] 767 | / if let Some(acf_field) = doc.get("acf") { [INFO] [stdout] 768 | | if let Some(flexible_content) = acf_field.get("flexible_content") { [INFO] [stdout] 769 | | if let Some(flexible_array) = flexible_content.as_array() { [INFO] [stdout] 770 | | for block_data in flexible_array { [INFO] [stdout] ... | [INFO] [stdout] 788 | | } [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] 767 ~ if let Some(acf_field) = doc.get("acf") [INFO] [stdout] 768 ~ && let Some(flexible_content) = acf_field.get("flexible_content") { [INFO] [stdout] 769 | if let Some(flexible_array) = flexible_content.as_array() { [INFO] [stdout] ... [INFO] [stdout] 786 | } [INFO] [stdout] 787 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:768:13 [INFO] [stdout] | [INFO] [stdout] 768 | / if let Some(flexible_content) = acf_field.get("flexible_content") { [INFO] [stdout] 769 | | if let Some(flexible_array) = flexible_content.as_array() { [INFO] [stdout] 770 | | for block_data in flexible_array { [INFO] [stdout] 771 | | if let Some(layout) = block_data.get("acf_fc_layout") { [INFO] [stdout] ... | [INFO] [stdout] 787 | | } [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] 768 ~ if let Some(flexible_content) = acf_field.get("flexible_content") [INFO] [stdout] 769 ~ && let Some(flexible_array) = flexible_content.as_array() { [INFO] [stdout] 770 | for block_data in flexible_array { [INFO] [stdout] ... [INFO] [stdout] 785 | } [INFO] [stdout] 786 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:771:25 [INFO] [stdout] | [INFO] [stdout] 771 | / if let Some(layout) = block_data.get("acf_fc_layout") { [INFO] [stdout] 772 | | if let Some(layout_str) = layout.as_str() { [INFO] [stdout] 773 | | if layout_str == acf_layout { [INFO] [stdout] ... | [INFO] [stdout] 784 | | } [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] 771 ~ if let Some(layout) = block_data.get("acf_fc_layout") [INFO] [stdout] 772 ~ && let Some(layout_str) = layout.as_str() { [INFO] [stdout] 773 | if layout_str == acf_layout { [INFO] [stdout] ... [INFO] [stdout] 782 | } [INFO] [stdout] 783 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:772:29 [INFO] [stdout] | [INFO] [stdout] 772 | / ... if let Some(layout_str) = layout.as_str() { [INFO] [stdout] 773 | | ... if layout_str == acf_layout { [INFO] [stdout] 774 | | ... // Extract field names from this block [INFO] [stdout] 775 | | ... if let Some(obj) = block_data.as_object() { [INFO] [stdout] ... | [INFO] [stdout] 783 | | ... } [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] 772 ~ if let Some(layout_str) = layout.as_str() [INFO] [stdout] 773 ~ && layout_str == acf_layout { [INFO] [stdout] 774 | // Extract field names from this block [INFO] [stdout] ... [INFO] [stdout] 781 | } [INFO] [stdout] 782 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/mapping/mod.rs:809:26 [INFO] [stdout] | [INFO] [stdout] 809 | let field_name = target_field.split('.').last().unwrap_or(target_field); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 809 - let field_name = target_field.split('.').last().unwrap_or(target_field); [INFO] [stdout] 809 + let field_name = target_field.split('.').next_back().unwrap_or(target_field); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/mapping/mod.rs:816:67 [INFO] [stdout] | [INFO] [stdout] 816 | if source.to_lowercase() == field_name.to_lowercase() { [INFO] [stdout] | ___________________________________________________________________^ [INFO] [stdout] 817 | | suggestions.push(source.clone()); [INFO] [stdout] 818 | | } else if source.to_lowercase().contains(&field_name.to_lowercase()) { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/mapping/mod.rs:818:82 [INFO] [stdout] | [INFO] [stdout] 818 | } else if source.to_lowercase().contains(&field_name.to_lowercase()) { [INFO] [stdout] | __________________________________________________________________________________^ [INFO] [stdout] 819 | | suggestions.push(source.clone()); [INFO] [stdout] 820 | | } else if field_name.to_lowercase().contains(&source.to_lowercase()) { [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/mapping/mod.rs:818:82 [INFO] [stdout] | [INFO] [stdout] 818 | } else if source.to_lowercase().contains(&field_name.to_lowercase()) { [INFO] [stdout] | __________________________________________________________________________________^ [INFO] [stdout] 819 | | suggestions.push(source.clone()); [INFO] [stdout] 820 | | } else if field_name.to_lowercase().contains(&source.to_lowercase()) { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/mapping/mod.rs:820:82 [INFO] [stdout] | [INFO] [stdout] 820 | } else if field_name.to_lowercase().contains(&source.to_lowercase()) { [INFO] [stdout] | __________________________________________________________________________________^ [INFO] [stdout] 821 | | suggestions.push(source.clone()); [INFO] [stdout] 822 | | } [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/parser/ast_analyzer.rs:125:9 [INFO] [stdout] | [INFO] [stdout] 125 | / match stmt { [INFO] [stdout] 126 | | Stmt::Decl(decl) => match decl { [INFO] [stdout] 127 | | Decl::Var(var_decl) => { [INFO] [stdout] 128 | | for declarator in &var_decl.decls { [INFO] [stdout] ... | [INFO] [stdout] 146 | | _ => {} [INFO] [stdout] 147 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 125 ~ if let Stmt::Decl(decl) = stmt { match decl { [INFO] [stdout] 126 + Decl::Var(var_decl) => { [INFO] [stdout] 127 + for declarator in &var_decl.decls { [INFO] [stdout] 128 + self.analyze_var_declarator(declarator)?; [INFO] [stdout] 129 + } [INFO] [stdout] 130 + } [INFO] [stdout] 131 + Decl::Fn(fn_decl) => { [INFO] [stdout] 132 + let name = fn_decl.ident.sym.to_string(); [INFO] [stdout] 133 + dlog_info!("Found function declaration: {}", name); [INFO] [stdout] 134 + self.exports.insert(name.clone(), ExportedItem::Function( [INFO] [stdout] 135 + name, [INFO] [stdout] 136 + Module { [INFO] [stdout] 137 + span: Default::default(), [INFO] [stdout] 138 + body: vec![ModuleItem::Stmt(Stmt::Decl(Decl::Fn(fn_decl.clone())))], [INFO] [stdout] 139 + shebang: None, [INFO] [stdout] 140 + } [INFO] [stdout] 141 + )); [INFO] [stdout] 142 + } [INFO] [stdout] 143 + _ => {} [INFO] [stdout] 144 + } } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:1076:13 [INFO] [stdout] | [INFO] [stdout] 1076 | / if let Value::Object(nested_obj) = nested_result { [INFO] [stdout] 1077 | | if let Value::Object(main_obj) = &mut result { [INFO] [stdout] 1078 | | main_obj.extend(nested_obj); [INFO] [stdout] 1079 | | } [INFO] [stdout] 1080 | | } [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] 1076 ~ if let Value::Object(nested_obj) = nested_result [INFO] [stdout] 1077 ~ && let Value::Object(main_obj) = &mut result { [INFO] [stdout] 1078 | main_obj.extend(nested_obj); [INFO] [stdout] 1079 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:1087:17 [INFO] [stdout] | [INFO] [stdout] 1087 | / if let Some(fallback) = &field_mapping.fallback { [INFO] [stdout] 1088 | | if let Value::Object(main_obj) = &mut result { [INFO] [stdout] 1089 | | main_obj.insert(field_mapping.to.clone(), Value::String(fallback.clone())); [INFO] [stdout] 1090 | | } [INFO] [stdout] 1091 | | } [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] 1087 ~ if let Some(fallback) = &field_mapping.fallback [INFO] [stdout] 1088 ~ && let Value::Object(main_obj) = &mut result { [INFO] [stdout] 1089 | main_obj.insert(field_mapping.to.clone(), Value::String(fallback.clone())); [INFO] [stdout] 1090 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:1117:17 [INFO] [stdout] | [INFO] [stdout] 1117 | / if let Value::String(path_str) = path { [INFO] [stdout] 1118 | | if path_str.contains('.') || path_str.contains('[') { [INFO] [stdout] 1119 | | return Ok(Some(NestedPath::from_dot_notation(path_str)?)); [INFO] [stdout] 1120 | | } [INFO] [stdout] 1121 | | } [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] 1117 ~ if let Value::String(path_str) = path [INFO] [stdout] 1118 ~ && (path_str.contains('.') || path_str.contains('[')) { [INFO] [stdout] 1119 | return Ok(Some(NestedPath::from_dot_notation(path_str)?)); [INFO] [stdout] 1120 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:1141:17 [INFO] [stdout] | [INFO] [stdout] 1141 | / if let Value::String(p) = path { [INFO] [stdout] 1142 | | if let Some(v) = get_path(doc, p) { [INFO] [stdout] 1143 | | if !v.is_null() { [INFO] [stdout] 1144 | | result = v.clone(); [INFO] [stdout] ... | [INFO] [stdout] 1148 | | } [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] 1141 ~ if let Value::String(p) = path [INFO] [stdout] 1142 ~ && let Some(v) = get_path(doc, p) { [INFO] [stdout] 1143 | if !v.is_null() { [INFO] [stdout] ... [INFO] [stdout] 1146 | } [INFO] [stdout] 1147 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/mapping/mod.rs:1142:21 [INFO] [stdout] | [INFO] [stdout] 1142 | / if let Some(v) = get_path(doc, p) { [INFO] [stdout] 1143 | | if !v.is_null() { [INFO] [stdout] 1144 | | result = v.clone(); [INFO] [stdout] 1145 | | break; [INFO] [stdout] 1146 | | } [INFO] [stdout] 1147 | | } [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] 1142 ~ if let Some(v) = get_path(doc, p) [INFO] [stdout] 1143 ~ && !v.is_null() { [INFO] [stdout] 1144 | result = v.clone(); [INFO] [stdout] 1145 | break; [INFO] [stdout] 1146 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:244:29 [INFO] [stdout] | [INFO] [stdout] 244 | / ... if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 245 | | ... if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 246 | | ... if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 247 | | ... dlog_processing!(" - Property: {}", ident.sym); [INFO] [stdout] ... | [INFO] [stdout] 250 | | ... } [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] 244 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 245 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 246 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 247 | dlog_processing!(" - Property: {}", ident.sym); [INFO] [stdout] 248 | } [INFO] [stdout] 249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:245:33 [INFO] [stdout] | [INFO] [stdout] 245 | / ... if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 246 | | ... if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 247 | | ... dlog_processing!(" - Property: {}", ident.sym); [INFO] [stdout] 248 | | ... } [INFO] [stdout] 249 | | ... } [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] 245 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 246 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 247 | dlog_processing!(" - Property: {}", ident.sym); [INFO] [stdout] 248 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:351:13 [INFO] [stdout] | [INFO] [stdout] 351 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 352 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 353 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 354 | | match ident.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 362 | | } [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] 351 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 352 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 353 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 360 | } [INFO] [stdout] 361 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:352:17 [INFO] [stdout] | [INFO] [stdout] 352 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 353 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 354 | | match ident.sym.as_ref() { [INFO] [stdout] 355 | | "slug" => has_slug = true, [INFO] [stdout] ... | [INFO] [stdout] 361 | | } [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] 352 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 353 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 354 | match ident.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 359 | } [INFO] [stdout] 360 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:375:13 [INFO] [stdout] | [INFO] [stdout] 375 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 376 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 377 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 378 | | match ident.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 386 | | } [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] 375 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 376 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 377 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 384 | } [INFO] [stdout] 385 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:376:17 [INFO] [stdout] | [INFO] [stdout] 376 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 377 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 378 | | match ident.sym.as_ref() { [INFO] [stdout] 379 | | "slug" => has_slug = true, [INFO] [stdout] ... | [INFO] [stdout] 385 | | } [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] 376 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 377 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 378 | match ident.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 383 | } [INFO] [stdout] 384 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:398:21 [INFO] [stdout] | [INFO] [stdout] 398 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 399 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 400 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 401 | | if ident.sym == "labels" || ident.sym == "interfaceName" { [INFO] [stdout] ... | [INFO] [stdout] 406 | | } [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] 398 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 399 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 400 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 404 | } [INFO] [stdout] 405 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:399:25 [INFO] [stdout] | [INFO] [stdout] 399 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 400 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 401 | | if ident.sym == "labels" || ident.sym == "interfaceName" { [INFO] [stdout] 402 | | return false; // Has block properties, so it's a block [INFO] [stdout] ... | [INFO] [stdout] 405 | | } [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] 399 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 400 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 401 | if ident.sym == "labels" || ident.sym == "interfaceName" { [INFO] [stdout] 402 | return false; // Has block properties, so it's a block [INFO] [stdout] 403 | } [INFO] [stdout] 404 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:400:29 [INFO] [stdout] | [INFO] [stdout] 400 | / ... if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 401 | | ... if ident.sym == "labels" || ident.sym == "interfaceName" { [INFO] [stdout] 402 | | ... return false; // Has block properties, so it's a block [INFO] [stdout] 403 | | ... } [INFO] [stdout] 404 | | ... } [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] 400 ~ if let PropName::Ident(ident) = &kv.key [INFO] [stdout] 401 ~ && (ident.sym == "labels" || ident.sym == "interfaceName") { [INFO] [stdout] 402 | return false; // Has block properties, so it's a block [INFO] [stdout] 403 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:421:13 [INFO] [stdout] | [INFO] [stdout] 421 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 422 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 423 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 424 | | match ident.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 431 | | } [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] 421 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 422 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 423 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 429 | } [INFO] [stdout] 430 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:422:17 [INFO] [stdout] | [INFO] [stdout] 422 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 423 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 424 | | match ident.sym.as_ref() { [INFO] [stdout] 425 | | "name" => has_name = true, [INFO] [stdout] ... | [INFO] [stdout] 430 | | } [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] 422 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 423 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 424 | match ident.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 428 | } [INFO] [stdout] 429 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:444:13 [INFO] [stdout] | [INFO] [stdout] 444 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 445 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 446 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 447 | | if ident.sym == "type" { [INFO] [stdout] ... | [INFO] [stdout] 457 | | } [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] 444 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 445 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 446 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 455 | } [INFO] [stdout] 456 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:445:17 [INFO] [stdout] | [INFO] [stdout] 445 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 446 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 447 | | if ident.sym == "type" { [INFO] [stdout] 448 | | if let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 456 | | } [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] 445 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 446 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 447 | if ident.sym == "type" { [INFO] [stdout] ... [INFO] [stdout] 454 | } [INFO] [stdout] 455 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:446:21 [INFO] [stdout] | [INFO] [stdout] 446 | / if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 447 | | if ident.sym == "type" { [INFO] [stdout] 448 | | if let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] 449 | | if let Lit::Str(str_lit) = &lit { [INFO] [stdout] ... | [INFO] [stdout] 455 | | } [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] 446 ~ if let PropName::Ident(ident) = &kv.key [INFO] [stdout] 447 ~ && ident.sym == "type" { [INFO] [stdout] 448 | if let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] ... [INFO] [stdout] 453 | } [INFO] [stdout] 454 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:447:25 [INFO] [stdout] | [INFO] [stdout] 447 | / if ident.sym == "type" { [INFO] [stdout] 448 | | if let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] 449 | | if let Lit::Str(str_lit) = &lit { [INFO] [stdout] 450 | | field_type = str_lit.value.to_string(); [INFO] [stdout] ... | [INFO] [stdout] 454 | | } [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] 447 ~ if ident.sym == "type" [INFO] [stdout] 448 ~ && let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] 449 | if let Lit::Str(str_lit) = &lit { [INFO] [stdout] ... [INFO] [stdout] 452 | } [INFO] [stdout] 453 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/parser/ast_analyzer.rs:449:33 [INFO] [stdout] | [INFO] [stdout] 449 | / ... if let Lit::Str(str_lit) = &lit { [INFO] [stdout] 450 | | ... field_type = str_lit.value.to_string(); [INFO] [stdout] 451 | | ... dlog_processing!(" - Found field type: {}", field_type); [INFO] [stdout] 452 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/parser/ast_analyzer.rs:448:46 [INFO] [stdout] | [INFO] [stdout] 448 | ... if let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] | ^^^ ---------- use: `&*kv.value.as_ref()` [INFO] [stdout] | | [INFO] [stdout] | replace this binding [INFO] [stdout] 449 | ... if let Lit::Str(str_lit) = &lit { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ with this pattern [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] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:448:29 [INFO] [stdout] | [INFO] [stdout] 448 | / ... if let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] 449 | | ... if let Lit::Str(str_lit) = &lit { [INFO] [stdout] 450 | | ... field_type = str_lit.value.to_string(); [INFO] [stdout] 451 | | ... dlog_processing!(" - Found field type: {}", field_type); [INFO] [stdout] 452 | | ... } [INFO] [stdout] 453 | | ... } [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] 448 ~ if let Expr::Lit(lit) = &*kv.value [INFO] [stdout] 449 ~ && let Lit::Str(str_lit) = &lit { [INFO] [stdout] 450 | field_type = str_lit.value.to_string(); [INFO] [stdout] 451 | dlog_processing!(" - Found field type: {}", field_type); [INFO] [stdout] 452 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:463:17 [INFO] [stdout] | [INFO] [stdout] 463 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 464 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 465 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 466 | | if ident.sym == "fields" { [INFO] [stdout] ... | [INFO] [stdout] 489 | | } [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] 463 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 464 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 465 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 487 | } [INFO] [stdout] 488 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:464:21 [INFO] [stdout] | [INFO] [stdout] 464 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 465 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 466 | | if ident.sym == "fields" { [INFO] [stdout] 467 | | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 488 | | } [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] 464 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 465 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 466 | if ident.sym == "fields" { [INFO] [stdout] ... [INFO] [stdout] 486 | } [INFO] [stdout] 487 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:465:25 [INFO] [stdout] | [INFO] [stdout] 465 | / if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 466 | | if ident.sym == "fields" { [INFO] [stdout] 467 | | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 468 | | dlog_processing!(" - Extracting fields from group field: {}", name); [INFO] [stdout] ... | [INFO] [stdout] 487 | | } [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] 465 ~ if let PropName::Ident(ident) = &kv.key [INFO] [stdout] 466 ~ && ident.sym == "fields" { [INFO] [stdout] 467 | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... [INFO] [stdout] 485 | } [INFO] [stdout] 486 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:466:29 [INFO] [stdout] | [INFO] [stdout] 466 | / ... if ident.sym == "fields" { [INFO] [stdout] 467 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 468 | | ... dlog_processing!(" - Extracting fields from group field: {}", name); [INFO] [stdout] 469 | | ... let group_fields = self.extract_fields_from_array(arr)?; [INFO] [stdout] ... | [INFO] [stdout] 486 | | ... } [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] 466 ~ if ident.sym == "fields" [INFO] [stdout] 467 ~ && let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 468 | dlog_processing!(" - Extracting fields from group field: {}", name); [INFO] [stdout] ... [INFO] [stdout] 484 | } [INFO] [stdout] 485 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:526:13 [INFO] [stdout] | [INFO] [stdout] 526 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 527 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 528 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 529 | | match ident.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 550 | | } [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] 526 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 527 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 528 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 548 | } [INFO] [stdout] 549 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:527:17 [INFO] [stdout] | [INFO] [stdout] 527 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 528 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 529 | | match ident.sym.as_ref() { [INFO] [stdout] 530 | | "fields" => { [INFO] [stdout] ... | [INFO] [stdout] 549 | | } [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] 527 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 528 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 529 | match ident.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 547 | } [INFO] [stdout] 548 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:565:13 [INFO] [stdout] | [INFO] [stdout] 565 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 566 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 567 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 568 | | match ident.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 609 | | } [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] 565 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 566 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 567 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 607 | } [INFO] [stdout] 608 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:566:17 [INFO] [stdout] | [INFO] [stdout] 566 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 567 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 568 | | match ident.sym.as_ref() { [INFO] [stdout] 569 | | "slug" => { [INFO] [stdout] ... | [INFO] [stdout] 608 | | } [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] 566 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 567 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 568 | match ident.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 606 | } [INFO] [stdout] 607 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/parser/ast_analyzer.rs:571:37 [INFO] [stdout] | [INFO] [stdout] 571 | / ... if let Lit::Str(str_lit) = &lit { [INFO] [stdout] 572 | | ... slug = str_lit.value.to_string(); [INFO] [stdout] 573 | | ... dlog_processing!(" - Found block slug: {}", slug); [INFO] [stdout] 574 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/parser/ast_analyzer.rs:570:50 [INFO] [stdout] | [INFO] [stdout] 570 | ... if let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] | ^^^ ---------- use: `&*kv.value.as_ref()` [INFO] [stdout] | | [INFO] [stdout] | replace this binding [INFO] [stdout] 571 | ... if let Lit::Str(str_lit) = &lit { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:570:33 [INFO] [stdout] | [INFO] [stdout] 570 | / ... if let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] 571 | | ... if let Lit::Str(str_lit) = &lit { [INFO] [stdout] 572 | | ... slug = str_lit.value.to_string(); [INFO] [stdout] 573 | | ... dlog_processing!(" - Found block slug: {}", slug); [INFO] [stdout] 574 | | ... } [INFO] [stdout] 575 | | ... } [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] 570 ~ if let Expr::Lit(lit) = &*kv.value [INFO] [stdout] 571 ~ && let Lit::Str(str_lit) = &lit { [INFO] [stdout] 572 | slug = str_lit.value.to_string(); [INFO] [stdout] 573 | dlog_processing!(" - Found block slug: {}", slug); [INFO] [stdout] 574 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:587:41 [INFO] [stdout] | [INFO] [stdout] 587 | / ... if let PropOrSpread::Prop(label_prop) = label_prop { [INFO] [stdout] 588 | | ... if let Prop::KeyValue(label_kv) = &**label_prop { [INFO] [stdout] 589 | | ... if let PropName::Ident(label_ident) = &label_kv.key { [INFO] [stdout] 590 | | ... if let Expr::Lit(label_lit) = &*label_kv.value { [INFO] [stdout] ... | [INFO] [stdout] 601 | | ... } [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] 587 ~ if let PropOrSpread::Prop(label_prop) = label_prop [INFO] [stdout] 588 ~ && let Prop::KeyValue(label_kv) = &**label_prop { [INFO] [stdout] 589 | if let PropName::Ident(label_ident) = &label_kv.key { [INFO] [stdout] ... [INFO] [stdout] 599 | } [INFO] [stdout] 600 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:588:45 [INFO] [stdout] | [INFO] [stdout] 588 | / ... if let Prop::KeyValue(label_kv) = &**label_prop { [INFO] [stdout] 589 | | ... if let PropName::Ident(label_ident) = &label_kv.key { [INFO] [stdout] 590 | | ... if let Expr::Lit(label_lit) = &*label_kv.value { [INFO] [stdout] 591 | | ... if let Lit::Str(label_str) = &label_lit { [INFO] [stdout] ... | [INFO] [stdout] 600 | | ... } [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] 588 ~ if let Prop::KeyValue(label_kv) = &**label_prop [INFO] [stdout] 589 ~ && let PropName::Ident(label_ident) = &label_kv.key { [INFO] [stdout] 590 | if let Expr::Lit(label_lit) = &*label_kv.value { [INFO] [stdout] ... [INFO] [stdout] 598 | } [INFO] [stdout] 599 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:589:49 [INFO] [stdout] | [INFO] [stdout] 589 | / ... if let PropName::Ident(label_ident) = &label_kv.key { [INFO] [stdout] 590 | | ... if let Expr::Lit(label_lit) = &*label_kv.value { [INFO] [stdout] 591 | | ... if let Lit::Str(label_str) = &label_lit { [INFO] [stdout] 592 | | ... match label_ident.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 599 | | ... } [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] 589 ~ if let PropName::Ident(label_ident) = &label_kv.key [INFO] [stdout] 590 ~ && let Expr::Lit(label_lit) = &*label_kv.value { [INFO] [stdout] 591 | if let Lit::Str(label_str) = &label_lit { [INFO] [stdout] ... [INFO] [stdout] 597 | } [INFO] [stdout] 598 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/parser/ast_analyzer.rs:591:57 [INFO] [stdout] | [INFO] [stdout] 591 | / ... if let Lit::Str(label_str) = &label_lit { [INFO] [stdout] 592 | | ... match label_ident.sym.as_ref() { [INFO] [stdout] 593 | | ... "singular" => labels.singular = Some(label_str.value.to_string()), [INFO] [stdout] 594 | | ... "plural" => labels.plural = Some(label_str.value.to_string()), [INFO] [stdout] ... | [INFO] [stdout] 597 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/parser/ast_analyzer.rs:590:70 [INFO] [stdout] | [INFO] [stdout] 590 | ... if let Expr::Lit(label_lit) = &*label_kv.value { [INFO] [stdout] | ^^^^^^^^^ ---------------- use: `&*label_kv.value.as_ref()` [INFO] [stdout] | | [INFO] [stdout] | replace this binding [INFO] [stdout] 591 | ... if let Lit::Str(label_str) = &label_lit { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:590:53 [INFO] [stdout] | [INFO] [stdout] 590 | / ... if let Expr::Lit(label_lit) = &*label_kv.value { [INFO] [stdout] 591 | | ... if let Lit::Str(label_str) = &label_lit { [INFO] [stdout] 592 | | ... match label_ident.sym.as_ref() { [INFO] [stdout] 593 | | ... "singular" => labels.singular = Some(label_str.value.to_string()), [INFO] [stdout] ... | [INFO] [stdout] 598 | | ... } [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] 590 ~ if let Expr::Lit(label_lit) = &*label_kv.value [INFO] [stdout] 591 ~ && let Lit::Str(label_str) = &label_lit { [INFO] [stdout] 592 | match label_ident.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 596 | } [INFO] [stdout] 597 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/parser/ast_analyzer.rs:625:13 [INFO] [stdout] | [INFO] [stdout] 625 | / match elem { [INFO] [stdout] 626 | | Some(elem) => { [INFO] [stdout] 627 | | if elem.spread.is_some() { [INFO] [stdout] ... | [INFO] [stdout] 682 | | None => {} [INFO] [stdout] 683 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 625 ~ if let Some(elem) = elem { [INFO] [stdout] 626 + if elem.spread.is_some() { [INFO] [stdout] 627 + // Handle spread element [INFO] [stdout] 628 + match &*elem.expr { [INFO] [stdout] 629 + Expr::Call(call) => { [INFO] [stdout] 630 + let func_name = self.extract_call_name(call); [INFO] [stdout] 631 + dlog_processing!(" - Spread call {}: ...{}()", i, func_name); [INFO] [stdout] 632 + fields.push(FieldDefinition { [INFO] [stdout] 633 + name: format!("__spread__call__{}", func_name), [INFO] [stdout] 634 + field_type: FieldType::Text { min_length: None, max_length: None }, [INFO] [stdout] 635 + required: false, [INFO] [stdout] 636 + default_value: None, [INFO] [stdout] 637 + label: None, [INFO] [stdout] 638 + admin: None, [INFO] [stdout] 639 + source_location: SourceLocation::default(), [INFO] [stdout] 640 + }); [INFO] [stdout] 641 + } [INFO] [stdout] 642 + Expr::Ident(ident) => { [INFO] [stdout] 643 + dlog_processing!(" - Spread {}: ...{}", i, ident.sym); [INFO] [stdout] 644 + fields.push(FieldDefinition { [INFO] [stdout] 645 + name: format!("__spread__{}", ident.sym), [INFO] [stdout] 646 + field_type: FieldType::Text { min_length: None, max_length: None }, [INFO] [stdout] 647 + required: false, [INFO] [stdout] 648 + default_value: None, [INFO] [stdout] 649 + label: None, [INFO] [stdout] 650 + admin: None, [INFO] [stdout] 651 + source_location: SourceLocation::default(), [INFO] [stdout] 652 + }); [INFO] [stdout] 653 + } [INFO] [stdout] 654 + _ => {} [INFO] [stdout] 655 + } [INFO] [stdout] 656 + } else { [INFO] [stdout] 657 + // Regular element [INFO] [stdout] 658 + match &*elem.expr { [INFO] [stdout] 659 + Expr::Object(obj) => { [INFO] [stdout] 660 + if let Some(field) = self.extract_field_from_object(obj)? { [INFO] [stdout] 661 + dlog_processing!(" - Field {}: {}", i, field.name); [INFO] [stdout] 662 + fields.push(field); [INFO] [stdout] 663 + } [INFO] [stdout] 664 + } [INFO] [stdout] 665 + Expr::Ident(ident) => { [INFO] [stdout] 666 + dlog_processing!(" - Reference {}: {}", i, ident.sym); [INFO] [stdout] 667 + fields.push(FieldDefinition { [INFO] [stdout] 668 + name: format!("__ref__{}", ident.sym), [INFO] [stdout] 669 + field_type: FieldType::Text { min_length: None, max_length: None }, [INFO] [stdout] 670 + required: false, [INFO] [stdout] 671 + default_value: None, [INFO] [stdout] 672 + label: None, [INFO] [stdout] 673 + admin: None, [INFO] [stdout] 674 + source_location: SourceLocation::default(), [INFO] [stdout] 675 + }); [INFO] [stdout] 676 + } [INFO] [stdout] 677 + _ => {} [INFO] [stdout] 678 + } [INFO] [stdout] 679 + } [INFO] [stdout] 680 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:704:13 [INFO] [stdout] | [INFO] [stdout] 704 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 705 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 706 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 707 | | match key.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 742 | | } [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] 704 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 705 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 706 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 740 | } [INFO] [stdout] 741 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:705:17 [INFO] [stdout] | [INFO] [stdout] 705 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 706 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 707 | | match key.sym.as_ref() { [INFO] [stdout] 708 | | "name" => { [INFO] [stdout] ... | [INFO] [stdout] 741 | | } [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] 705 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 706 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 707 | match key.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 739 | } [INFO] [stdout] 740 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/parser/ast_analyzer.rs:731:79 [INFO] [stdout] | [INFO] [stdout] 731 | ... field.default_value = self.extract_json_value(&*kv.value); [INFO] [stdout] | ^^^^^^^^^^ help: try: `&kv.value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:761:13 [INFO] [stdout] | [INFO] [stdout] 761 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 762 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 763 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 764 | | match key.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 784 | | } [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] 761 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 762 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 763 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 782 | } [INFO] [stdout] 783 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:762:17 [INFO] [stdout] | [INFO] [stdout] 762 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 763 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 764 | | match key.sym.as_ref() { [INFO] [stdout] 765 | | "position" => { [INFO] [stdout] ... | [INFO] [stdout] 783 | | } [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] 762 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 763 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 764 | match key.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 781 | } [INFO] [stdout] 782 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:797:21 [INFO] [stdout] | [INFO] [stdout] 797 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 798 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 799 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 800 | | match key.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 815 | | } [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] 797 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 798 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 799 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 813 | } [INFO] [stdout] 814 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:798:25 [INFO] [stdout] | [INFO] [stdout] 798 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 799 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 800 | | match key.sym.as_ref() { [INFO] [stdout] 801 | | "minLength" => { [INFO] [stdout] ... | [INFO] [stdout] 814 | | } [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] 798 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 799 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 800 | match key.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 812 | } [INFO] [stdout] 813 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:826:21 [INFO] [stdout] | [INFO] [stdout] 826 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 827 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 828 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 829 | | if key.sym == "options" { [INFO] [stdout] ... | [INFO] [stdout] 836 | | } [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] 826 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 827 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 828 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 834 | } [INFO] [stdout] 835 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:827:25 [INFO] [stdout] | [INFO] [stdout] 827 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 828 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 829 | | if key.sym == "options" { [INFO] [stdout] 830 | | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 835 | | } [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] 827 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 828 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 829 | if key.sym == "options" { [INFO] [stdout] ... [INFO] [stdout] 833 | } [INFO] [stdout] 834 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:828:29 [INFO] [stdout] | [INFO] [stdout] 828 | / ... if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 829 | | ... if key.sym == "options" { [INFO] [stdout] 830 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 831 | | ... options = self.extract_select_options(arr)?; [INFO] [stdout] ... | [INFO] [stdout] 834 | | ... } [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] 828 ~ if let PropName::Ident(key) = &kv.key [INFO] [stdout] 829 ~ && key.sym == "options" { [INFO] [stdout] 830 | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 831 | options = self.extract_select_options(arr)?; [INFO] [stdout] 832 | } [INFO] [stdout] 833 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:829:33 [INFO] [stdout] | [INFO] [stdout] 829 | / ... if key.sym == "options" { [INFO] [stdout] 830 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 831 | | ... options = self.extract_select_options(arr)?; [INFO] [stdout] 832 | | ... } [INFO] [stdout] 833 | | ... } [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] 829 ~ if key.sym == "options" [INFO] [stdout] 830 ~ && let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 831 | options = self.extract_select_options(arr)?; [INFO] [stdout] 832 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:843:21 [INFO] [stdout] | [INFO] [stdout] 843 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 844 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 845 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 846 | | if key.sym == "relationTo" { [INFO] [stdout] ... | [INFO] [stdout] 853 | | } [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] 843 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 844 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 845 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 851 | } [INFO] [stdout] 852 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:844:25 [INFO] [stdout] | [INFO] [stdout] 844 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 845 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 846 | | if key.sym == "relationTo" { [INFO] [stdout] 847 | | if let Expr::Lit(Lit::Str(s)) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 852 | | } [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] 844 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 845 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 846 | if key.sym == "relationTo" { [INFO] [stdout] ... [INFO] [stdout] 850 | } [INFO] [stdout] 851 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:845:29 [INFO] [stdout] | [INFO] [stdout] 845 | / ... if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 846 | | ... if key.sym == "relationTo" { [INFO] [stdout] 847 | | ... if let Expr::Lit(Lit::Str(s)) = &*kv.value { [INFO] [stdout] 848 | | ... relation_to = s.value.to_string(); [INFO] [stdout] ... | [INFO] [stdout] 851 | | ... } [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] 845 ~ if let PropName::Ident(key) = &kv.key [INFO] [stdout] 846 ~ && key.sym == "relationTo" { [INFO] [stdout] 847 | if let Expr::Lit(Lit::Str(s)) = &*kv.value { [INFO] [stdout] 848 | relation_to = s.value.to_string(); [INFO] [stdout] 849 | } [INFO] [stdout] 850 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:846:33 [INFO] [stdout] | [INFO] [stdout] 846 | / ... if key.sym == "relationTo" { [INFO] [stdout] 847 | | ... if let Expr::Lit(Lit::Str(s)) = &*kv.value { [INFO] [stdout] 848 | | ... relation_to = s.value.to_string(); [INFO] [stdout] 849 | | ... } [INFO] [stdout] 850 | | ... } [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] 846 ~ if key.sym == "relationTo" [INFO] [stdout] 847 ~ && let Expr::Lit(Lit::Str(s)) = &*kv.value { [INFO] [stdout] 848 | relation_to = s.value.to_string(); [INFO] [stdout] 849 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:860:21 [INFO] [stdout] | [INFO] [stdout] 860 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 861 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 862 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 863 | | if key.sym == "fields" { [INFO] [stdout] ... | [INFO] [stdout] 870 | | } [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] 860 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 861 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 862 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 868 | } [INFO] [stdout] 869 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:861:25 [INFO] [stdout] | [INFO] [stdout] 861 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 862 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 863 | | if key.sym == "fields" { [INFO] [stdout] 864 | | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 869 | | } [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] 861 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 862 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 863 | if key.sym == "fields" { [INFO] [stdout] ... [INFO] [stdout] 867 | } [INFO] [stdout] 868 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:862:29 [INFO] [stdout] | [INFO] [stdout] 862 | / ... if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 863 | | ... if key.sym == "fields" { [INFO] [stdout] 864 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 865 | | ... nested_fields = self.extract_fields_from_array(arr)?; [INFO] [stdout] ... | [INFO] [stdout] 868 | | ... } [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] 862 ~ if let PropName::Ident(key) = &kv.key [INFO] [stdout] 863 ~ && key.sym == "fields" { [INFO] [stdout] 864 | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 865 | nested_fields = self.extract_fields_from_array(arr)?; [INFO] [stdout] 866 | } [INFO] [stdout] 867 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:863:33 [INFO] [stdout] | [INFO] [stdout] 863 | / ... if key.sym == "fields" { [INFO] [stdout] 864 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 865 | | ... nested_fields = self.extract_fields_from_array(arr)?; [INFO] [stdout] 866 | | ... } [INFO] [stdout] 867 | | ... } [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] 863 ~ if key.sym == "fields" [INFO] [stdout] 864 ~ && let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 865 | nested_fields = self.extract_fields_from_array(arr)?; [INFO] [stdout] 866 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:877:21 [INFO] [stdout] | [INFO] [stdout] 877 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 878 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 879 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 880 | | if key.sym == "tabs" { [INFO] [stdout] ... | [INFO] [stdout] 887 | | } [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] 877 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 878 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 879 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 885 | } [INFO] [stdout] 886 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:878:25 [INFO] [stdout] | [INFO] [stdout] 878 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 879 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 880 | | if key.sym == "tabs" { [INFO] [stdout] 881 | | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 886 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 878 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 879 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 880 | if key.sym == "tabs" { [INFO] [stdout] ... [INFO] [stdout] 884 | } [INFO] [stdout] 885 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:879:29 [INFO] [stdout] | [INFO] [stdout] 879 | / ... if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 880 | | ... if key.sym == "tabs" { [INFO] [stdout] 881 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 882 | | ... tabs = self.extract_tabs_from_array(arr)?; [INFO] [stdout] ... | [INFO] [stdout] 885 | | ... } [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] 879 ~ if let PropName::Ident(key) = &kv.key [INFO] [stdout] 880 ~ && key.sym == "tabs" { [INFO] [stdout] 881 | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 882 | tabs = self.extract_tabs_from_array(arr)?; [INFO] [stdout] 883 | } [INFO] [stdout] 884 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:880:33 [INFO] [stdout] | [INFO] [stdout] 880 | / ... if key.sym == "tabs" { [INFO] [stdout] 881 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 882 | | ... tabs = self.extract_tabs_from_array(arr)?; [INFO] [stdout] 883 | | ... } [INFO] [stdout] 884 | | ... } [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] 880 ~ if key.sym == "tabs" [INFO] [stdout] 881 ~ && let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 882 | tabs = self.extract_tabs_from_array(arr)?; [INFO] [stdout] 883 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:894:21 [INFO] [stdout] | [INFO] [stdout] 894 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 895 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 896 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 897 | | if key.sym == "blocks" { [INFO] [stdout] ... | [INFO] [stdout] 904 | | } [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] 894 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 895 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 896 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 902 | } [INFO] [stdout] 903 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:895:25 [INFO] [stdout] | [INFO] [stdout] 895 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 896 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 897 | | if key.sym == "blocks" { [INFO] [stdout] 898 | | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 903 | | } [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] 895 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 896 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 897 | if key.sym == "blocks" { [INFO] [stdout] ... [INFO] [stdout] 901 | } [INFO] [stdout] 902 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:896:29 [INFO] [stdout] | [INFO] [stdout] 896 | / ... if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 897 | | ... if key.sym == "blocks" { [INFO] [stdout] 898 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 899 | | ... blocks = self.extract_block_names(arr)?; [INFO] [stdout] ... | [INFO] [stdout] 902 | | ... } [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] 896 ~ if let PropName::Ident(key) = &kv.key [INFO] [stdout] 897 ~ && key.sym == "blocks" { [INFO] [stdout] 898 | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 899 | blocks = self.extract_block_names(arr)?; [INFO] [stdout] 900 | } [INFO] [stdout] 901 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:897:33 [INFO] [stdout] | [INFO] [stdout] 897 | / ... if key.sym == "blocks" { [INFO] [stdout] 898 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 899 | | ... blocks = self.extract_block_names(arr)?; [INFO] [stdout] 900 | | ... } [INFO] [stdout] 901 | | ... } [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] 897 ~ if key.sym == "blocks" [INFO] [stdout] 898 ~ && let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 899 | blocks = self.extract_block_names(arr)?; [INFO] [stdout] 900 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:930:25 [INFO] [stdout] | [INFO] [stdout] 930 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 931 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 932 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 933 | | match key.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 948 | | } [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] 930 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 931 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 932 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 946 | } [INFO] [stdout] 947 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:931:29 [INFO] [stdout] | [INFO] [stdout] 931 | / ... if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 932 | | ... if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 933 | | ... match key.sym.as_ref() { [INFO] [stdout] 934 | | ... "label" => { [INFO] [stdout] ... | [INFO] [stdout] 947 | | ... } [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] 931 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 932 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 933 | match key.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 945 | } [INFO] [stdout] 946 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:994:21 [INFO] [stdout] | [INFO] [stdout] 994 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 995 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 996 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 997 | | match key.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 1017 | | } [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] 994 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 995 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 996 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 1015 | } [INFO] [stdout] 1016 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:995:25 [INFO] [stdout] | [INFO] [stdout] 995 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 996 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 997 | | match key.sym.as_ref() { [INFO] [stdout] 998 | | "label" => { [INFO] [stdout] ... | [INFO] [stdout] 1016 | | } [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] 995 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 996 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 997 | match key.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 1014 | } [INFO] [stdout] 1015 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:1048:21 [INFO] [stdout] | [INFO] [stdout] 1048 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 1049 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 1050 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 1051 | | if let Some(value) = self.extract_json_value(&*kv.value) { [INFO] [stdout] ... | [INFO] [stdout] 1056 | | } [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] 1048 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 1049 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 1050 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 1054 | } [INFO] [stdout] 1055 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:1049:25 [INFO] [stdout] | [INFO] [stdout] 1049 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 1050 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 1051 | | if let Some(value) = self.extract_json_value(&*kv.value) { [INFO] [stdout] 1052 | | map.insert(key.sym.to_string(), value); [INFO] [stdout] ... | [INFO] [stdout] 1055 | | } [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] 1049 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 1050 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 1051 | if let Some(value) = self.extract_json_value(&*kv.value) { [INFO] [stdout] 1052 | map.insert(key.sym.to_string(), value); [INFO] [stdout] 1053 | } [INFO] [stdout] 1054 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:1050:29 [INFO] [stdout] | [INFO] [stdout] 1050 | / ... if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 1051 | | ... if let Some(value) = self.extract_json_value(&*kv.value) { [INFO] [stdout] 1052 | | ... map.insert(key.sym.to_string(), value); [INFO] [stdout] 1053 | | ... } [INFO] [stdout] 1054 | | ... } [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] 1050 ~ if let PropName::Ident(key) = &kv.key [INFO] [stdout] 1051 ~ && let Some(value) = self.extract_json_value(&*kv.value) { [INFO] [stdout] 1052 | map.insert(key.sym.to_string(), value); [INFO] [stdout] 1053 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/parser/ast_analyzer.rs:1051:78 [INFO] [stdout] | [INFO] [stdout] 1051 | ... if let Some(value) = self.extract_json_value(&*kv.value) { [INFO] [stdout] | ^^^^^^^^^^ help: try: `&kv.value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/import_resolver.rs:229:32 [INFO] [stdout] | [INFO] [stdout] 229 | self.base_dir.join(&import_path[1..]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/import_resolver.rs:227:16 [INFO] [stdout] | [INFO] [stdout] 227 | } else if import_path.starts_with('/') { [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] 227 ~ } else if let Some() = import_path.strip_prefix('/') { [INFO] [stdout] 228 | // Absolute import from project root [INFO] [stdout] 229 ~ self.base_dir.join() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/parser/import_resolver.rs:247:9 [INFO] [stdout] | [INFO] [stdout] 247 | sorted_aliases.sort_by(|a, b| b.len().cmp(&a.len())); [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] 247 - sorted_aliases.sort_by(|a, b| b.len().cmp(&a.len())); [INFO] [stdout] 247 + sorted_aliases.sort_by_key(|b| std::cmp::Reverse(b.len())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/import_resolver.rs:532:13 [INFO] [stdout] | [INFO] [stdout] 532 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 533 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 534 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 535 | | match ident.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 542 | | } [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] 532 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 533 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 534 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 540 | } [INFO] [stdout] 541 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/import_resolver.rs:533:17 [INFO] [stdout] | [INFO] [stdout] 533 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 534 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 535 | | match ident.sym.as_ref() { [INFO] [stdout] 536 | | "name" => has_name = true, [INFO] [stdout] ... | [INFO] [stdout] 541 | | } [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] 533 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 534 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 535 | match ident.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 539 | } [INFO] [stdout] 540 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/import_resolver.rs:565:13 [INFO] [stdout] | [INFO] [stdout] 565 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 566 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 567 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 568 | | match key.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 611 | | } [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] 565 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 566 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 567 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 609 | } [INFO] [stdout] 610 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/import_resolver.rs:566:17 [INFO] [stdout] | [INFO] [stdout] 566 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 567 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 568 | | match key.sym.as_ref() { [INFO] [stdout] 569 | | "name" => { [INFO] [stdout] ... | [INFO] [stdout] 610 | | } [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] 566 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 567 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 568 | match key.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 608 | } [INFO] [stdout] 609 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/import_resolver.rs:593:40 [INFO] [stdout] | [INFO] [stdout] 593 | ... } else if let Expr::Lit(Lit::Bool(b)) = &*kv.value { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 594 | | ... if !b.value { [INFO] [stdout] 595 | | ... field.label = None; [INFO] [stdout] 596 | | ... } [INFO] [stdout] 597 | | ... } [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] 593 ~ } else if let Expr::Lit(Lit::Bool(b)) = &*kv.value [INFO] [stdout] 594 ~ && !b.value { [INFO] [stdout] 595 | field.label = None; [INFO] [stdout] 596 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/import_resolver.rs:601:33 [INFO] [stdout] | [INFO] [stdout] 601 | / ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 602 | | ... if let Ok(nested_fields) = self.extract_fields_from_array(arr) { [INFO] [stdout] 603 | | ... field.field_type = FieldType::Group { fields: nested_fields }; [INFO] [stdout] 604 | | ... } [INFO] [stdout] 605 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 601 ~ if let Expr::Array(arr) = &*kv.value [INFO] [stdout] 602 ~ && let Ok(nested_fields) = self.extract_fields_from_array(arr) { [INFO] [stdout] 603 | field.field_type = FieldType::Group { fields: nested_fields }; [INFO] [stdout] 604 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/parser/import_resolver.rs:623:9 [INFO] [stdout] | [INFO] [stdout] 623 | / for elem in &arr.elems { [INFO] [stdout] 624 | | if let Some(elem) = elem { [INFO] [stdout] 625 | | if let Expr::Object(obj) = &*elem.expr { [INFO] [stdout] 626 | | if let Ok(Some(field)) = self.extract_simple_field_from_object(obj) { [INFO] [stdout] ... | [INFO] [stdout] 642 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/parser/import_resolver.rs:624:13 [INFO] [stdout] | [INFO] [stdout] 624 | / if let Some(elem) = elem { [INFO] [stdout] 625 | | if let Expr::Object(obj) = &*elem.expr { [INFO] [stdout] 626 | | if let Ok(Some(field)) = self.extract_simple_field_from_object(obj) { [INFO] [stdout] 627 | | fields.push(field); [INFO] [stdout] ... | [INFO] [stdout] 641 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 623 ~ for elem in arr.elems.iter().flatten() { [INFO] [stdout] 624 + if let Expr::Object(obj) = &*elem.expr { [INFO] [stdout] 625 + if let Ok(Some(field)) = self.extract_simple_field_from_object(obj) { [INFO] [stdout] 626 + fields.push(field); [INFO] [stdout] 627 + } [INFO] [stdout] 628 + } else if let Expr::Ident(ident) = &*elem.expr { [INFO] [stdout] 629 + // Handle field references within the array [INFO] [stdout] 630 + fields.push(FieldDefinition { [INFO] [stdout] 631 + name: format!("__ref__{}", ident.sym), [INFO] [stdout] 632 + field_type: FieldType::Text { min_length: None, max_length: None }, [INFO] [stdout] 633 + required: false, [INFO] [stdout] 634 + default_value: None, [INFO] [stdout] 635 + label: None, [INFO] [stdout] 636 + admin: None, [INFO] [stdout] 637 + source_location: crate::parser::schema::SourceLocation::default(), [INFO] [stdout] 638 + }); [INFO] [stdout] 639 + } [INFO] [stdout] 640 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/import_resolver.rs:665:13 [INFO] [stdout] | [INFO] [stdout] 665 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 666 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 667 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 668 | | match key.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 703 | | } [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] 665 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 666 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 667 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 701 | } [INFO] [stdout] 702 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/import_resolver.rs:666:17 [INFO] [stdout] | [INFO] [stdout] 666 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 667 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 668 | | match key.sym.as_ref() { [INFO] [stdout] 669 | | "name" => { [INFO] [stdout] ... | [INFO] [stdout] 702 | | } [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] 666 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 667 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 668 | match key.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 700 | } [INFO] [stdout] 701 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/performance/mod.rs:227:28 [INFO] [stdout] | [INFO] [stdout] 227 | let memory_stats = self.get_memory_stats().unwrap_or_else(|_| MemoryStats { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 228 | | current_mb: 0.0, [INFO] [stdout] 229 | | peak_mb: 0.0, [INFO] [stdout] 230 | | available_mb: 1024.0, // Default to 1GB [INFO] [stdout] 231 | | total_mb: 2048.0, [INFO] [stdout] 232 | | usage_percentage: 0.0, [INFO] [stdout] 233 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 227 ~ let memory_stats = self.get_memory_stats().unwrap_or(MemoryStats { [INFO] [stdout] 228 + current_mb: 0.0, [INFO] [stdout] 229 + peak_mb: 0.0, [INFO] [stdout] 230 + available_mb: 1024.0, // Default to 1GB [INFO] [stdout] 231 + total_mb: 2048.0, [INFO] [stdout] 232 + usage_percentage: 0.0, [INFO] [stdout] 233 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/performance/mod.rs:312:28 [INFO] [stdout] | [INFO] [stdout] 312 | let memory_stats = self.get_memory_stats().unwrap_or_else(|_| MemoryStats { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 313 | | current_mb: 0.0, [INFO] [stdout] 314 | | peak_mb: 0.0, [INFO] [stdout] 315 | | available_mb: 0.0, [INFO] [stdout] 316 | | total_mb: 0.0, [INFO] [stdout] 317 | | usage_percentage: 0.0, [INFO] [stdout] 318 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 312 ~ let memory_stats = self.get_memory_stats().unwrap_or(MemoryStats { [INFO] [stdout] 313 + current_mb: 0.0, [INFO] [stdout] 314 + peak_mb: 0.0, [INFO] [stdout] 315 + available_mb: 0.0, [INFO] [stdout] 316 + total_mb: 0.0, [INFO] [stdout] 317 + usage_percentage: 0.0, [INFO] [stdout] 318 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `PluginManager` [INFO] [stdout] --> src/plugin.rs:44:5 [INFO] [stdout] | [INFO] [stdout] 44 | / pub fn new() -> Self { [INFO] [stdout] 45 | | PluginManager { [INFO] [stdout] 46 | | sources: HashMap::new(), [INFO] [stdout] 47 | | targets: HashMap::new(), [INFO] [stdout] ... | [INFO] [stdout] 50 | | } [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] 42 + impl Default for PluginManager { [INFO] [stdout] 43 + fn default() -> Self { [INFO] [stdout] 44 + Self::new() [INFO] [stdout] 45 + } [INFO] [stdout] 46 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/parser/ast_analyzer.rs:125:9 [INFO] [stdout] | [INFO] [stdout] 125 | / match stmt { [INFO] [stdout] 126 | | Stmt::Decl(decl) => match decl { [INFO] [stdout] 127 | | Decl::Var(var_decl) => { [INFO] [stdout] 128 | | for declarator in &var_decl.decls { [INFO] [stdout] ... | [INFO] [stdout] 146 | | _ => {} [INFO] [stdout] 147 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 125 ~ if let Stmt::Decl(decl) = stmt { match decl { [INFO] [stdout] 126 + Decl::Var(var_decl) => { [INFO] [stdout] 127 + for declarator in &var_decl.decls { [INFO] [stdout] 128 + self.analyze_var_declarator(declarator)?; [INFO] [stdout] 129 + } [INFO] [stdout] 130 + } [INFO] [stdout] 131 + Decl::Fn(fn_decl) => { [INFO] [stdout] 132 + let name = fn_decl.ident.sym.to_string(); [INFO] [stdout] 133 + dlog_info!("Found function declaration: {}", name); [INFO] [stdout] 134 + self.exports.insert(name.clone(), ExportedItem::Function( [INFO] [stdout] 135 + name, [INFO] [stdout] 136 + Module { [INFO] [stdout] 137 + span: Default::default(), [INFO] [stdout] 138 + body: vec![ModuleItem::Stmt(Stmt::Decl(Decl::Fn(fn_decl.clone())))], [INFO] [stdout] 139 + shebang: None, [INFO] [stdout] 140 + } [INFO] [stdout] 141 + )); [INFO] [stdout] 142 + } [INFO] [stdout] 143 + _ => {} [INFO] [stdout] 144 + } } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/plugin.rs:152:52 [INFO] [stdout] | [INFO] [stdout] 152 | pub fn get_source(&self, name: &str) -> Option<&Box> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&dyn SourceReader` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] = note: `#[warn(clippy::borrowed_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/plugin.rs:157:52 [INFO] [stdout] | [INFO] [stdout] 157 | pub fn get_target(&self, name: &str) -> Option<&Box> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&dyn TargetWriter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/umbraco.rs:57:17 [INFO] [stdout] | [INFO] [stdout] 57 | / if let Some(nested_arr) = value.get("contentData").and_then(|v| v.as_array()) { [INFO] [stdout] 58 | | if !nested_arr.is_empty() { [INFO] [stdout] 59 | | debug!("Found nested content in field: {}", key); [INFO] [stdout] ... | [INFO] [stdout] 75 | | } [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] 57 ~ if let Some(nested_arr) = value.get("contentData").and_then(|v| v.as_array()) [INFO] [stdout] 58 ~ && !nested_arr.is_empty() { [INFO] [stdout] 59 | debug!("Found nested content in field: {}", key); [INFO] [stdout] ... [INFO] [stdout] 73 | }); [INFO] [stdout] 74 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:244:29 [INFO] [stdout] | [INFO] [stdout] 244 | / ... if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 245 | | ... if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 246 | | ... if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 247 | | ... dlog_processing!(" - Property: {}", ident.sym); [INFO] [stdout] ... | [INFO] [stdout] 250 | | ... } [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] 244 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 245 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 246 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 247 | dlog_processing!(" - Property: {}", ident.sym); [INFO] [stdout] 248 | } [INFO] [stdout] 249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:245:33 [INFO] [stdout] | [INFO] [stdout] 245 | / ... if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 246 | | ... if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 247 | | ... dlog_processing!(" - Property: {}", ident.sym); [INFO] [stdout] 248 | | ... } [INFO] [stdout] 249 | | ... } [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] 245 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 246 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 247 | dlog_processing!(" - Property: {}", ident.sym); [INFO] [stdout] 248 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/umbraco.rs:110:17 [INFO] [stdout] | [INFO] [stdout] 110 | / if let Some(content_type) = value.get("contentType").and_then(|v| v.as_str()) { [INFO] [stdout] 111 | | if self.content_type_mappings.get(content_type) == Some(&"media".to_string()) { [INFO] [stdout] 112 | | debug!("Found media reference in field: {}", key); [INFO] [stdout] ... | [INFO] [stdout] 132 | | } [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] 110 ~ if let Some(content_type) = value.get("contentType").and_then(|v| v.as_str()) [INFO] [stdout] 111 ~ && self.content_type_mappings.get(content_type) == Some(&"media".to_string()) { [INFO] [stdout] 112 | debug!("Found media reference in field: {}", key); [INFO] [stdout] ... [INFO] [stdout] 130 | }); [INFO] [stdout] 131 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:351:13 [INFO] [stdout] | [INFO] [stdout] 351 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 352 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 353 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 354 | | match ident.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 362 | | } [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] 351 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 352 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 353 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 360 | } [INFO] [stdout] 361 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:352:17 [INFO] [stdout] | [INFO] [stdout] 352 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 353 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 354 | | match ident.sym.as_ref() { [INFO] [stdout] 355 | | "slug" => has_slug = true, [INFO] [stdout] ... | [INFO] [stdout] 361 | | } [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] 352 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 353 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 354 | match ident.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 359 | } [INFO] [stdout] 360 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/umbraco.rs:167:17 [INFO] [stdout] | [INFO] [stdout] 167 | / if let Some(content_type) = value.get("contentType").and_then(|v| v.as_str()) { [INFO] [stdout] 168 | | if self.content_type_mappings.get(content_type) == Some(&"link".to_string()) { [INFO] [stdout] 169 | | debug!("Found link in field: {}", key); [INFO] [stdout] ... | [INFO] [stdout] 185 | | } [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] 167 ~ if let Some(content_type) = value.get("contentType").and_then(|v| v.as_str()) [INFO] [stdout] 168 ~ && self.content_type_mappings.get(content_type) == Some(&"link".to_string()) { [INFO] [stdout] 169 | debug!("Found link in field: {}", key); [INFO] [stdout] ... [INFO] [stdout] 183 | }); [INFO] [stdout] 184 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:375:13 [INFO] [stdout] | [INFO] [stdout] 375 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 376 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 377 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 378 | | match ident.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 386 | | } [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] 375 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 376 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 377 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 384 | } [INFO] [stdout] 385 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:376:17 [INFO] [stdout] | [INFO] [stdout] 376 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 377 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 378 | | match ident.sym.as_ref() { [INFO] [stdout] 379 | | "slug" => has_slug = true, [INFO] [stdout] ... | [INFO] [stdout] 385 | | } [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] 376 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 377 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 378 | match ident.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 383 | } [INFO] [stdout] 384 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:398:21 [INFO] [stdout] | [INFO] [stdout] 398 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 399 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 400 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 401 | | if ident.sym == "labels" || ident.sym == "interfaceName" { [INFO] [stdout] ... | [INFO] [stdout] 406 | | } [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] 398 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 399 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 400 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 404 | } [INFO] [stdout] 405 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:399:25 [INFO] [stdout] | [INFO] [stdout] 399 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 400 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 401 | | if ident.sym == "labels" || ident.sym == "interfaceName" { [INFO] [stdout] 402 | | return false; // Has block properties, so it's a block [INFO] [stdout] ... | [INFO] [stdout] 405 | | } [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] 399 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 400 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 401 | if ident.sym == "labels" || ident.sym == "interfaceName" { [INFO] [stdout] 402 | return false; // Has block properties, so it's a block [INFO] [stdout] 403 | } [INFO] [stdout] 404 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:400:29 [INFO] [stdout] | [INFO] [stdout] 400 | / ... if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 401 | | ... if ident.sym == "labels" || ident.sym == "interfaceName" { [INFO] [stdout] 402 | | ... return false; // Has block properties, so it's a block [INFO] [stdout] 403 | | ... } [INFO] [stdout] 404 | | ... } [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] 400 ~ if let PropName::Ident(ident) = &kv.key [INFO] [stdout] 401 ~ && (ident.sym == "labels" || ident.sym == "interfaceName") { [INFO] [stdout] 402 | return false; // Has block properties, so it's a block [INFO] [stdout] 403 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/umbraco.rs:218:13 [INFO] [stdout] | [INFO] [stdout] 218 | / if let Some(variants_value) = obj.get("variants") { [INFO] [stdout] 219 | | if let Some(variants) = variants_value.as_array() { [INFO] [stdout] 220 | | debug!("Found content variants"); [INFO] [stdout] ... | [INFO] [stdout] 269 | | } [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] 218 ~ if let Some(variants_value) = obj.get("variants") [INFO] [stdout] 219 ~ && let Some(variants) = variants_value.as_array() { [INFO] [stdout] 220 | debug!("Found content variants"); [INFO] [stdout] ... [INFO] [stdout] 267 | obj.insert("_variants".to_string(), json!(processed_variants)); [INFO] [stdout] 268 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/umbraco.rs:226:21 [INFO] [stdout] | [INFO] [stdout] 226 | / if let Some(default_variant) = variants_clone.first() { [INFO] [stdout] 227 | | if let Some(variant_obj) = default_variant.as_object() { [INFO] [stdout] 228 | | // Collect properties to insert [INFO] [stdout] 229 | | let properties_to_insert: Vec<(String, Value)> = variant_obj [INFO] [stdout] ... | [INFO] [stdout] 244 | | } [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] 226 ~ if let Some(default_variant) = variants_clone.first() [INFO] [stdout] 227 ~ && let Some(variant_obj) = default_variant.as_object() { [INFO] [stdout] 228 | // Collect properties to insert [INFO] [stdout] ... [INFO] [stdout] 242 | } [INFO] [stdout] 243 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:421:13 [INFO] [stdout] | [INFO] [stdout] 421 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 422 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 423 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 424 | | match ident.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 431 | | } [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] 421 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 422 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 423 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 429 | } [INFO] [stdout] 430 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:422:17 [INFO] [stdout] | [INFO] [stdout] 422 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 423 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 424 | | match ident.sym.as_ref() { [INFO] [stdout] 425 | | "name" => has_name = true, [INFO] [stdout] ... | [INFO] [stdout] 430 | | } [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] 422 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 423 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 424 | match ident.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 428 | } [INFO] [stdout] 429 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:444:13 [INFO] [stdout] | [INFO] [stdout] 444 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 445 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 446 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 447 | | if ident.sym == "type" { [INFO] [stdout] ... | [INFO] [stdout] 457 | | } [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] 444 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 445 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 446 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 455 | } [INFO] [stdout] 456 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:445:17 [INFO] [stdout] | [INFO] [stdout] 445 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 446 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 447 | | if ident.sym == "type" { [INFO] [stdout] 448 | | if let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 456 | | } [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] 445 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 446 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 447 | if ident.sym == "type" { [INFO] [stdout] ... [INFO] [stdout] 454 | } [INFO] [stdout] 455 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:446:21 [INFO] [stdout] | [INFO] [stdout] 446 | / if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 447 | | if ident.sym == "type" { [INFO] [stdout] 448 | | if let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] 449 | | if let Lit::Str(str_lit) = &lit { [INFO] [stdout] ... | [INFO] [stdout] 455 | | } [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] 446 ~ if let PropName::Ident(ident) = &kv.key [INFO] [stdout] 447 ~ && ident.sym == "type" { [INFO] [stdout] 448 | if let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] ... [INFO] [stdout] 453 | } [INFO] [stdout] 454 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:447:25 [INFO] [stdout] | [INFO] [stdout] 447 | / if ident.sym == "type" { [INFO] [stdout] 448 | | if let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] 449 | | if let Lit::Str(str_lit) = &lit { [INFO] [stdout] 450 | | field_type = str_lit.value.to_string(); [INFO] [stdout] ... | [INFO] [stdout] 454 | | } [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] 447 ~ if ident.sym == "type" [INFO] [stdout] 448 ~ && let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] 449 | if let Lit::Str(str_lit) = &lit { [INFO] [stdout] ... [INFO] [stdout] 452 | } [INFO] [stdout] 453 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/parser/ast_analyzer.rs:449:33 [INFO] [stdout] | [INFO] [stdout] 449 | / ... if let Lit::Str(str_lit) = &lit { [INFO] [stdout] 450 | | ... field_type = str_lit.value.to_string(); [INFO] [stdout] 451 | | ... dlog_processing!(" - Found field type: {}", field_type); [INFO] [stdout] 452 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/parser/ast_analyzer.rs:448:46 [INFO] [stdout] | [INFO] [stdout] 448 | ... if let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] | ^^^ ---------- use: `&*kv.value.as_ref()` [INFO] [stdout] | | [INFO] [stdout] | replace this binding [INFO] [stdout] 449 | ... if let Lit::Str(str_lit) = &lit { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ with this pattern [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] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:448:29 [INFO] [stdout] | [INFO] [stdout] 448 | / ... if let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] 449 | | ... if let Lit::Str(str_lit) = &lit { [INFO] [stdout] 450 | | ... field_type = str_lit.value.to_string(); [INFO] [stdout] 451 | | ... dlog_processing!(" - Found field type: {}", field_type); [INFO] [stdout] 452 | | ... } [INFO] [stdout] 453 | | ... } [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] 448 ~ if let Expr::Lit(lit) = &*kv.value [INFO] [stdout] 449 ~ && let Lit::Str(str_lit) = &lit { [INFO] [stdout] 450 | field_type = str_lit.value.to_string(); [INFO] [stdout] 451 | dlog_processing!(" - Found field type: {}", field_type); [INFO] [stdout] 452 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/umbraco.rs:327:9 [INFO] [stdout] | [INFO] [stdout] 327 | / if !found_content { [INFO] [stdout] 328 | | if let Some(arr) = json.as_array() { [INFO] [stdout] 329 | | info!("Using root array with {} items", arr.len()); [INFO] [stdout] 330 | | for item in arr { [INFO] [stdout] ... | [INFO] [stdout] 335 | | } [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] 327 ~ if !found_content [INFO] [stdout] 328 ~ && let Some(arr) = json.as_array() { [INFO] [stdout] 329 | info!("Using root array with {} items", arr.len()); [INFO] [stdout] ... [INFO] [stdout] 333 | found_content = true; [INFO] [stdout] 334 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:463:17 [INFO] [stdout] | [INFO] [stdout] 463 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 464 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 465 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 466 | | if ident.sym == "fields" { [INFO] [stdout] ... | [INFO] [stdout] 489 | | } [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] 463 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 464 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 465 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 487 | } [INFO] [stdout] 488 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:464:21 [INFO] [stdout] | [INFO] [stdout] 464 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 465 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 466 | | if ident.sym == "fields" { [INFO] [stdout] 467 | | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 488 | | } [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] 464 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 465 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 466 | if ident.sym == "fields" { [INFO] [stdout] ... [INFO] [stdout] 486 | } [INFO] [stdout] 487 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:465:25 [INFO] [stdout] | [INFO] [stdout] 465 | / if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 466 | | if ident.sym == "fields" { [INFO] [stdout] 467 | | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 468 | | dlog_processing!(" - Extracting fields from group field: {}", name); [INFO] [stdout] ... | [INFO] [stdout] 487 | | } [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] 465 ~ if let PropName::Ident(ident) = &kv.key [INFO] [stdout] 466 ~ && ident.sym == "fields" { [INFO] [stdout] 467 | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... [INFO] [stdout] 485 | } [INFO] [stdout] 486 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:466:29 [INFO] [stdout] | [INFO] [stdout] 466 | / ... if ident.sym == "fields" { [INFO] [stdout] 467 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 468 | | ... dlog_processing!(" - Extracting fields from group field: {}", name); [INFO] [stdout] 469 | | ... let group_fields = self.extract_fields_from_array(arr)?; [INFO] [stdout] ... | [INFO] [stdout] 486 | | ... } [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] 466 ~ if ident.sym == "fields" [INFO] [stdout] 467 ~ && let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 468 | dlog_processing!(" - Extracting fields from group field: {}", name); [INFO] [stdout] ... [INFO] [stdout] 484 | } [INFO] [stdout] 485 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:526:13 [INFO] [stdout] | [INFO] [stdout] 526 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 527 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 528 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 529 | | match ident.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 550 | | } [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] 526 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 527 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 528 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 548 | } [INFO] [stdout] 549 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:527:17 [INFO] [stdout] | [INFO] [stdout] 527 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 528 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 529 | | match ident.sym.as_ref() { [INFO] [stdout] 530 | | "fields" => { [INFO] [stdout] ... | [INFO] [stdout] 549 | | } [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] 527 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 528 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 529 | match ident.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 547 | } [INFO] [stdout] 548 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:565:13 [INFO] [stdout] | [INFO] [stdout] 565 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 566 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 567 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 568 | | match ident.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 609 | | } [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] 565 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 566 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 567 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 607 | } [INFO] [stdout] 608 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:566:17 [INFO] [stdout] | [INFO] [stdout] 566 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 567 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 568 | | match ident.sym.as_ref() { [INFO] [stdout] 569 | | "slug" => { [INFO] [stdout] ... | [INFO] [stdout] 608 | | } [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] 566 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 567 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 568 | match ident.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 606 | } [INFO] [stdout] 607 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/parser/ast_analyzer.rs:571:37 [INFO] [stdout] | [INFO] [stdout] 571 | / ... if let Lit::Str(str_lit) = &lit { [INFO] [stdout] 572 | | ... slug = str_lit.value.to_string(); [INFO] [stdout] 573 | | ... dlog_processing!(" - Found block slug: {}", slug); [INFO] [stdout] 574 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/parser/ast_analyzer.rs:570:50 [INFO] [stdout] | [INFO] [stdout] 570 | ... if let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] | ^^^ ---------- use: `&*kv.value.as_ref()` [INFO] [stdout] | | [INFO] [stdout] | replace this binding [INFO] [stdout] 571 | ... if let Lit::Str(str_lit) = &lit { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:570:33 [INFO] [stdout] | [INFO] [stdout] 570 | / ... if let Expr::Lit(lit) = &*kv.value { [INFO] [stdout] 571 | | ... if let Lit::Str(str_lit) = &lit { [INFO] [stdout] 572 | | ... slug = str_lit.value.to_string(); [INFO] [stdout] 573 | | ... dlog_processing!(" - Found block slug: {}", slug); [INFO] [stdout] 574 | | ... } [INFO] [stdout] 575 | | ... } [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] 570 ~ if let Expr::Lit(lit) = &*kv.value [INFO] [stdout] 571 ~ && let Lit::Str(str_lit) = &lit { [INFO] [stdout] 572 | slug = str_lit.value.to_string(); [INFO] [stdout] 573 | dlog_processing!(" - Found block slug: {}", slug); [INFO] [stdout] 574 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:587:41 [INFO] [stdout] | [INFO] [stdout] 587 | / ... if let PropOrSpread::Prop(label_prop) = label_prop { [INFO] [stdout] 588 | | ... if let Prop::KeyValue(label_kv) = &**label_prop { [INFO] [stdout] 589 | | ... if let PropName::Ident(label_ident) = &label_kv.key { [INFO] [stdout] 590 | | ... if let Expr::Lit(label_lit) = &*label_kv.value { [INFO] [stdout] ... | [INFO] [stdout] 601 | | ... } [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] 587 ~ if let PropOrSpread::Prop(label_prop) = label_prop [INFO] [stdout] 588 ~ && let Prop::KeyValue(label_kv) = &**label_prop { [INFO] [stdout] 589 | if let PropName::Ident(label_ident) = &label_kv.key { [INFO] [stdout] ... [INFO] [stdout] 599 | } [INFO] [stdout] 600 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:588:45 [INFO] [stdout] | [INFO] [stdout] 588 | / ... if let Prop::KeyValue(label_kv) = &**label_prop { [INFO] [stdout] 589 | | ... if let PropName::Ident(label_ident) = &label_kv.key { [INFO] [stdout] 590 | | ... if let Expr::Lit(label_lit) = &*label_kv.value { [INFO] [stdout] 591 | | ... if let Lit::Str(label_str) = &label_lit { [INFO] [stdout] ... | [INFO] [stdout] 600 | | ... } [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] 588 ~ if let Prop::KeyValue(label_kv) = &**label_prop [INFO] [stdout] 589 ~ && let PropName::Ident(label_ident) = &label_kv.key { [INFO] [stdout] 590 | if let Expr::Lit(label_lit) = &*label_kv.value { [INFO] [stdout] ... [INFO] [stdout] 598 | } [INFO] [stdout] 599 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:589:49 [INFO] [stdout] | [INFO] [stdout] 589 | / ... if let PropName::Ident(label_ident) = &label_kv.key { [INFO] [stdout] 590 | | ... if let Expr::Lit(label_lit) = &*label_kv.value { [INFO] [stdout] 591 | | ... if let Lit::Str(label_str) = &label_lit { [INFO] [stdout] 592 | | ... match label_ident.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 599 | | ... } [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] 589 ~ if let PropName::Ident(label_ident) = &label_kv.key [INFO] [stdout] 590 ~ && let Expr::Lit(label_lit) = &*label_kv.value { [INFO] [stdout] 591 | if let Lit::Str(label_str) = &label_lit { [INFO] [stdout] ... [INFO] [stdout] 597 | } [INFO] [stdout] 598 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:71:21 [INFO] [stdout] | [INFO] [stdout] 71 | / if r.status().as_u16() == 429 || r.status().is_server_error() { [INFO] [stdout] 72 | | if attempt < max_retries { [INFO] [stdout] 73 | | attempt += 1; [INFO] [stdout] 74 | | info!("HTTP {} on {}; retrying {}/{} after {}ms", r.status(), url, attempt, max_retries, backoff_ms); [INFO] [stdout] ... | [INFO] [stdout] 79 | | } [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] 71 ~ if (r.status().as_u16() == 429 || r.status().is_server_error()) { [INFO] [stdout] 72 ~ && attempt < max_retries { [INFO] [stdout] 73 | attempt += 1; [INFO] [stdout] ... [INFO] [stdout] 77 | continue; [INFO] [stdout] 78 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/parser/ast_analyzer.rs:591:57 [INFO] [stdout] | [INFO] [stdout] 591 | / ... if let Lit::Str(label_str) = &label_lit { [INFO] [stdout] 592 | | ... match label_ident.sym.as_ref() { [INFO] [stdout] 593 | | ... "singular" => labels.singular = Some(label_str.value.to_string()), [INFO] [stdout] 594 | | ... "plural" => labels.plural = Some(label_str.value.to_string()), [INFO] [stdout] ... | [INFO] [stdout] 597 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/parser/ast_analyzer.rs:590:70 [INFO] [stdout] | [INFO] [stdout] 590 | ... if let Expr::Lit(label_lit) = &*label_kv.value { [INFO] [stdout] | ^^^^^^^^^ ---------------- use: `&*label_kv.value.as_ref()` [INFO] [stdout] | | [INFO] [stdout] | replace this binding [INFO] [stdout] 591 | ... if let Lit::Str(label_str) = &label_lit { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ with this pattern [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:590:53 [INFO] [stdout] | [INFO] [stdout] 590 | / ... if let Expr::Lit(label_lit) = &*label_kv.value { [INFO] [stdout] 591 | | ... if let Lit::Str(label_str) = &label_lit { [INFO] [stdout] 592 | | ... match label_ident.sym.as_ref() { [INFO] [stdout] 593 | | ... "singular" => labels.singular = Some(label_str.value.to_string()), [INFO] [stdout] ... | [INFO] [stdout] 598 | | ... } [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] 590 ~ if let Expr::Lit(label_lit) = &*label_kv.value [INFO] [stdout] 591 ~ && let Lit::Str(label_str) = &label_lit { [INFO] [stdout] 592 | match label_ident.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 596 | } [INFO] [stdout] 597 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/parser/ast_analyzer.rs:625:13 [INFO] [stdout] | [INFO] [stdout] 625 | / match elem { [INFO] [stdout] 626 | | Some(elem) => { [INFO] [stdout] 627 | | if elem.spread.is_some() { [INFO] [stdout] ... | [INFO] [stdout] 682 | | None => {} [INFO] [stdout] 683 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 625 ~ if let Some(elem) = elem { [INFO] [stdout] 626 + if elem.spread.is_some() { [INFO] [stdout] 627 + // Handle spread element [INFO] [stdout] 628 + match &*elem.expr { [INFO] [stdout] 629 + Expr::Call(call) => { [INFO] [stdout] 630 + let func_name = self.extract_call_name(call); [INFO] [stdout] 631 + dlog_processing!(" - Spread call {}: ...{}()", i, func_name); [INFO] [stdout] 632 + fields.push(FieldDefinition { [INFO] [stdout] 633 + name: format!("__spread__call__{}", func_name), [INFO] [stdout] 634 + field_type: FieldType::Text { min_length: None, max_length: None }, [INFO] [stdout] 635 + required: false, [INFO] [stdout] 636 + default_value: None, [INFO] [stdout] 637 + label: None, [INFO] [stdout] 638 + admin: None, [INFO] [stdout] 639 + source_location: SourceLocation::default(), [INFO] [stdout] 640 + }); [INFO] [stdout] 641 + } [INFO] [stdout] 642 + Expr::Ident(ident) => { [INFO] [stdout] 643 + dlog_processing!(" - Spread {}: ...{}", i, ident.sym); [INFO] [stdout] 644 + fields.push(FieldDefinition { [INFO] [stdout] 645 + name: format!("__spread__{}", ident.sym), [INFO] [stdout] 646 + field_type: FieldType::Text { min_length: None, max_length: None }, [INFO] [stdout] 647 + required: false, [INFO] [stdout] 648 + default_value: None, [INFO] [stdout] 649 + label: None, [INFO] [stdout] 650 + admin: None, [INFO] [stdout] 651 + source_location: SourceLocation::default(), [INFO] [stdout] 652 + }); [INFO] [stdout] 653 + } [INFO] [stdout] 654 + _ => {} [INFO] [stdout] 655 + } [INFO] [stdout] 656 + } else { [INFO] [stdout] 657 + // Regular element [INFO] [stdout] 658 + match &*elem.expr { [INFO] [stdout] 659 + Expr::Object(obj) => { [INFO] [stdout] 660 + if let Some(field) = self.extract_field_from_object(obj)? { [INFO] [stdout] 661 + dlog_processing!(" - Field {}: {}", i, field.name); [INFO] [stdout] 662 + fields.push(field); [INFO] [stdout] 663 + } [INFO] [stdout] 664 + } [INFO] [stdout] 665 + Expr::Ident(ident) => { [INFO] [stdout] 666 + dlog_processing!(" - Reference {}: {}", i, ident.sym); [INFO] [stdout] 667 + fields.push(FieldDefinition { [INFO] [stdout] 668 + name: format!("__ref__{}", ident.sym), [INFO] [stdout] 669 + field_type: FieldType::Text { min_length: None, max_length: None }, [INFO] [stdout] 670 + required: false, [INFO] [stdout] 671 + default_value: None, [INFO] [stdout] 672 + label: None, [INFO] [stdout] 673 + admin: None, [INFO] [stdout] 674 + source_location: SourceLocation::default(), [INFO] [stdout] 675 + }); [INFO] [stdout] 676 + } [INFO] [stdout] 677 + _ => {} [INFO] [stdout] 678 + } [INFO] [stdout] 679 + } [INFO] [stdout] 680 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:124:13 [INFO] [stdout] | [INFO] [stdout] 124 | / if total_pages.is_none() { [INFO] [stdout] 125 | | if let Some(tp) = response.headers().get("X-WP-TotalPages") { [INFO] [stdout] 126 | | if let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } [INFO] [stdout] 127 | | } [INFO] [stdout] 128 | | } [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] 124 ~ if total_pages.is_none() [INFO] [stdout] 125 ~ && let Some(tp) = response.headers().get("X-WP-TotalPages") { [INFO] [stdout] 126 | if let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } [INFO] [stdout] 127 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:125:17 [INFO] [stdout] | [INFO] [stdout] 125 | / if let Some(tp) = response.headers().get("X-WP-TotalPages") { [INFO] [stdout] 126 | | if let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } [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] 125 ~ if let Some(tp) = response.headers().get("X-WP-TotalPages") [INFO] [stdout] 126 ~ && let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:704:13 [INFO] [stdout] | [INFO] [stdout] 704 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 705 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 706 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 707 | | match key.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 742 | | } [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] 704 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 705 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 706 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 740 | } [INFO] [stdout] 741 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:705:17 [INFO] [stdout] | [INFO] [stdout] 705 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 706 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 707 | | match key.sym.as_ref() { [INFO] [stdout] 708 | | "name" => { [INFO] [stdout] ... | [INFO] [stdout] 741 | | } [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] 705 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 706 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 707 | match key.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 739 | } [INFO] [stdout] 740 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:149:13 [INFO] [stdout] | [INFO] [stdout] 149 | if let Some(tp) = total_pages { if (page as u32) > tp { break; } } [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] 149 - if let Some(tp) = total_pages { if (page as u32) > tp { break; } } [INFO] [stdout] 149 + if let Some(tp) = total_pages && (page as u32) > tp { break; } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/parser/ast_analyzer.rs:731:79 [INFO] [stdout] | [INFO] [stdout] 731 | ... field.default_value = self.extract_json_value(&*kv.value); [INFO] [stdout] | ^^^^^^^^^^ help: try: `&kv.value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] = note: `#[warn(clippy::explicit_auto_deref)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:761:13 [INFO] [stdout] | [INFO] [stdout] 761 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 762 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 763 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 764 | | match key.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 784 | | } [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] 761 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 762 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 763 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 782 | } [INFO] [stdout] 783 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:184:13 [INFO] [stdout] | [INFO] [stdout] 184 | / ... if total_pages.is_none() { [INFO] [stdout] 185 | | ... if let Some(tp) = response.headers().get("X-WP-TotalPages") { if let Ok(s) = tp.to_str() { total_pages = s.parse::... [INFO] [stdout] 186 | | ... } [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] 184 ~ if total_pages.is_none() [INFO] [stdout] 185 ~ && let Some(tp) = response.headers().get("X-WP-TotalPages") { if let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:762:17 [INFO] [stdout] | [INFO] [stdout] 762 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 763 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 764 | | match key.sym.as_ref() { [INFO] [stdout] 765 | | "position" => { [INFO] [stdout] ... | [INFO] [stdout] 783 | | } [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] 762 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 763 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 764 | match key.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 781 | } [INFO] [stdout] 782 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:185:17 [INFO] [stdout] | [INFO] [stdout] 185 | ... if let Some(tp) = response.headers().get("X-WP-TotalPages") { if let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } } [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] 185 - if let Some(tp) = response.headers().get("X-WP-TotalPages") { if let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } } [INFO] [stdout] 185 + if let Some(tp) = response.headers().get("X-WP-TotalPages") && let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:797:21 [INFO] [stdout] | [INFO] [stdout] 797 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 798 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 799 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 800 | | match key.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 815 | | } [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] 797 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 798 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 799 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 813 | } [INFO] [stdout] 814 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:798:25 [INFO] [stdout] | [INFO] [stdout] 798 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 799 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 800 | | match key.sym.as_ref() { [INFO] [stdout] 801 | | "minLength" => { [INFO] [stdout] ... | [INFO] [stdout] 814 | | } [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] 798 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 799 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 800 | match key.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 812 | } [INFO] [stdout] 813 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:826:21 [INFO] [stdout] | [INFO] [stdout] 826 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 827 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 828 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 829 | | if key.sym == "options" { [INFO] [stdout] ... | [INFO] [stdout] 836 | | } [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] 826 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 827 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 828 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 834 | } [INFO] [stdout] 835 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:827:25 [INFO] [stdout] | [INFO] [stdout] 827 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 828 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 829 | | if key.sym == "options" { [INFO] [stdout] 830 | | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 835 | | } [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] 827 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 828 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 829 | if key.sym == "options" { [INFO] [stdout] ... [INFO] [stdout] 833 | } [INFO] [stdout] 834 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:828:29 [INFO] [stdout] | [INFO] [stdout] 828 | / ... if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 829 | | ... if key.sym == "options" { [INFO] [stdout] 830 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 831 | | ... options = self.extract_select_options(arr)?; [INFO] [stdout] ... | [INFO] [stdout] 834 | | ... } [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] 828 ~ if let PropName::Ident(key) = &kv.key [INFO] [stdout] 829 ~ && key.sym == "options" { [INFO] [stdout] 830 | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 831 | options = self.extract_select_options(arr)?; [INFO] [stdout] 832 | } [INFO] [stdout] 833 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:829:33 [INFO] [stdout] | [INFO] [stdout] 829 | / ... if key.sym == "options" { [INFO] [stdout] 830 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 831 | | ... options = self.extract_select_options(arr)?; [INFO] [stdout] 832 | | ... } [INFO] [stdout] 833 | | ... } [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] 829 ~ if key.sym == "options" [INFO] [stdout] 830 ~ && let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 831 | options = self.extract_select_options(arr)?; [INFO] [stdout] 832 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:843:21 [INFO] [stdout] | [INFO] [stdout] 843 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 844 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 845 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 846 | | if key.sym == "relationTo" { [INFO] [stdout] ... | [INFO] [stdout] 853 | | } [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] 843 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 844 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 845 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 851 | } [INFO] [stdout] 852 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:844:25 [INFO] [stdout] | [INFO] [stdout] 844 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 845 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 846 | | if key.sym == "relationTo" { [INFO] [stdout] 847 | | if let Expr::Lit(Lit::Str(s)) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 852 | | } [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] 844 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 845 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 846 | if key.sym == "relationTo" { [INFO] [stdout] ... [INFO] [stdout] 850 | } [INFO] [stdout] 851 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:845:29 [INFO] [stdout] | [INFO] [stdout] 845 | / ... if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 846 | | ... if key.sym == "relationTo" { [INFO] [stdout] 847 | | ... if let Expr::Lit(Lit::Str(s)) = &*kv.value { [INFO] [stdout] 848 | | ... relation_to = s.value.to_string(); [INFO] [stdout] ... | [INFO] [stdout] 851 | | ... } [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] 845 ~ if let PropName::Ident(key) = &kv.key [INFO] [stdout] 846 ~ && key.sym == "relationTo" { [INFO] [stdout] 847 | if let Expr::Lit(Lit::Str(s)) = &*kv.value { [INFO] [stdout] 848 | relation_to = s.value.to_string(); [INFO] [stdout] 849 | } [INFO] [stdout] 850 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:846:33 [INFO] [stdout] | [INFO] [stdout] 846 | / ... if key.sym == "relationTo" { [INFO] [stdout] 847 | | ... if let Expr::Lit(Lit::Str(s)) = &*kv.value { [INFO] [stdout] 848 | | ... relation_to = s.value.to_string(); [INFO] [stdout] 849 | | ... } [INFO] [stdout] 850 | | ... } [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] 846 ~ if key.sym == "relationTo" [INFO] [stdout] 847 ~ && let Expr::Lit(Lit::Str(s)) = &*kv.value { [INFO] [stdout] 848 | relation_to = s.value.to_string(); [INFO] [stdout] 849 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:860:21 [INFO] [stdout] | [INFO] [stdout] 860 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 861 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 862 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 863 | | if key.sym == "fields" { [INFO] [stdout] ... | [INFO] [stdout] 870 | | } [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] 860 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 861 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 862 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 868 | } [INFO] [stdout] 869 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:861:25 [INFO] [stdout] | [INFO] [stdout] 861 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 862 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 863 | | if key.sym == "fields" { [INFO] [stdout] 864 | | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 869 | | } [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] 861 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 862 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 863 | if key.sym == "fields" { [INFO] [stdout] ... [INFO] [stdout] 867 | } [INFO] [stdout] 868 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:862:29 [INFO] [stdout] | [INFO] [stdout] 862 | / ... if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 863 | | ... if key.sym == "fields" { [INFO] [stdout] 864 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 865 | | ... nested_fields = self.extract_fields_from_array(arr)?; [INFO] [stdout] ... | [INFO] [stdout] 868 | | ... } [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] 862 ~ if let PropName::Ident(key) = &kv.key [INFO] [stdout] 863 ~ && key.sym == "fields" { [INFO] [stdout] 864 | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 865 | nested_fields = self.extract_fields_from_array(arr)?; [INFO] [stdout] 866 | } [INFO] [stdout] 867 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:207:13 [INFO] [stdout] | [INFO] [stdout] 207 | if let Some(tp) = total_pages { if (page as u32) > tp { break; } } [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 207 - if let Some(tp) = total_pages { if (page as u32) > tp { break; } } [INFO] [stdout] 207 + if let Some(tp) = total_pages && (page as u32) > tp { break; } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:242:13 [INFO] [stdout] | [INFO] [stdout] 242 | / ... if total_pages.is_none() { [INFO] [stdout] 243 | | ... if let Some(tp) = response.headers().get("X-WP-TotalPages") { if let Ok(s) = tp.to_str() { total_pages = s.parse::... [INFO] [stdout] 244 | | ... } [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] 242 ~ if total_pages.is_none() [INFO] [stdout] 243 ~ && let Some(tp) = response.headers().get("X-WP-TotalPages") { if let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:863:33 [INFO] [stdout] | [INFO] [stdout] 863 | / ... if key.sym == "fields" { [INFO] [stdout] 864 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 865 | | ... nested_fields = self.extract_fields_from_array(arr)?; [INFO] [stdout] 866 | | ... } [INFO] [stdout] 867 | | ... } [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] 863 ~ if key.sym == "fields" [INFO] [stdout] 864 ~ && let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 865 | nested_fields = self.extract_fields_from_array(arr)?; [INFO] [stdout] 866 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:877:21 [INFO] [stdout] | [INFO] [stdout] 877 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 878 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 879 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 880 | | if key.sym == "tabs" { [INFO] [stdout] ... | [INFO] [stdout] 887 | | } [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] 877 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 878 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 879 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 885 | } [INFO] [stdout] 886 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:243:17 [INFO] [stdout] | [INFO] [stdout] 243 | ... if let Some(tp) = response.headers().get("X-WP-TotalPages") { if let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } } [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] 243 - if let Some(tp) = response.headers().get("X-WP-TotalPages") { if let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } } [INFO] [stdout] 243 + if let Some(tp) = response.headers().get("X-WP-TotalPages") && let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:269:13 [INFO] [stdout] | [INFO] [stdout] 269 | if let Some(tp) = total_pages { if (page as u32) > tp { break; } } [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] 269 - if let Some(tp) = total_pages { if (page as u32) > tp { break; } } [INFO] [stdout] 269 + if let Some(tp) = total_pages && (page as u32) > tp { break; } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:878:25 [INFO] [stdout] | [INFO] [stdout] 878 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 879 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 880 | | if key.sym == "tabs" { [INFO] [stdout] 881 | | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 886 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 878 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 879 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 880 | if key.sym == "tabs" { [INFO] [stdout] ... [INFO] [stdout] 884 | } [INFO] [stdout] 885 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:879:29 [INFO] [stdout] | [INFO] [stdout] 879 | / ... if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 880 | | ... if key.sym == "tabs" { [INFO] [stdout] 881 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 882 | | ... tabs = self.extract_tabs_from_array(arr)?; [INFO] [stdout] ... | [INFO] [stdout] 885 | | ... } [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] 879 ~ if let PropName::Ident(key) = &kv.key [INFO] [stdout] 880 ~ && key.sym == "tabs" { [INFO] [stdout] 881 | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 882 | tabs = self.extract_tabs_from_array(arr)?; [INFO] [stdout] 883 | } [INFO] [stdout] 884 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:880:33 [INFO] [stdout] | [INFO] [stdout] 880 | / ... if key.sym == "tabs" { [INFO] [stdout] 881 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 882 | | ... tabs = self.extract_tabs_from_array(arr)?; [INFO] [stdout] 883 | | ... } [INFO] [stdout] 884 | | ... } [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] 880 ~ if key.sym == "tabs" [INFO] [stdout] 881 ~ && let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 882 | tabs = self.extract_tabs_from_array(arr)?; [INFO] [stdout] 883 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:894:21 [INFO] [stdout] | [INFO] [stdout] 894 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 895 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 896 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 897 | | if key.sym == "blocks" { [INFO] [stdout] ... | [INFO] [stdout] 904 | | } [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] 894 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 895 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 896 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 902 | } [INFO] [stdout] 903 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:895:25 [INFO] [stdout] | [INFO] [stdout] 895 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 896 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 897 | | if key.sym == "blocks" { [INFO] [stdout] 898 | | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] ... | [INFO] [stdout] 903 | | } [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] 895 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 896 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 897 | if key.sym == "blocks" { [INFO] [stdout] ... [INFO] [stdout] 901 | } [INFO] [stdout] 902 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:896:29 [INFO] [stdout] | [INFO] [stdout] 896 | / ... if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 897 | | ... if key.sym == "blocks" { [INFO] [stdout] 898 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 899 | | ... blocks = self.extract_block_names(arr)?; [INFO] [stdout] ... | [INFO] [stdout] 902 | | ... } [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] 896 ~ if let PropName::Ident(key) = &kv.key [INFO] [stdout] 897 ~ && key.sym == "blocks" { [INFO] [stdout] 898 | if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 899 | blocks = self.extract_block_names(arr)?; [INFO] [stdout] 900 | } [INFO] [stdout] 901 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:897:33 [INFO] [stdout] | [INFO] [stdout] 897 | / ... if key.sym == "blocks" { [INFO] [stdout] 898 | | ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 899 | | ... blocks = self.extract_block_names(arr)?; [INFO] [stdout] 900 | | ... } [INFO] [stdout] 901 | | ... } [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] 897 ~ if key.sym == "blocks" [INFO] [stdout] 898 ~ && let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 899 | blocks = self.extract_block_names(arr)?; [INFO] [stdout] 900 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:930:25 [INFO] [stdout] | [INFO] [stdout] 930 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 931 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 932 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 933 | | match key.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 948 | | } [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] 930 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 931 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 932 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 946 | } [INFO] [stdout] 947 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:303:13 [INFO] [stdout] | [INFO] [stdout] 303 | / if total_pages.is_none() { [INFO] [stdout] 304 | | if let Some(tp) = response.headers().get("X-WP-TotalPages") { [INFO] [stdout] 305 | | if let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } [INFO] [stdout] 306 | | } [INFO] [stdout] 307 | | } [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] 303 ~ if total_pages.is_none() [INFO] [stdout] 304 ~ && let Some(tp) = response.headers().get("X-WP-TotalPages") { [INFO] [stdout] 305 | if let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } [INFO] [stdout] 306 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:931:29 [INFO] [stdout] | [INFO] [stdout] 931 | / ... if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 932 | | ... if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 933 | | ... match key.sym.as_ref() { [INFO] [stdout] 934 | | ... "label" => { [INFO] [stdout] ... | [INFO] [stdout] 947 | | ... } [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] 931 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 932 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 933 | match key.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 945 | } [INFO] [stdout] 946 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:304:17 [INFO] [stdout] | [INFO] [stdout] 304 | / if let Some(tp) = response.headers().get("X-WP-TotalPages") { [INFO] [stdout] 305 | | if let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } [INFO] [stdout] 306 | | } [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] 304 ~ if let Some(tp) = response.headers().get("X-WP-TotalPages") [INFO] [stdout] 305 ~ && let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:322:13 [INFO] [stdout] | [INFO] [stdout] 322 | if let Some(tp) = total_pages { if (page as u32) > tp { break; } } [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] 322 - if let Some(tp) = total_pages { if (page as u32) > tp { break; } } [INFO] [stdout] 322 + if let Some(tp) = total_pages && (page as u32) > tp { break; } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:994:21 [INFO] [stdout] | [INFO] [stdout] 994 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 995 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 996 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 997 | | match key.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 1017 | | } [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] 994 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 995 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 996 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 1015 | } [INFO] [stdout] 1016 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:995:25 [INFO] [stdout] | [INFO] [stdout] 995 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 996 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 997 | | match key.sym.as_ref() { [INFO] [stdout] 998 | | "label" => { [INFO] [stdout] ... | [INFO] [stdout] 1016 | | } [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] 995 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 996 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 997 | match key.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 1014 | } [INFO] [stdout] 1015 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:356:13 [INFO] [stdout] | [INFO] [stdout] 356 | / if total_pages.is_none() { [INFO] [stdout] 357 | | if let Some(tp) = response.headers().get("X-WP-TotalPages") { [INFO] [stdout] 358 | | if let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } [INFO] [stdout] 359 | | } [INFO] [stdout] 360 | | } [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] 356 ~ if total_pages.is_none() [INFO] [stdout] 357 ~ && let Some(tp) = response.headers().get("X-WP-TotalPages") { [INFO] [stdout] 358 | if let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } [INFO] [stdout] 359 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:357:17 [INFO] [stdout] | [INFO] [stdout] 357 | / if let Some(tp) = response.headers().get("X-WP-TotalPages") { [INFO] [stdout] 358 | | if let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } [INFO] [stdout] 359 | | } [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] 357 ~ if let Some(tp) = response.headers().get("X-WP-TotalPages") [INFO] [stdout] 358 ~ && let Ok(s) = tp.to_str() { total_pages = s.parse::().ok(); } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:375:13 [INFO] [stdout] | [INFO] [stdout] 375 | if let Some(tp) = total_pages { if (page as u32) > tp { break; } } [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] 375 - if let Some(tp) = total_pages { if (page as u32) > tp { break; } } [INFO] [stdout] 375 + if let Some(tp) = total_pages && (page as u32) > tp { break; } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:1048:21 [INFO] [stdout] | [INFO] [stdout] 1048 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 1049 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 1050 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 1051 | | if let Some(value) = self.extract_json_value(&*kv.value) { [INFO] [stdout] ... | [INFO] [stdout] 1056 | | } [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] 1048 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 1049 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 1050 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 1054 | } [INFO] [stdout] 1055 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:1049:25 [INFO] [stdout] | [INFO] [stdout] 1049 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 1050 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 1051 | | if let Some(value) = self.extract_json_value(&*kv.value) { [INFO] [stdout] 1052 | | map.insert(key.sym.to_string(), value); [INFO] [stdout] ... | [INFO] [stdout] 1055 | | } [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] 1049 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 1050 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 1051 | if let Some(value) = self.extract_json_value(&*kv.value) { [INFO] [stdout] 1052 | map.insert(key.sym.to_string(), value); [INFO] [stdout] 1053 | } [INFO] [stdout] 1054 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/ast_analyzer.rs:1050:29 [INFO] [stdout] | [INFO] [stdout] 1050 | / ... if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 1051 | | ... if let Some(value) = self.extract_json_value(&*kv.value) { [INFO] [stdout] 1052 | | ... map.insert(key.sym.to_string(), value); [INFO] [stdout] 1053 | | ... } [INFO] [stdout] 1054 | | ... } [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] 1050 ~ if let PropName::Ident(key) = &kv.key [INFO] [stdout] 1051 ~ && let Some(value) = self.extract_json_value(&*kv.value) { [INFO] [stdout] 1052 | map.insert(key.sym.to_string(), value); [INFO] [stdout] 1053 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/parser/ast_analyzer.rs:1051:78 [INFO] [stdout] | [INFO] [stdout] 1051 | ... if let Some(value) = self.extract_json_value(&*kv.value) { [INFO] [stdout] | ^^^^^^^^^^ help: try: `&kv.value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_auto_deref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:500:13 [INFO] [stdout] | [INFO] [stdout] 500 | / if let Some(featured_media) = obj.get("featured_media") { [INFO] [stdout] 501 | | if !featured_media.is_null() && featured_media.as_u64() != Some(0) { [INFO] [stdout] 502 | | processed["featured_media"] = featured_media.clone(); [INFO] [stdout] 503 | | } [INFO] [stdout] 504 | | } [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] 500 ~ if let Some(featured_media) = obj.get("featured_media") [INFO] [stdout] 501 ~ && !featured_media.is_null() && featured_media.as_u64() != Some(0) { [INFO] [stdout] 502 | processed["featured_media"] = featured_media.clone(); [INFO] [stdout] 503 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:521:13 [INFO] [stdout] | [INFO] [stdout] 521 | / if let Some(acf) = obj.get("acf") { [INFO] [stdout] 522 | | if !acf.is_null() { [INFO] [stdout] 523 | | processed["acf"] = acf.clone(); [INFO] [stdout] 524 | | } [INFO] [stdout] 525 | | } [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] 521 ~ if let Some(acf) = obj.get("acf") [INFO] [stdout] 522 ~ && !acf.is_null() { [INFO] [stdout] 523 | processed["acf"] = acf.clone(); [INFO] [stdout] 524 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:528:13 [INFO] [stdout] | [INFO] [stdout] 528 | / if let Some(meta) = obj.get("meta") { [INFO] [stdout] 529 | | if !meta.is_null() { [INFO] [stdout] 530 | | processed["meta"] = meta.clone(); [INFO] [stdout] 531 | | } [INFO] [stdout] 532 | | } [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] 528 ~ if let Some(meta) = obj.get("meta") [INFO] [stdout] 529 ~ && !meta.is_null() { [INFO] [stdout] 530 | processed["meta"] = meta.clone(); [INFO] [stdout] 531 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/parser/import_resolver.rs:229:32 [INFO] [stdout] | [INFO] [stdout] 229 | self.base_dir.join(&import_path[1..]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/parser/import_resolver.rs:227:16 [INFO] [stdout] | [INFO] [stdout] 227 | } else if import_path.starts_with('/') { [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] 227 ~ } else if let Some() = import_path.strip_prefix('/') { [INFO] [stdout] 228 | // Absolute import from project root [INFO] [stdout] 229 ~ self.base_dir.join() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: consider using `sort_by_key` [INFO] [stdout] --> src/parser/import_resolver.rs:247:9 [INFO] [stdout] | [INFO] [stdout] 247 | sorted_aliases.sort_by(|a, b| b.len().cmp(&a.len())); [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] 247 - sorted_aliases.sort_by(|a, b| b.len().cmp(&a.len())); [INFO] [stdout] 247 + sorted_aliases.sort_by_key(|b| std::cmp::Reverse(b.len())); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:716:19 [INFO] [stdout] | [INFO] [stdout] 716 | let url = format!("{}", self.base_url); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `self.base_url.to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/import_resolver.rs:532:13 [INFO] [stdout] | [INFO] [stdout] 532 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 533 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 534 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 535 | | match ident.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 542 | | } [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] 532 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 533 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 534 | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 540 | } [INFO] [stdout] 541 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/import_resolver.rs:533:17 [INFO] [stdout] | [INFO] [stdout] 533 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 534 | | if let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 535 | | match ident.sym.as_ref() { [INFO] [stdout] 536 | | "name" => has_name = true, [INFO] [stdout] ... | [INFO] [stdout] 541 | | } [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] 533 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 534 ~ && let PropName::Ident(ident) = &kv.key { [INFO] [stdout] 535 | match ident.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 539 | } [INFO] [stdout] 540 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/import_resolver.rs:565:13 [INFO] [stdout] | [INFO] [stdout] 565 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 566 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 567 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 568 | | match key.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 611 | | } [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] 565 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 566 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 567 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 609 | } [INFO] [stdout] 610 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/import_resolver.rs:566:17 [INFO] [stdout] | [INFO] [stdout] 566 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 567 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 568 | | match key.sym.as_ref() { [INFO] [stdout] 569 | | "name" => { [INFO] [stdout] ... | [INFO] [stdout] 610 | | } [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] 566 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 567 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 568 | match key.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 608 | } [INFO] [stdout] 609 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/import_resolver.rs:593:40 [INFO] [stdout] | [INFO] [stdout] 593 | ... } else if let Expr::Lit(Lit::Bool(b)) = &*kv.value { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 594 | | ... if !b.value { [INFO] [stdout] 595 | | ... field.label = None; [INFO] [stdout] 596 | | ... } [INFO] [stdout] 597 | | ... } [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] 593 ~ } else if let Expr::Lit(Lit::Bool(b)) = &*kv.value [INFO] [stdout] 594 ~ && !b.value { [INFO] [stdout] 595 | field.label = None; [INFO] [stdout] 596 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/import_resolver.rs:601:33 [INFO] [stdout] | [INFO] [stdout] 601 | / ... if let Expr::Array(arr) = &*kv.value { [INFO] [stdout] 602 | | ... if let Ok(nested_fields) = self.extract_fields_from_array(arr) { [INFO] [stdout] 603 | | ... field.field_type = FieldType::Group { fields: nested_fields }; [INFO] [stdout] 604 | | ... } [INFO] [stdout] 605 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 601 ~ if let Expr::Array(arr) = &*kv.value [INFO] [stdout] 602 ~ && let Ok(nested_fields) = self.extract_fields_from_array(arr) { [INFO] [stdout] 603 | field.field_type = FieldType::Group { fields: nested_fields }; [INFO] [stdout] 604 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary `if let` since only the `Some` variant of the iterator element is used [INFO] [stdout] --> src/parser/import_resolver.rs:623:9 [INFO] [stdout] | [INFO] [stdout] 623 | / for elem in &arr.elems { [INFO] [stdout] 624 | | if let Some(elem) = elem { [INFO] [stdout] 625 | | if let Expr::Object(obj) = &*elem.expr { [INFO] [stdout] 626 | | if let Ok(Some(field)) = self.extract_simple_field_from_object(obj) { [INFO] [stdout] ... | [INFO] [stdout] 642 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: try `.flatten()` and remove the `if let` statement in the for loop [INFO] [stdout] --> src/parser/import_resolver.rs:624:13 [INFO] [stdout] | [INFO] [stdout] 624 | / if let Some(elem) = elem { [INFO] [stdout] 625 | | if let Expr::Object(obj) = &*elem.expr { [INFO] [stdout] 626 | | if let Ok(Some(field)) = self.extract_simple_field_from_object(obj) { [INFO] [stdout] 627 | | fields.push(field); [INFO] [stdout] ... | [INFO] [stdout] 641 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 623 ~ for elem in arr.elems.iter().flatten() { [INFO] [stdout] 624 + if let Expr::Object(obj) = &*elem.expr { [INFO] [stdout] 625 + if let Ok(Some(field)) = self.extract_simple_field_from_object(obj) { [INFO] [stdout] 626 + fields.push(field); [INFO] [stdout] 627 + } [INFO] [stdout] 628 + } else if let Expr::Ident(ident) = &*elem.expr { [INFO] [stdout] 629 + // Handle field references within the array [INFO] [stdout] 630 + fields.push(FieldDefinition { [INFO] [stdout] 631 + name: format!("__ref__{}", ident.sym), [INFO] [stdout] 632 + field_type: FieldType::Text { min_length: None, max_length: None }, [INFO] [stdout] 633 + required: false, [INFO] [stdout] 634 + default_value: None, [INFO] [stdout] 635 + label: None, [INFO] [stdout] 636 + admin: None, [INFO] [stdout] 637 + source_location: crate::parser::schema::SourceLocation::default(), [INFO] [stdout] 638 + }); [INFO] [stdout] 639 + } [INFO] [stdout] 640 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/import_resolver.rs:665:13 [INFO] [stdout] | [INFO] [stdout] 665 | / if let PropOrSpread::Prop(prop) = prop { [INFO] [stdout] 666 | | if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 667 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 668 | | match key.sym.as_ref() { [INFO] [stdout] ... | [INFO] [stdout] 703 | | } [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] 665 ~ if let PropOrSpread::Prop(prop) = prop [INFO] [stdout] 666 ~ && let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 667 | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] ... [INFO] [stdout] 701 | } [INFO] [stdout] 702 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/parser/import_resolver.rs:666:17 [INFO] [stdout] | [INFO] [stdout] 666 | / if let Prop::KeyValue(kv) = &**prop { [INFO] [stdout] 667 | | if let PropName::Ident(key) = &kv.key { [INFO] [stdout] 668 | | match key.sym.as_ref() { [INFO] [stdout] 669 | | "name" => { [INFO] [stdout] ... | [INFO] [stdout] 702 | | } [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] 666 ~ if let Prop::KeyValue(kv) = &**prop [INFO] [stdout] 667 ~ && let PropName::Ident(key) = &kv.key { [INFO] [stdout] 668 | match key.sym.as_ref() { [INFO] [stdout] ... [INFO] [stdout] 700 | } [INFO] [stdout] 701 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: direct implementation of `ToString` [INFO] [stdout] --> src/sources/wordpress/config.rs:262:1 [INFO] [stdout] | [INFO] [stdout] 262 | / impl ToString for PostStatus { [INFO] [stdout] 263 | | fn to_string(&self) -> String { [INFO] [stdout] 264 | | match self { [INFO] [stdout] 265 | | PostStatus::Publish => "publish".to_string(), [INFO] [stdout] ... | [INFO] [stdout] 275 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: prefer implementing `Display` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#to_string_trait_impl [INFO] [stdout] = note: `#[warn(clippy::to_string_trait_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/wxr_parser.rs:152:13 [INFO] [stdout] | [INFO] [stdout] 152 | / if let Ok(user) = self.parse_wxr_author(author_content) { [INFO] [stdout] 153 | | if let Some(id) = user.get("id").and_then(|v| v.as_str()) { [INFO] [stdout] 154 | | users.insert(id.to_string(), user); [INFO] [stdout] 155 | | } [INFO] [stdout] 156 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 152 ~ if let Ok(user) = self.parse_wxr_author(author_content) [INFO] [stdout] 153 ~ && let Some(id) = user.get("id").and_then(|v| v.as_str()) { [INFO] [stdout] 154 | users.insert(id.to_string(), user); [INFO] [stdout] 155 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/wxr_parser.rs:288:9 [INFO] [stdout] | [INFO] [stdout] 288 | / if let Ok(regex) = regex::Regex::new(&pattern) { [INFO] [stdout] 289 | | if let Some(captures) = regex.captures(content) { [INFO] [stdout] 290 | | return Some(captures[1].to_string()); [INFO] [stdout] 291 | | } [INFO] [stdout] 292 | | } [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] 288 ~ if let Ok(regex) = regex::Regex::new(&pattern) [INFO] [stdout] 289 ~ && let Some(captures) = regex.captures(content) { [INFO] [stdout] 290 | return Some(captures[1].to_string()); [INFO] [stdout] 291 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/wxr_parser.rs:299:9 [INFO] [stdout] | [INFO] [stdout] 299 | / if let Ok(regex) = regex::Regex::new(&pattern) { [INFO] [stdout] 300 | | if let Some(captures) = regex.captures(content) { [INFO] [stdout] 301 | | return Some(captures[1].to_string()); [INFO] [stdout] 302 | | } [INFO] [stdout] 303 | | } [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] 299 ~ if let Ok(regex) = regex::Regex::new(&pattern) [INFO] [stdout] 300 ~ && let Some(captures) = regex.captures(content) { [INFO] [stdout] 301 | return Some(captures[1].to_string()); [INFO] [stdout] 302 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/wxr_parser.rs:363:9 [INFO] [stdout] | [INFO] [stdout] 363 | / if let Some(author_id) = post.meta.get("post_author") { [INFO] [stdout] 364 | | if let Some(author) = users.get(author_id) { [INFO] [stdout] 365 | | doc["author"] = author.clone(); [INFO] [stdout] 366 | | } [INFO] [stdout] 367 | | } [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] 363 ~ if let Some(author_id) = post.meta.get("post_author") [INFO] [stdout] 364 ~ && let Some(author) = users.get(author_id) { [INFO] [stdout] 365 | doc["author"] = author.clone(); [INFO] [stdout] 366 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/wxr_parser.rs:412:9 [INFO] [stdout] | [INFO] [stdout] 412 | / if let Some(post_type) = obj [INFO] [stdout] 413 | | .get("type") [INFO] [stdout] 414 | | .or_else(|| obj.get("post_type")) [INFO] [stdout] 415 | | .and_then(|v| v.as_str()) [INFO] [stdout] ... | [INFO] [stdout] 420 | | } [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] 415 ~ .and_then(|v| v.as_str()) [INFO] [stdout] 416 ~ && !self.config.content_types.contains(&post_type.to_string()) { [INFO] [stdout] 417 | return Ok(None); [INFO] [stdout] 418 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/sources/wordpress/wxr_parser.rs:457:1 [INFO] [stdout] | [INFO] [stdout] 457 | / impl Default for PostStatus { [INFO] [stdout] 458 | | fn default() -> Self { [INFO] [stdout] 459 | | PostStatus::Draft [INFO] [stdout] 460 | | } [INFO] [stdout] 461 | | } [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] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/sources/wordpress/mod.rs:34:1 [INFO] [stdout] | [INFO] [stdout] 34 | / impl Default for WordPressSource { [INFO] [stdout] 35 | | fn default() -> Self { [INFO] [stdout] 36 | | Self { [INFO] [stdout] 37 | | wp_config: WordPressConfig::default(), [INFO] [stdout] ... | [INFO] [stdout] 44 | | } [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] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 21 + #[derive(Default)] [INFO] [stdout] 22 | pub struct WordPressSource { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module has the same name as its containing module [INFO] [stdout] --> src/parser/tests.rs:2:1 [INFO] [stdout] | [INFO] [stdout] 2 | / mod tests { [INFO] [stdout] 3 | | use crate::parser::*; [INFO] [stdout] 4 | | use crate::parser::ast_analyzer::AstAnalyzer; [INFO] [stdout] 5 | | use crate::parser::import_resolver::ImportResolver; [INFO] [stdout] ... | [INFO] [stdout] 925 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#module_inception [INFO] [stdout] = note: `#[warn(clippy::module_inception)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/parser/tests.rs:69:9 [INFO] [stdout] | [INFO] [stdout] 69 | assert_eq!(analyzer.fields[0].required, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 69 - assert_eq!(analyzer.fields[0].required, true); [INFO] [stdout] 69 + assert!(analyzer.fields[0].required); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/parser/tests.rs:71:9 [INFO] [stdout] | [INFO] [stdout] 71 | assert_eq!(analyzer.fields[1].required, false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 71 - assert_eq!(analyzer.fields[1].required, false); [INFO] [stdout] 71 + assert!(!analyzer.fields[1].required); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `result` after checking its variant with `is_ok` [INFO] [stdout] --> src/parser/tests.rs:409:28 [INFO] [stdout] | [INFO] [stdout] 408 | if result.is_ok() { [INFO] [stdout] | ----------------- help: try: `if let Ok() = result` [INFO] [stdout] 409 | let resolved = result.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] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/parser/tests.rs:504:9 [INFO] [stdout] | [INFO] [stdout] 504 | assert_eq!(template.fields[0].required, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 504 - assert_eq!(template.fields[0].required, true); [INFO] [stdout] 504 + assert!(template.fields[0].required); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/parser/tests.rs:507:9 [INFO] [stdout] | [INFO] [stdout] 507 | assert_eq!(template.fields[1].required, false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 507 - assert_eq!(template.fields[1].required, false); [INFO] [stdout] 507 + assert!(!template.fields[1].required); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/targets/payload.rs:76:17 [INFO] [stdout] | [INFO] [stdout] 76 | / if let Some(field_obj) = value.as_object() { [INFO] [stdout] 77 | | if let Some(field_type) = field_obj.get("type").and_then(|v| v.as_str()) { [INFO] [stdout] 78 | | if let Some(payload_type) = self.field_type_mappings.get(field_type) { [INFO] [stdout] 79 | | debug!("Processing field '{}' with type '{}'", key, field_type); [INFO] [stdout] ... | [INFO] [stdout] 151 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 76 ~ if let Some(field_obj) = value.as_object() [INFO] [stdout] 77 ~ && let Some(field_type) = field_obj.get("type").and_then(|v| v.as_str()) { [INFO] [stdout] 78 | if let Some(payload_type) = self.field_type_mappings.get(field_type) { [INFO] [stdout] ... [INFO] [stdout] 149 | } [INFO] [stdout] 150 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/targets/payload.rs:77:21 [INFO] [stdout] | [INFO] [stdout] 77 | / if let Some(field_type) = field_obj.get("type").and_then(|v| v.as_str()) { [INFO] [stdout] 78 | | if let Some(payload_type) = self.field_type_mappings.get(field_type) { [INFO] [stdout] 79 | | debug!("Processing field '{}' with type '{}'", key, field_type); [INFO] [stdout] ... | [INFO] [stdout] 150 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 77 ~ if let Some(field_type) = field_obj.get("type").and_then(|v| v.as_str()) [INFO] [stdout] 78 ~ && let Some(payload_type) = self.field_type_mappings.get(field_type) { [INFO] [stdout] 79 | debug!("Processing field '{}' with type '{}'", key, field_type); [INFO] [stdout] ... [INFO] [stdout] 148 | } [INFO] [stdout] 149 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/targets/payload.rs:187:17 [INFO] [stdout] | [INFO] [stdout] 187 | / if let Some(field_obj) = value.as_object() { [INFO] [stdout] 188 | | if let Some(field_type) = field_obj.get("type").and_then(|v| v.as_str()) { [INFO] [stdout] 189 | | if field_type == "relationship" { [INFO] [stdout] 190 | | debug!("Processing relationship field: {}", key); [INFO] [stdout] ... | [INFO] [stdout] 211 | | } [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] 187 ~ if let Some(field_obj) = value.as_object() [INFO] [stdout] 188 ~ && let Some(field_type) = field_obj.get("type").and_then(|v| v.as_str()) { [INFO] [stdout] 189 | if field_type == "relationship" { [INFO] [stdout] ... [INFO] [stdout] 209 | } [INFO] [stdout] 210 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/targets/payload.rs:188:21 [INFO] [stdout] | [INFO] [stdout] 188 | / if let Some(field_type) = field_obj.get("type").and_then(|v| v.as_str()) { [INFO] [stdout] 189 | | if field_type == "relationship" { [INFO] [stdout] 190 | | debug!("Processing relationship field: {}", key); [INFO] [stdout] ... | [INFO] [stdout] 210 | | } [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] 188 ~ if let Some(field_type) = field_obj.get("type").and_then(|v| v.as_str()) [INFO] [stdout] 189 ~ && field_type == "relationship" { [INFO] [stdout] 190 | debug!("Processing relationship field: {}", key); [INFO] [stdout] ... [INFO] [stdout] 208 | } [INFO] [stdout] 209 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/targets/payload.rs:244:13 [INFO] [stdout] | [INFO] [stdout] 244 | / if let Some(variants_value) = obj.get("_variants") { [INFO] [stdout] 245 | | if let Some(variants) = variants_value.as_array() { [INFO] [stdout] 246 | | debug!("Processing localization with locale: {}", locale); [INFO] [stdout] ... | [INFO] [stdout] 288 | | } [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] 244 ~ if let Some(variants_value) = obj.get("_variants") [INFO] [stdout] 245 ~ && let Some(variants) = variants_value.as_array() { [INFO] [stdout] 246 | debug!("Processing localization with locale: {}", locale); [INFO] [stdout] ... [INFO] [stdout] 286 | obj.remove("_variants"); [INFO] [stdout] 287 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/targets/payload.rs:256:25 [INFO] [stdout] | [INFO] [stdout] 256 | / if let Some(variant_obj) = variant.as_object() { [INFO] [stdout] 257 | | if let Some(language) = [INFO] [stdout] 258 | | variant_obj.get("language").and_then(|v| v.as_str()) [INFO] [stdout] ... | [INFO] [stdout] 277 | | } [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] 256 ~ if let Some(variant_obj) = variant.as_object() [INFO] [stdout] 257 ~ && let Some(language) = [INFO] [stdout] 258 | variant_obj.get("language").and_then(|v| v.as_str()) [INFO] [stdout] ... [INFO] [stdout] 275 | } [INFO] [stdout] 276 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/targets/payload.rs:257:29 [INFO] [stdout] | [INFO] [stdout] 257 | / ... if let Some(language) = [INFO] [stdout] 258 | | ... variant_obj.get("language").and_then(|v| v.as_str()) [INFO] [stdout] 259 | | ... { [INFO] [stdout] 260 | | ... if language == locale { [INFO] [stdout] ... | [INFO] [stdout] 276 | | ... } [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] 258 ~ variant_obj.get("language").and_then(|v| v.as_str()) [INFO] [stdout] 259 ~ && language == locale { [INFO] [stdout] 260 | debug!("Found matching locale variant: {}", locale); [INFO] [stdout] ... [INFO] [stdout] 273 | break; [INFO] [stdout] 274 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/targets/payload.rs:264:37 [INFO] [stdout] | [INFO] [stdout] 264 | / ... if let Some(properties) = variant_obj.get("properties") { [INFO] [stdout] 265 | | ... if let Some(props_obj) = properties.as_object() { [INFO] [stdout] 266 | | ... // Collect properties to insert [INFO] [stdout] 267 | | ... for (key, value) in props_obj { [INFO] [stdout] ... | [INFO] [stdout] 272 | | ... } [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] 264 ~ if let Some(properties) = variant_obj.get("properties") [INFO] [stdout] 265 ~ && let Some(props_obj) = properties.as_object() { [INFO] [stdout] 266 | // Collect properties to insert [INFO] [stdout] ... [INFO] [stdout] 270 | } [INFO] [stdout] 271 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/targets/payload.rs:304:17 [INFO] [stdout] | [INFO] [stdout] 304 | / if let Some(field_obj) = value.as_object() { [INFO] [stdout] 305 | | if let Some(field_type) = field_obj.get("type").and_then(|v| v.as_str()) { [INFO] [stdout] 306 | | if !self.field_type_mappings.contains_key(field_type) { [INFO] [stdout] 307 | | warn!("Field '{}' has unknown type: {}", key, field_type); [INFO] [stdout] ... | [INFO] [stdout] 310 | | } [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] 304 ~ if let Some(field_obj) = value.as_object() [INFO] [stdout] 305 ~ && let Some(field_type) = field_obj.get("type").and_then(|v| v.as_str()) { [INFO] [stdout] 306 | if !self.field_type_mappings.contains_key(field_type) { [INFO] [stdout] 307 | warn!("Field '{}' has unknown type: {}", key, field_type); [INFO] [stdout] 308 | } [INFO] [stdout] 309 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/targets/payload.rs:305:21 [INFO] [stdout] | [INFO] [stdout] 305 | / if let Some(field_type) = field_obj.get("type").and_then(|v| v.as_str()) { [INFO] [stdout] 306 | | if !self.field_type_mappings.contains_key(field_type) { [INFO] [stdout] 307 | | warn!("Field '{}' has unknown type: {}", key, field_type); [INFO] [stdout] 308 | | } [INFO] [stdout] 309 | | } [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] 305 ~ if let Some(field_type) = field_obj.get("type").and_then(|v| v.as_str()) [INFO] [stdout] 306 ~ && !self.field_type_mappings.contains_key(field_type) { [INFO] [stdout] 307 | warn!("Field '{}' has unknown type: {}", key, field_type); [INFO] [stdout] 308 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/parser/tests.rs:874:17 [INFO] [stdout] | [INFO] [stdout] 874 | assert!(template.fields.len() >= 1); // At least some fields should be parsed [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!template.fields.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/parser/tests.rs:876:46 [INFO] [stdout] | [INFO] [stdout] 876 | assert!(template.hooks.is_empty() || template.hooks.len() >= 1); // Hooks might not be parsed yet [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!template.hooks.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/parser/tests.rs:877:56 [INFO] [stdout] | [INFO] [stdout] 877 | ...mplate.access_controls.is_empty() || template.access_controls.len() >= 1); // Access controls might not be parsed yet [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!template.access_controls.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/targets/payload.rs:387:21 [INFO] [stdout] | [INFO] [stdout] 387 | buf.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `buf.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] = note: `#[warn(clippy::single_char_add_str)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/targets/payload.rs:392:25 [INFO] [stdout] | [INFO] [stdout] 392 | buf.push_str("\n"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `buf.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/targets/payload.rs:467:1 [INFO] [stdout] | [INFO] [stdout] 467 | / impl Default for PayloadTargetState { [INFO] [stdout] 468 | | fn default() -> Self { [INFO] [stdout] 469 | | Self { [INFO] [stdout] 470 | | config: None, [INFO] [stdout] ... | [INFO] [stdout] 474 | | } [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] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 460 + #[derive(Default)] [INFO] [stdout] 461 | pub struct PayloadTargetState { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/targets/payload.rs:543:17 [INFO] [stdout] | [INFO] [stdout] 543 | / if let Some(parent) = output_path.parent() { [INFO] [stdout] 544 | | if !parent.exists() { [INFO] [stdout] 545 | | return Err(anyhow::anyhow!( [INFO] [stdout] 546 | | "Parent directory does not exist: {}", [INFO] [stdout] ... | [INFO] [stdout] 550 | | } [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] 543 ~ if let Some(parent) = output_path.parent() [INFO] [stdout] 544 ~ && !parent.exists() { [INFO] [stdout] 545 | return Err(anyhow::anyhow!( [INFO] [stdout] ... [INFO] [stdout] 548 | )); [INFO] [stdout] 549 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: file opened with `create`, but `truncate` behavior not defined [INFO] [stdout] --> src/targets/payload.rs:646:18 [INFO] [stdout] | [INFO] [stdout] 646 | .create(true) [INFO] [stdout] | ^^^^^^^^^^^^- help: add: `.truncate(true)` [INFO] [stdout] | [INFO] [stdout] = help: if you intend to overwrite an existing file entirely, call `.truncate(true)` [INFO] [stdout] = help: if you instead know that you may want to keep some parts of the old file, call `.truncate(false)` [INFO] [stdout] = help: alternatively, use `.append(true)` to append to the file instead of overwriting it [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options [INFO] [stdout] = note: `#[warn(clippy::suspicious_open_options)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/performance/mod.rs:227:28 [INFO] [stdout] | [INFO] [stdout] 227 | let memory_stats = self.get_memory_stats().unwrap_or_else(|_| MemoryStats { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 228 | | current_mb: 0.0, [INFO] [stdout] 229 | | peak_mb: 0.0, [INFO] [stdout] 230 | | available_mb: 1024.0, // Default to 1GB [INFO] [stdout] 231 | | total_mb: 2048.0, [INFO] [stdout] 232 | | usage_percentage: 0.0, [INFO] [stdout] 233 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] = note: `#[warn(clippy::unnecessary_lazy_evaluations)]` on by default [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 227 ~ let memory_stats = self.get_memory_stats().unwrap_or(MemoryStats { [INFO] [stdout] 228 + current_mb: 0.0, [INFO] [stdout] 229 + peak_mb: 0.0, [INFO] [stdout] 230 + available_mb: 1024.0, // Default to 1GB [INFO] [stdout] 231 + total_mb: 2048.0, [INFO] [stdout] 232 + usage_percentage: 0.0, [INFO] [stdout] 233 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Result::Err` [INFO] [stdout] --> src/performance/mod.rs:312:28 [INFO] [stdout] | [INFO] [stdout] 312 | let memory_stats = self.get_memory_stats().unwrap_or_else(|_| MemoryStats { [INFO] [stdout] | ____________________________^ [INFO] [stdout] 313 | | current_mb: 0.0, [INFO] [stdout] 314 | | peak_mb: 0.0, [INFO] [stdout] 315 | | available_mb: 0.0, [INFO] [stdout] 316 | | total_mb: 0.0, [INFO] [stdout] 317 | | usage_percentage: 0.0, [INFO] [stdout] 318 | | }); [INFO] [stdout] | |__________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_lazy_evaluations [INFO] [stdout] help: use `unwrap_or` instead [INFO] [stdout] | [INFO] [stdout] 312 ~ let memory_stats = self.get_memory_stats().unwrap_or(MemoryStats { [INFO] [stdout] 313 + current_mb: 0.0, [INFO] [stdout] 314 + peak_mb: 0.0, [INFO] [stdout] 315 + available_mb: 0.0, [INFO] [stdout] 316 + total_mb: 0.0, [INFO] [stdout] 317 + usage_percentage: 0.0, [INFO] [stdout] 318 ~ }); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `PluginManager` [INFO] [stdout] --> src/plugin.rs:44:5 [INFO] [stdout] | [INFO] [stdout] 44 | / pub fn new() -> Self { [INFO] [stdout] 45 | | PluginManager { [INFO] [stdout] 46 | | sources: HashMap::new(), [INFO] [stdout] 47 | | targets: HashMap::new(), [INFO] [stdout] ... | [INFO] [stdout] 50 | | } [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] 42 + impl Default for PluginManager { [INFO] [stdout] 43 + fn default() -> Self { [INFO] [stdout] 44 + Self::new() [INFO] [stdout] 45 + } [INFO] [stdout] 46 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/plugin.rs:152:52 [INFO] [stdout] | [INFO] [stdout] 152 | pub fn get_source(&self, name: &str) -> Option<&Box> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&dyn SourceReader` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] = note: `#[warn(clippy::borrowed_box)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/plugin.rs:157:52 [INFO] [stdout] | [INFO] [stdout] 157 | pub fn get_target(&self, name: &str) -> Option<&Box> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `&dyn TargetWriter` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/umbraco.rs:57:17 [INFO] [stdout] | [INFO] [stdout] 57 | / if let Some(nested_arr) = value.get("contentData").and_then(|v| v.as_array()) { [INFO] [stdout] 58 | | if !nested_arr.is_empty() { [INFO] [stdout] 59 | | debug!("Found nested content in field: {}", key); [INFO] [stdout] ... | [INFO] [stdout] 75 | | } [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] 57 ~ if let Some(nested_arr) = value.get("contentData").and_then(|v| v.as_array()) [INFO] [stdout] 58 ~ && !nested_arr.is_empty() { [INFO] [stdout] 59 | debug!("Found nested content in field: {}", key); [INFO] [stdout] ... [INFO] [stdout] 73 | }); [INFO] [stdout] 74 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/umbraco.rs:110:17 [INFO] [stdout] | [INFO] [stdout] 110 | / if let Some(content_type) = value.get("contentType").and_then(|v| v.as_str()) { [INFO] [stdout] 111 | | if self.content_type_mappings.get(content_type) == Some(&"media".to_string()) { [INFO] [stdout] 112 | | debug!("Found media reference in field: {}", key); [INFO] [stdout] ... | [INFO] [stdout] 132 | | } [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] 110 ~ if let Some(content_type) = value.get("contentType").and_then(|v| v.as_str()) [INFO] [stdout] 111 ~ && self.content_type_mappings.get(content_type) == Some(&"media".to_string()) { [INFO] [stdout] 112 | debug!("Found media reference in field: {}", key); [INFO] [stdout] ... [INFO] [stdout] 130 | }); [INFO] [stdout] 131 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/umbraco.rs:167:17 [INFO] [stdout] | [INFO] [stdout] 167 | / if let Some(content_type) = value.get("contentType").and_then(|v| v.as_str()) { [INFO] [stdout] 168 | | if self.content_type_mappings.get(content_type) == Some(&"link".to_string()) { [INFO] [stdout] 169 | | debug!("Found link in field: {}", key); [INFO] [stdout] ... | [INFO] [stdout] 185 | | } [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] 167 ~ if let Some(content_type) = value.get("contentType").and_then(|v| v.as_str()) [INFO] [stdout] 168 ~ && self.content_type_mappings.get(content_type) == Some(&"link".to_string()) { [INFO] [stdout] 169 | debug!("Found link in field: {}", key); [INFO] [stdout] ... [INFO] [stdout] 183 | }); [INFO] [stdout] 184 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/umbraco.rs:218:13 [INFO] [stdout] | [INFO] [stdout] 218 | / if let Some(variants_value) = obj.get("variants") { [INFO] [stdout] 219 | | if let Some(variants) = variants_value.as_array() { [INFO] [stdout] 220 | | debug!("Found content variants"); [INFO] [stdout] ... | [INFO] [stdout] 269 | | } [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] 218 ~ if let Some(variants_value) = obj.get("variants") [INFO] [stdout] 219 ~ && let Some(variants) = variants_value.as_array() { [INFO] [stdout] 220 | debug!("Found content variants"); [INFO] [stdout] ... [INFO] [stdout] 267 | obj.insert("_variants".to_string(), json!(processed_variants)); [INFO] [stdout] 268 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/umbraco.rs:226:21 [INFO] [stdout] | [INFO] [stdout] 226 | / if let Some(default_variant) = variants_clone.first() { [INFO] [stdout] 227 | | if let Some(variant_obj) = default_variant.as_object() { [INFO] [stdout] 228 | | // Collect properties to insert [INFO] [stdout] 229 | | let properties_to_insert: Vec<(String, Value)> = variant_obj [INFO] [stdout] ... | [INFO] [stdout] 244 | | } [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] 226 ~ if let Some(default_variant) = variants_clone.first() [INFO] [stdout] 227 ~ && let Some(variant_obj) = default_variant.as_object() { [INFO] [stdout] 228 | // Collect properties to insert [INFO] [stdout] ... [INFO] [stdout] 242 | } [INFO] [stdout] 243 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/umbraco.rs:327:9 [INFO] [stdout] | [INFO] [stdout] 327 | / if !found_content { [INFO] [stdout] 328 | | if let Some(arr) = json.as_array() { [INFO] [stdout] 329 | | info!("Using root array with {} items", arr.len()); [INFO] [stdout] 330 | | for item in arr { [INFO] [stdout] ... | [INFO] [stdout] 335 | | } [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] 327 ~ if !found_content [INFO] [stdout] 328 ~ && let Some(arr) = json.as_array() { [INFO] [stdout] 329 | info!("Using root array with {} items", arr.len()); [INFO] [stdout] ... [INFO] [stdout] 333 | found_content = true; [INFO] [stdout] 334 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/sources/wordpress/api_connector.rs:71:21 [INFO] [stdout] | [INFO] [stdout] 71 | / if r.status().as_u16() == 429 || r.status().is_server_error() { [INFO] [stdout] 72 | | if attempt < max_retries { [INFO] [stdout] 73 | | attempt += 1; [INFO] [stdout] 74 | | info!("HTTP {} on {}; retrying {}/{} after {}ms", r.status(), url, attempt, max_retries, backoff_ms); [INFO] [stdout] ... | [INFO] [stdout] 79 | | } [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] 71 ~ if (r.status().as_u16() == 429 || r.status().is_server_error()) { [INFO] [stdout] 72 ~ && attempt < max_retries { [INFO] [stdout] 73 | attempt += 1; [INFO] [stdout] ... [INFO] [stdout] 77 | continue; [INFO] [stdout] 78 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: structure field `relationTo` should have a snake case name [INFO] [stdout] --> src/parser/schema.rs:48:20 [INFO] [stdout] | [INFO] [stdout] 48 | Relationship { relationTo: String }, [INFO] [stdout] | ^^^^^^^^^^ help: convert the identifier to snake case: `relation_to` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: structure field `relationTo` should have a snake case name [INFO] [stdout] --> src/parser/schema.rs:53:14 [WARN] too many lines in the log, truncating it