[INFO] fetching crate pact_models 1.3.8... [INFO] linting pact_models-1.3.8 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate pact_models 1.3.8 into /workspace/builds/worker-5-tc1/source [INFO] started tweaking crates.io crate pact_models 1.3.8 [INFO] removed 0 missing tests [INFO] finished tweaking crates.io crate pact_models 1.3.8 [INFO] tweaked toml for crates.io crate pact_models 1.3.8 written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate pact_models 1.3.8 on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate crates.io crate pact_models 1.3.8 already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded logos-derive v0.16.1 [INFO] [stderr] Downloaded lenient_semver_parser v0.4.2 [INFO] [stderr] Downloaded gregorian v0.2.4 [INFO] [stderr] Downloaded expectest v0.12.0 [INFO] [stderr] Downloaded lenient_semver_version_builder v0.4.2 [INFO] [stderr] Downloaded speculate v0.1.2 [INFO] [stderr] Downloaded hamcrest2 v0.3.0 [INFO] [stderr] Downloaded indextree v4.7.4 [INFO] [stderr] Downloaded kiss_xml v1.0.6 [INFO] [stderr] Downloaded logos-codegen v0.16.1 [INFO] [stderr] Downloaded logos v0.16.1 [INFO] [stderr] Downloaded trim-margin v0.1.0 [INFO] [stderr] Downloaded syn v0.14.9 [INFO] [stderr] Downloaded indextree-macros v0.1.3 [INFO] [stderr] Downloaded rand_regex v0.18.1 [INFO] [stderr] Downloaded lenient_semver v0.4.2 [INFO] [stderr] Downloaded hashers v1.0.1 [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] 40b0005400e28952a7acc73cbc2cbc929f0c42f2a821ba9e94f849126b4c02df [INFO] running `Command { std: "docker" "start" "-a" "40b0005400e28952a7acc73cbc2cbc929f0c42f2a821ba9e94f849126b4c02df", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "40b0005400e28952a7acc73cbc2cbc929f0c42f2a821ba9e94f849126b4c02df", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "40b0005400e28952a7acc73cbc2cbc929f0c42f2a821ba9e94f849126b4c02df", kill_on_drop: false }` [INFO] [stdout] 40b0005400e28952a7acc73cbc2cbc929f0c42f2a821ba9e94f849126b4c02df [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] 637203b3321da66a231db49aae1c4f3ba31ee90d2aac3a20cc2915dd5adc760d [INFO] running `Command { std: "docker" "start" "-a" "637203b3321da66a231db49aae1c4f3ba31ee90d2aac3a20cc2915dd5adc760d", kill_on_drop: false }` [INFO] [stderr] Compiling syn v2.0.116 [INFO] [stderr] Compiling libc v0.2.182 [INFO] [stderr] Compiling memchr v2.8.0 [INFO] [stderr] Checking futures-sink v0.3.32 [INFO] [stderr] Compiling cc v1.2.56 [INFO] [stderr] Checking regex-automata v0.4.14 [INFO] [stderr] Compiling rustls v0.23.36 [INFO] [stderr] Compiling num-bigint v0.2.6 [INFO] [stderr] Compiling thiserror v2.0.18 [INFO] [stderr] Compiling toml_parser v1.0.9+spec-1.1.0 [INFO] [stderr] Compiling num-rational v0.2.4 [INFO] [stderr] Compiling num-complex v0.2.4 [INFO] [stderr] Compiling either v1.15.0 [INFO] [stderr] Checking futures-channel v0.3.32 [INFO] [stderr] Compiling getrandom v0.4.1 [INFO] [stderr] Checking semver v1.0.27 [INFO] [stderr] Checking siphasher v1.0.2 [INFO] [stderr] Compiling chrono-tz v0.10.4 [INFO] [stderr] Checking phf_shared v0.12.1 [INFO] [stderr] Compiling maplit v1.0.2 [INFO] [stderr] Checking yansi v1.0.1 [INFO] [stderr] Checking chrono v0.4.43 [INFO] [stderr] Checking phf v0.12.1 [INFO] [stderr] Compiling anyhow v1.0.101 [INFO] [stderr] Checking fxhash v0.2.1 [INFO] [stderr] Checking num-iter v0.1.45 [INFO] [stderr] Checking env_filter v1.0.0 [INFO] [stderr] Compiling itertools v0.14.0 [INFO] [stderr] Checking typed-arena v1.7.0 [INFO] [stderr] Checking unicode-width v0.2.2 [INFO] [stderr] Checking lenient_semver_version_builder v0.4.2 [INFO] [stderr] Checking peresil v0.3.0 [INFO] [stderr] Checking nom v7.1.3 [INFO] [stderr] Checking hashers v1.0.1 [INFO] [stderr] Checking lenient_semver_parser v0.4.2 [INFO] [stderr] Checking sxd-document v0.3.2 [INFO] [stderr] Checking env_logger v0.11.9 [INFO] [stderr] Compiling syn v0.14.9 [INFO] [stderr] Checking ariadne v0.6.0 [INFO] [stderr] Checking lenient_semver v0.4.2 [INFO] [stderr] Compiling toml_edit v0.23.10+spec-1.0.0 [INFO] [stderr] Checking pretty_assertions v1.4.1 [INFO] [stderr] Checking expectest v0.12.0 [INFO] [stderr] Checking trim-margin v0.1.0 [INFO] [stderr] Compiling aho-corasick v1.1.4 [INFO] [stderr] Checking mio v1.1.1 [INFO] [stderr] Checking socket2 v0.6.2 [INFO] [stderr] Checking getrandom v0.2.17 [INFO] [stderr] Checking getrandom v0.3.4 [INFO] [stderr] Checking uuid v1.21.0 [INFO] [stderr] Checking rand_core v0.9.5 [INFO] [stderr] Checking num v0.2.1 [INFO] [stderr] Checking gregorian v0.2.4 [INFO] [stderr] Checking fs2 v0.4.3 [INFO] [stderr] Checking rand_chacha v0.9.0 [INFO] [stderr] Compiling ring v0.17.14 [INFO] [stderr] Compiling onig_sys v69.9.1 [INFO] [stderr] Compiling proc-macro-crate v3.4.0 [INFO] [stderr] Checking rand v0.9.2 [INFO] [stderr] Checking rand_regex v0.18.1 [INFO] [stderr] Checking regex v1.12.3 [INFO] [stderr] Checking matchers v0.2.0 [INFO] [stderr] Compiling speculate v0.1.2 [INFO] [stderr] Checking kiss_xml v1.0.6 [INFO] [stderr] Checking hamcrest2 v0.3.0 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Checking rustls-webpki v0.103.9 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Compiling yoke-derive v0.8.1 [INFO] [stderr] Compiling zerovec-derive v0.11.2 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling futures-macro v0.3.32 [INFO] [stderr] Compiling tracing-attributes v0.1.31 [INFO] [stderr] Compiling thiserror-impl v2.0.18 [INFO] [stderr] Compiling strum_macros v0.27.2 [INFO] [stderr] Compiling test-log-macros v0.2.19 [INFO] [stderr] Checking onig v6.5.1 [INFO] [stderr] Checking futures-util v0.3.32 [INFO] [stderr] Compiling logos-codegen v0.16.1 [INFO] [stderr] Checking tracing v0.1.44 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Checking yoke v0.8.1 [INFO] [stderr] Compiling parse-zoneinfo v0.3.1 [INFO] [stderr] Checking zerovec v0.11.5 [INFO] [stderr] Checking zerotrie v0.2.3 [INFO] [stderr] Checking tracing-subscriber v0.3.22 [INFO] [stderr] Compiling rstest_macros v0.26.1 [INFO] [stderr] Checking tinystr v0.8.2 [INFO] [stderr] Checking potential_utf v0.1.4 [INFO] [stderr] Compiling strum v0.27.2 [INFO] [stderr] Checking icu_collections v2.1.1 [INFO] [stderr] Checking icu_locale_core v2.1.1 [INFO] [stderr] Compiling indextree-macros v0.1.3 [INFO] [stderr] Compiling pact_models v1.3.8 (/opt/rustwide/workdir) [INFO] [stderr] Compiling logos-derive v0.16.1 [INFO] [stderr] Checking logos v0.16.1 [INFO] [stderr] Checking test-log v0.2.19 [INFO] [stderr] Checking indextree v4.7.4 [INFO] [stderr] Checking icu_provider v2.1.1 [INFO] [stderr] Checking icu_properties v2.1.2 [INFO] [stderr] Checking icu_normalizer v2.1.1 [INFO] [stderr] Checking serde v1.0.228 [INFO] [stderr] Checking bytes v1.11.1 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking http v1.4.0 [INFO] [stderr] Checking tokio v1.49.0 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Checking idna v1.1.0 [INFO] [stderr] Checking http-body v1.0.1 [INFO] [stderr] Checking http-body-util v0.1.3 [INFO] [stderr] Checking url v2.5.8 [INFO] [stderr] Checking rstest v0.26.1 [INFO] [stderr] Checking hyper v1.8.1 [INFO] [stderr] Checking tower v0.5.3 [INFO] [stderr] Checking tokio-rustls v0.26.4 [INFO] [stderr] Checking tower-http v0.6.8 [INFO] [stderr] Checking hyper-util v0.1.20 [INFO] [stderr] Checking hyper-rustls v0.27.7 [INFO] [stderr] Checking reqwest v0.12.28 [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/content_types.rs:71:28 [INFO] [stdout] | [INFO] [stdout] 71 | const KNOWN_TEXT_TYPES: [(&'static str, &'static str); 1] = [ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/content_types.rs:71:42 [INFO] [stdout] | [INFO] [stdout] 71 | const KNOWN_TEXT_TYPES: [(&'static str, &'static str); 1] = [ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is an `else {..}` but the formatting might hide it [INFO] [stdout] --> src/v4/pact.rs:377:20 [INFO] [stdout] | [INFO] [stdout] 377 | } else [INFO] [stdout] | ____________________^ [INFO] [stdout] 378 | | { [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = note: to remove this lint, remove the `else` or remove the new line between `else` and `{..}` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stdout] = note: `#[warn(clippy::suspicious_else_formatting)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/content_types.rs:71:28 [INFO] [stdout] | [INFO] [stdout] 71 | const KNOWN_TEXT_TYPES: [(&'static str, &'static str); 1] = [ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] = note: `#[warn(clippy::redundant_static_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: constants have by default a `'static` lifetime [INFO] [stdout] --> src/content_types.rs:71:42 [INFO] [stdout] | [INFO] [stdout] 71 | const KNOWN_TEXT_TYPES: [(&'static str, &'static str); 1] = [ [INFO] [stdout] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_static_lifetimes [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this is an `else {..}` but the formatting might hide it [INFO] [stdout] --> src/v4/pact.rs:377:20 [INFO] [stdout] | [INFO] [stdout] 377 | } else [INFO] [stdout] | ____________________^ [INFO] [stdout] 378 | | { [INFO] [stdout] | |__________________^ [INFO] [stdout] | [INFO] [stdout] = note: to remove this lint, remove the `else` or remove the new line between `else` and `{..}` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_else_formatting [INFO] [stdout] = note: `#[warn(clippy::suspicious_else_formatting)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/lib.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | //! `chronos` crate as a dependency. [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] = note: `#[warn(clippy::doc_lazy_continuation)]` on by default [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 8 | //! `chronos` crate as a dependency. [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/lib.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | //! crate as a dependency. [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 10 | //! crate as a dependency. [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct update has no effect, all the fields in the struct have already been specified [INFO] [stdout] --> src/content_types.rs:227:10 [INFO] [stdout] | [INFO] [stdout] 227 | .. ContentType::default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update [INFO] [stdout] = note: `#[warn(clippy::needless_update)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/content_types.rs:240:1 [INFO] [stdout] | [INFO] [stdout] 240 | impl Into for &ContentType { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] = note: `#[warn(clippy::from_over_into)]` on by default [INFO] [stdout] help: replace the `Into` implementation with `From<&content_types::ContentType>` [INFO] [stdout] | [INFO] [stdout] 240 ~ impl From<&ContentType> for String { [INFO] [stdout] 241 ~ fn from(val: &ContentType) -> Self { [INFO] [stdout] 242 ~ val.to_string() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/content_types.rs:300:39 [INFO] [stdout] | [INFO] [stdout] 300 | } else if is_match(&HTMLREGEXP, &*s.to_uppercase()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `&s.to_uppercase()` [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 `impl` can be derived [INFO] [stdout] --> src/content_types.rs:322:1 [INFO] [stdout] | [INFO] [stdout] 322 | / impl Default for ContentTypeHint { [INFO] [stdout] 323 | | fn default() -> Self { [INFO] [stdout] 324 | | ContentTypeHint::DEFAULT [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#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 316 + #[derive(Default)] [INFO] [stdout] 317 | pub enum ContentTypeHint { [INFO] [stdout] 318 | BINARY, [INFO] [stdout] 319 | TEXT, [INFO] [stdout] 320 ~ #[default] [INFO] [stdout] 321 ~ DEFAULT [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/bodies.rs:121:88 [INFO] [stdout] | [INFO] [stdout] 121 | OptionalBody::Present(b, _, h) => OptionalBody::Present(b.clone(), content_type, h.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*h` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/bodies.rs:132:71 [INFO] [stdout] | [INFO] [stdout] 132 | OptionalBody::Present(b.clone(), ct.clone().or(content_type), h.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*h` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/bodies.rs:261:1 [INFO] [stdout] | [INFO] [stdout] 261 | / impl Default for OptionalBody { [INFO] [stdout] 262 | | fn default() -> Self { [INFO] [stdout] 263 | | OptionalBody::Missing [INFO] [stdout] 264 | | } [INFO] [stdout] 265 | | } [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 and mark the default variant [INFO] [stdout] | [INFO] [stdout] 21 + #[derive(Default)] [INFO] [stdout] 22 | pub enum OptionalBody { [INFO] [stdout] 23 | /// A body is missing if it is not present in the pact file [INFO] [stdout] 24 ~ #[default] [INFO] [stdout] 25 ~ Missing, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/v4/http_parts.rs:357:41 [INFO] [stdout] | [INFO] [stdout] 357 | buf.extend_from_slice(&*body_bytes); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&body_bytes` [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: redundant closure [INFO] [stdout] --> src/v4/interaction.rs:34:42 [INFO] [stdout] | [INFO] [stdout] 34 | markup: values.get("markup").map(|val| json_to_string(val)).unwrap_or_default(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [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: redundant closure [INFO] [stdout] --> src/v4/interaction.rs:35:51 [INFO] [stdout] | [INFO] [stdout] 35 | markup_type: values.get("markupType").map(|val| json_to_string(val)).unwrap_or_default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/synch_http.rs:78:36 [INFO] [stdout] | [INFO] [stdout] 78 | let id = json.get("_id").map(|id| json_to_string(id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/synch_http.rs:79:37 [INFO] [stdout] | [INFO] [stdout] 79 | let key = json.get("key").map(|id| json_to_string(id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/synch_http.rs:107:14 [INFO] [stdout] | [INFO] [stdout] 107 | .map(|markup| InteractionMarkup::from_json(markup)).unwrap_or_default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `InteractionMarkup::from_json` [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/v4/message_parts.rs:41:14 [INFO] [stdout] | [INFO] [stdout] 41 | Some(&Value::Object(ref v)) => v.iter().map(|(k, v)| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 41 - Some(&Value::Object(ref v)) => v.iter().map(|(k, v)| { [INFO] [stdout] 41 + Some(Value::Object(v)) => v.iter().map(|(k, v)| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/sync_message.rs:79:36 [INFO] [stdout] | [INFO] [stdout] 79 | let id = json.get("_id").map(|id| json_to_string(id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/sync_message.rs:80:37 [INFO] [stdout] | [INFO] [stdout] 80 | let key = json.get("key").map(|id| json_to_string(id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/sync_message.rs:110:16 [INFO] [stdout] | [INFO] [stdout] 110 | .map(|message| MessageContents::from_json(message)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `MessageContents::from_json` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/sync_message.rs:115:14 [INFO] [stdout] | [INFO] [stdout] 115 | .map(|markup| InteractionMarkup::from_json(markup)).unwrap_or_default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `InteractionMarkup::from_json` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/async_message.rs:88:36 [INFO] [stdout] | [INFO] [stdout] 88 | let id = json.get("_id").map(|id| json_to_string(id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/async_message.rs:89:37 [INFO] [stdout] | [INFO] [stdout] 89 | let key = json.get("key").map(|id| json_to_string(id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/v4/async_message.rs:112:14 [INFO] [stdout] | [INFO] [stdout] 112 | Some(&Value::Object(ref v)) => v.iter().map(|(k, v)| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 112 - Some(&Value::Object(ref v)) => v.iter().map(|(k, v)| { [INFO] [stdout] 112 + Some(Value::Object(v)) => v.iter().map(|(k, v)| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/async_message.rs:121:14 [INFO] [stdout] | [INFO] [stdout] 121 | .map(|markup| InteractionMarkup::from_json(markup)).unwrap_or_default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `InteractionMarkup::from_json` [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/v4/async_message.rs:299:5 [INFO] [stdout] | [INFO] [stdout] 299 | / if let Some(content_type) = self.contents.contents.content_type() { [INFO] [stdout] 300 | | if let Vacant(entry) = metadata.entry("contentType".to_string()) { [INFO] [stdout] 301 | | entry.insert(json!( content_type.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] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 299 ~ if let Some(content_type) = self.contents.contents.content_type() [INFO] [stdout] 300 ~ && let Vacant(entry) = metadata.entry("contentType".to_string()) { [INFO] [stdout] 301 | entry.insert(json!( content_type.to_string() )); [INFO] [stdout] 302 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/v4/pact.rs:134:74 [INFO] [stdout] | [INFO] [stdout] 134 | pub fn find_interaction_with_id(&self, interaction_id: &str) -> Option<&Box> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn V4Interaction + Send + Sync + RefUnwindSafe)` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/v4/pact.rs:146:44 [INFO] [stdout] | [INFO] [stdout] 146 | let mut metadata = meta_data_from_json(&json); [INFO] [stdout] | ^^^^^ help: change this to: `json` [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/v4/pact.rs:162:44 [INFO] [stdout] | [INFO] [stdout] 162 | interactions: interactions_from_json(&json, source)?, [INFO] [stdout] | ^^^^^ help: change this to: `json` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/v4/pact.rs:187:26 [INFO] [stdout] | [INFO] [stdout] 187 | self.metadata.iter().map(|(k, v)| { [INFO] [stdout] | __________________________^ [INFO] [stdout] 188 | | match v { [INFO] [stdout] 189 | | Value::Object(map) => Some((k.clone(), map.iter() [INFO] [stdout] 190 | | .map(|(k, v)| (k.clone(), json_to_string(v))).collect())), [INFO] [stdout] ... | [INFO] [stdout] 193 | | }).flatten() [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] help: try replacing `map` with `filter_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 187 ~ self.metadata.iter().filter_map(|(k, v)| { [INFO] [stdout] 188 + match v { [INFO] [stdout] 189 + Value::Object(map) => Some((k.clone(), map.iter() [INFO] [stdout] 190 + .map(|(k, v)| (k.clone(), json_to_string(v))).collect())), [INFO] [stdout] 191 + _ => None [INFO] [stdout] 192 + } [INFO] [stdout] 193 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/v4/pact.rs:222:8 [INFO] [stdout] | [INFO] [stdout] 222 | .map(|i| i.as_request_response()) [INFO] [stdout] | ________^ [INFO] [stdout] 223 | | .flatten() [INFO] [stdout] | |________________^ help: try replacing `map` with `filter_map` and remove the `.flatten()`: `filter_map(|i| i.as_request_response())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/v4/pact.rs:225:41 [INFO] [stdout] | [INFO] [stdout] 225 | let metadata = self.metadata.iter().map(|(k, v)| { [INFO] [stdout] | _________________________________________^ [INFO] [stdout] 226 | | if k == "pactSpecification" { [INFO] [stdout] 227 | | Some((k.clone(), btreemap!{"version".to_string() => PactSpecification::V3.version_str()})) [INFO] [stdout] 228 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 235 | | }).flatten() [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `filter_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 225 ~ let metadata = self.metadata.iter().filter_map(|(k, v)| { [INFO] [stdout] 226 + if k == "pactSpecification" { [INFO] [stdout] 227 + Some((k.clone(), btreemap!{"version".to_string() => PactSpecification::V3.version_str()})) [INFO] [stdout] 228 + } else { [INFO] [stdout] 229 + match v { [INFO] [stdout] 230 + Value::Object(map) => Some((k.clone(), map.iter() [INFO] [stdout] 231 + .map(|(k, v)| (k.clone(), json_to_string(v))).collect())), [INFO] [stdout] 232 + _ => None [INFO] [stdout] 233 + } [INFO] [stdout] 234 + } [INFO] [stdout] 235 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/v4/pact.rs:248:8 [INFO] [stdout] | [INFO] [stdout] 248 | .map(|i| i.as_message()) [INFO] [stdout] | ________^ [INFO] [stdout] 249 | | .flatten() [INFO] [stdout] | |________________^ help: try replacing `map` with `filter_map` and remove the `.flatten()`: `filter_map(|i| i.as_message())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/v4/pact.rs:251:41 [INFO] [stdout] | [INFO] [stdout] 251 | let metadata = self.metadata.iter().map(|(k, v)| { [INFO] [stdout] | _________________________________________^ [INFO] [stdout] 252 | | match v { [INFO] [stdout] 253 | | Value::Object(map) => Some((k.clone(), map.iter() [INFO] [stdout] 254 | | .map(|(k, v)| (k.clone(), json_to_string(v))).collect())), [INFO] [stdout] ... | [INFO] [stdout] 257 | | }).flatten() [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `filter_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 251 ~ let metadata = self.metadata.iter().filter_map(|(k, v)| { [INFO] [stdout] 252 + match v { [INFO] [stdout] 253 + Value::Object(map) => Some((k.clone(), map.iter() [INFO] [stdout] 254 + .map(|(k, v)| (k.clone(), json_to_string(v))).collect())), [INFO] [stdout] 255 + _ => None [INFO] [stdout] 256 + } [INFO] [stdout] 257 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/v4/pact.rs:337:1 [INFO] [stdout] | [INFO] [stdout] 337 | / impl Default for V4Pact { [INFO] [stdout] 338 | | fn default() -> Self { [INFO] [stdout] 339 | | V4Pact { [INFO] [stdout] 340 | | consumer: Default::default(), [INFO] [stdout] ... | [INFO] [stdout] 347 | | } [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] 32 + #[derive(Default)] [INFO] [stdout] 33 | pub struct V4Pact { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/v4/pact.rs:356:33 [INFO] [stdout] | [INFO] [stdout] 356 | Self::pact_from_json(&json, &*path.to_string_lossy()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&path.to_string_lossy()` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/v4/pact.rs:430:57 [INFO] [stdout] | [INFO] [stdout] 430 | ... &format!("Must be an Object, got {}", json_type_of(pact_json)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Must be an Object, got {}", json_type_of(pact_json))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/v4/mod.rs:32:1 [INFO] [stdout] | [INFO] [stdout] 32 | / impl Default for V4InteractionType { [INFO] [stdout] 33 | | fn default() -> Self { [INFO] [stdout] 34 | | V4InteractionType::Synchronous_HTTP [INFO] [stdout] 35 | | } [INFO] [stdout] 36 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 23 + #[derive(Default)] [INFO] [stdout] 24 | pub enum V4InteractionType { [INFO] [stdout] 25 | /// Synchronous HTTP Request Response [INFO] [stdout] 26 ~ #[default] [INFO] [stdout] 27 ~ Synchronous_HTTP, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/v4/mod.rs:66:34 [INFO] [stdout] | [INFO] [stdout] 66 | .or_else(|| headers.as_ref().map(|h| { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 67 | | match h.iter().find(|kv| kv.0.to_lowercase() == "content-type") { [INFO] [stdout] 68 | | Some((_, v)) => ContentType::parse(v[0].as_str()).ok(), [INFO] [stdout] 69 | | None => None [INFO] [stdout] 70 | | } [INFO] [stdout] 71 | | }).flatten()) [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `and_then` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 66 ~ .or_else(|| headers.as_ref().and_then(|h| { [INFO] [stdout] 67 + match h.iter().find(|kv| kv.0.to_lowercase() == "content-type") { [INFO] [stdout] 68 + Some((_, v)) => ContentType::parse(v[0].as_str()).ok(), [INFO] [stdout] 69 + None => None [INFO] [stdout] 70 + } [INFO] [stdout] 71 ~ })) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/v4/mod.rs:74:38 [INFO] [stdout] | [INFO] [stdout] 74 | detect_content_type_from_bytes(&*body.value().unwrap_or_default()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&body.value().unwrap_or_default()` [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: redundant closure [INFO] [stdout] --> src/provider_states.rs:67:45 [INFO] [stdout] | [INFO] [stdout] 67 | Value::Array(ref a) => a.iter().map(|i| ProviderState::from_json_v3(i)).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `ProviderState::from_json_v3` [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/provider_states.rs:143:9 [INFO] [stdout] | [INFO] [stdout] 143 | / if let Some(params) = values.get("params") { [INFO] [stdout] 144 | | if !params.is_object() { [INFO] [stdout] 145 | | results.push(PactFileVerificationResult::new(path, ResultLevel::ERROR, [INFO] [stdout] 146 | | format!("Provider state 'params' must be an Object, got {}", json_type_of(pact_json)))) [INFO] [stdout] 147 | | } [INFO] [stdout] 148 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 143 ~ if let Some(params) = values.get("params") [INFO] [stdout] 144 ~ && !params.is_object() { [INFO] [stdout] 145 | results.push(PactFileVerificationResult::new(path, ResultLevel::ERROR, [INFO] [stdout] 146 | format!("Provider state 'params' must be an Object, got {}", json_type_of(pact_json)))) [INFO] [stdout] 147 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/json_utils.rs:108:22 [INFO] [stdout] | [INFO] [stdout] 108 | map.get(field).map(|f| json_to_string(f)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [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: manual implementation of `ok` [INFO] [stdout] --> src/json_utils.rs:155:9 [INFO] [stdout] | [INFO] [stdout] 155 | / match ContentType::parse(kv.1[0].as_str()) { [INFO] [stdout] 156 | | Ok(v) => Some(v), [INFO] [stdout] 157 | | Err(_) => None [INFO] [stdout] 158 | | } [INFO] [stdout] | |_________^ help: replace with: `ContentType::parse(kv.1[0].as_str()).ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err [INFO] [stdout] = note: `#[warn(clippy::manual_ok_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/json_utils.rs:250:3 [INFO] [stdout] | [INFO] [stdout] 240 | / let expanded_paths = root.descendants(&tree).fold(Vec::::new(), |mut acc, node_id| { [INFO] [stdout] 241 | | let node = tree.index(node_id); [INFO] [stdout] 242 | | if !node.get().is_empty() && node.first_child().is_none() { [INFO] [stdout] 243 | | let path: Vec = node_id.ancestors(&tree).map(|n| format!("{}", tree.index(n).get())).collect(); [INFO] [stdout] ... | [INFO] [stdout] 248 | | acc [INFO] [stdout] 249 | | }); [INFO] [stdout] | |_____- unnecessary `let` binding [INFO] [stdout] 250 | expanded_paths [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 240 ~ [INFO] [stdout] 241 ~ root.descendants(&tree).fold(Vec::::new(), |mut acc, node_id| { [INFO] [stdout] 242 + let node = tree.index(node_id); [INFO] [stdout] 243 + if !node.get().is_empty() && node.first_child().is_none() { [INFO] [stdout] 244 + let path: Vec = node_id.ancestors(&tree).map(|n| format!("{}", tree.index(n).get())).collect(); [INFO] [stdout] 245 + if path.len() == expression.len() { [INFO] [stdout] 246 + acc.push(path.iter().rev().join("/")); [INFO] [stdout] 247 + } [INFO] [stdout] 248 + } [INFO] [stdout] 249 + acc [INFO] [stdout] 250 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/json_utils.rs:243:64 [INFO] [stdout] | [INFO] [stdout] 243 | let path: Vec = node_id.ancestors(&tree).map(|n| format!("{}", tree.index(n).get())).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `tree.index(n).get().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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/json_utils.rs:253:33 [INFO] [stdout] | [INFO] [stdout] 253 | fn query_object_graph(path_exp: &Vec, tree: &mut Arena, root: NodeId, body: Value) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 253 - fn query_object_graph(path_exp: &Vec, tree: &mut Arena, root: NodeId, body: Value) { [INFO] [stdout] 253 + fn query_object_graph(path_exp: &[PathToken], tree: &mut Arena, root: NodeId, body: Value) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/json_utils.rs:257:3 [INFO] [stdout] | [INFO] [stdout] 257 | / loop { [INFO] [stdout] 258 | | match it.next() { [INFO] [stdout] 259 | | Some(token) => { [INFO] [stdout] 260 | | match token { [INFO] [stdout] ... | [INFO] [stdout] 313 | | } [INFO] [stdout] | |___^ help: try: `while let Some(token) = it.next() { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/expression_parser.rs:353:32 [INFO] [stdout] | [INFO] [stdout] 353 | self.context.get(name).map(|val| json_to_string(val)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/expression_parser.rs:405:32 [INFO] [stdout] | [INFO] [stdout] 405 | Ok(json!(result.iter().map(|val| json_to_string(val)).join(""))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/time_utils.rs:828:44 [INFO] [stdout] | [INFO] [stdout] 828 | fn validate_matched_values(matched_values: &Vec<(DateTimePatternToken, String)>) -> Result<(), String> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 828 - fn validate_matched_values(matched_values: &Vec<(DateTimePatternToken, String)>) -> Result<(), String> { [INFO] [stdout] 828 + fn validate_matched_values(matched_values: &[(DateTimePatternToken, String)]) -> Result<(), String> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/time_utils.rs:831:24 [INFO] [stdout] | [INFO] [stdout] 831 | .find(|(token, _)| match token { [INFO] [stdout] | ________________________^ [INFO] [stdout] 832 | | DateTimePatternToken::DayInMonth => true, [INFO] [stdout] 833 | | _ => false [INFO] [stdout] 834 | | }); [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 831 - .find(|(token, _)| match token { [INFO] [stdout] 832 - DateTimePatternToken::DayInMonth => true, [INFO] [stdout] 833 - _ => false [INFO] [stdout] 834 - }); [INFO] [stdout] 831 + .find(|(token, _)| matches!(token, DateTimePatternToken::DayInMonth)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/time_utils.rs:836:24 [INFO] [stdout] | [INFO] [stdout] 836 | .find(|(token, _)| match token { [INFO] [stdout] | ________________________^ [INFO] [stdout] 837 | | DateTimePatternToken::Month(_) => true, [INFO] [stdout] 838 | | _ => false [INFO] [stdout] 839 | | }); [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 836 - .find(|(token, _)| match token { [INFO] [stdout] 837 - DateTimePatternToken::Month(_) => true, [INFO] [stdout] 838 - _ => false [INFO] [stdout] 839 - }); [INFO] [stdout] 836 + .find(|(token, _)| matches!(token, DateTimePatternToken::Month(_))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/time_utils.rs:841:24 [INFO] [stdout] | [INFO] [stdout] 841 | .find(|(token, _)| match token { [INFO] [stdout] | ________________________^ [INFO] [stdout] 842 | | DateTimePatternToken::Year(_) => true, [INFO] [stdout] 843 | | _ => false [INFO] [stdout] 844 | | }); [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 841 - .find(|(token, _)| match token { [INFO] [stdout] 842 - DateTimePatternToken::Year(_) => true, [INFO] [stdout] 843 - _ => false [INFO] [stdout] 844 - }); [INFO] [stdout] 841 + .find(|(token, _)| matches!(token, DateTimePatternToken::Year(_))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/xml_utils.rs:51:3 [INFO] [stdout] | [INFO] [stdout] 38 | / let expanded_paths = root.descendants(&tree) [INFO] [stdout] 39 | | .fold(Vec::::new(), |mut acc, node_id| { [INFO] [stdout] 40 | | let node = tree.index(node_id); [INFO] [stdout] 41 | | if !node.get().is_empty() && node.first_child().is_none() { [INFO] [stdout] ... | [INFO] [stdout] 49 | | acc [INFO] [stdout] 50 | | }); [INFO] [stdout] | |_____- unnecessary `let` binding [INFO] [stdout] 51 | expanded_paths [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 38 ~ [INFO] [stdout] 39 ~ root.descendants(&tree) [INFO] [stdout] 40 + .fold(Vec::::new(), |mut acc, node_id| { [INFO] [stdout] 41 + let node = tree.index(node_id); [INFO] [stdout] 42 + if !node.get().is_empty() && node.first_child().is_none() { [INFO] [stdout] 43 + let path: Vec = node_id.ancestors(&tree) [INFO] [stdout] 44 + .map(|n| format!("{}", tree.index(n).get())) [INFO] [stdout] 45 + .collect(); [INFO] [stdout] 46 + if path.len() == tokens.len() { [INFO] [stdout] 47 + acc.push(path.iter().rev().join("/")); [INFO] [stdout] 48 + } [INFO] [stdout] 49 + } [INFO] [stdout] 50 + acc [INFO] [stdout] 51 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/xml_utils.rs:34:17 [INFO] [stdout] | [INFO] [stdout] 34 | .filter(|t| match t { [INFO] [stdout] | _________________^ [INFO] [stdout] 35 | | PathToken::Index(_) => false, [INFO] [stdout] 36 | | _ => true [INFO] [stdout] 37 | | }).collect_vec(); [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 34 - .filter(|t| match t { [INFO] [stdout] 35 - PathToken::Index(_) => false, [INFO] [stdout] 36 - _ => true [INFO] [stdout] 37 - }).collect_vec(); [INFO] [stdout] 34 + .filter(|t| !matches!(t, PathToken::Index(_))).collect_vec(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/xml_utils.rs:43:18 [INFO] [stdout] | [INFO] [stdout] 43 | .map(|n| format!("{}", tree.index(n).get())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `tree.index(n).get().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: deref which would be done by auto-deref [INFO] [stdout] --> src/xml_utils.rs:96:64 [INFO] [stdout] | [INFO] [stdout] 96 | query_graph(remaining_tokens, tree, node_id, *child, index); [INFO] [stdout] | ^^^^^^ help: try: `child` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/xml_utils.rs:114:64 [INFO] [stdout] | [INFO] [stdout] 114 | query_graph(remaining_tokens, tree, parent_id, *child, index); [INFO] [stdout] | ^^^^^^ help: try: `child` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/xml_utils.rs:135:60 [INFO] [stdout] | [INFO] [stdout] 135 | query_graph(remaining_tokens, tree, node_id, *child, index); [INFO] [stdout] | ^^^^^^ help: try: `child` [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/xml_utils.rs:169:5 [INFO] [stdout] | [INFO] [stdout] 169 | / if let PathToken::Field(name) = token { [INFO] [stdout] 170 | | if name.starts_with('@') { [INFO] [stdout] 171 | | let attribute_name = &name[1..]; [INFO] [stdout] 172 | | let attributes = resolve_namespaces(element.attributes()); [INFO] [stdout] ... | [INFO] [stdout] 178 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 169 ~ if let PathToken::Field(name) = token [INFO] [stdout] 170 ~ && name.starts_with('@') { [INFO] [stdout] 171 | let attribute_name = &name[1..]; [INFO] [stdout] ... [INFO] [stdout] 176 | } [INFO] [stdout] 177 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/xml_utils.rs:171:30 [INFO] [stdout] | [INFO] [stdout] 171 | let attribute_name = &name[1..]; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/xml_utils.rs:170:7 [INFO] [stdout] | [INFO] [stdout] 170 | if name.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] 170 ~ if let Some(attribute_name) = name.strip_prefix('@') { [INFO] [stdout] 171 ~ let attributes = resolve_namespaces(element.attributes()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/xml_utils.rs:267:26 [INFO] [stdout] | [INFO] [stdout] 267 | let index: usize = (&captures[2]).parse().unwrap_or_default(); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `captures[2]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/xml_utils.rs:289:32 [INFO] [stdout] | [INFO] [stdout] 289 | element.attributes().get(&first_part[1..]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/xml_utils.rs:288:5 [INFO] [stdout] | [INFO] [stdout] 288 | if first_part.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] 288 ~ if let Some() = first_part.strip_prefix('@') { [INFO] [stdout] 289 ~ element.attributes().get() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/xml_utils.rs:300:26 [INFO] [stdout] | [INFO] [stdout] 300 | let index: usize = (&captures[2]).parse().unwrap_or_default(); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `captures[2]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/xml_utils.rs:302:19 [INFO] [stdout] | [INFO] [stdout] 302 | let child = grouped_children.get(name) [INFO] [stdout] | ___________________^ [INFO] [stdout] 303 | | .map(|values| values.get(index)) [INFO] [stdout] 304 | | .flatten() [INFO] [stdout] 305 | | .map(|value| *value); [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 `copied` method [INFO] [stdout] | [INFO] [stdout] 302 ~ let child = grouped_children.get(name) [INFO] [stdout] 303 + .map(|values| values.get(index)) [INFO] [stdout] 304 ~ .flatten().copied(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/xml_utils.rs:303:10 [INFO] [stdout] | [INFO] [stdout] 303 | .map(|values| values.get(index)) [INFO] [stdout] | __________^ [INFO] [stdout] 304 | | .flatten() [INFO] [stdout] | |__________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|values| values.get(index))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/matchingrules/expressions.rs:188:1 [INFO] [stdout] | [INFO] [stdout] 188 | impl Into for ValueType { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 188 ~ impl From for DataType { [INFO] [stdout] 189 ~ fn from(val: ValueType) -> Self { [INFO] [stdout] 190 ~ match val { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/matchingrules/expressions.rs:254:18 [INFO] [stdout] | [INFO] [stdout] 254 | generator: self.generator.as_ref().or_else(|| other.generator.as_ref()).cloned(), [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 `or` instead [INFO] [stdout] | [INFO] [stdout] 254 - generator: self.generator.as_ref().or_else(|| other.generator.as_ref()).cloned(), [INFO] [stdout] 254 + generator: self.generator.as_ref().or(other.generator.as_ref()).cloned(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/matchingrules/expressions.rs:353:7 [INFO] [stdout] | [INFO] [stdout] 353 | / if token == MatcherDefinitionToken::Matching || token == MatcherDefinitionToken::NotEmpty || [INFO] [stdout] 354 | | token == MatcherDefinitionToken::EachKey || token == MatcherDefinitionToken::EachValue || [INFO] [stdout] 355 | | token == MatcherDefinitionToken::AtLeast || token == MatcherDefinitionToken::AtMost { [INFO] [stdout] 356 | | true [INFO] [stdout] 357 | | } else { [INFO] [stdout] 358 | | false [INFO] [stdout] 359 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] help: you can reduce it to [INFO] [stdout] | [INFO] [stdout] 353 ~ token == MatcherDefinitionToken::Matching || token == MatcherDefinitionToken::NotEmpty || [INFO] [stdout] 354 + token == MatcherDefinitionToken::EachKey || token == MatcherDefinitionToken::EachValue || [INFO] [stdout] 355 + token == MatcherDefinitionToken::AtLeast || token == MatcherDefinitionToken::AtMost [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:462:31 [INFO] [stdout] | [INFO] [stdout] 462 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] = note: `#[warn(clippy::borrow_deref_ref)]` on by default [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 462 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 462 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 462 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/matchingrules/expressions.rs:470:21 [INFO] [stdout] | [INFO] [stdout] 470 | .with_message(format!("Expected a type of matching rule definition but got the end of the expression")) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Expected a type of matching rule definition but got the end of the expression".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: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:475:29 [INFO] [stdout] | [INFO] [stdout] 475 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 475 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 475 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 475 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:511:29 [INFO] [stdout] | [INFO] [stdout] 511 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 511 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 511 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 511 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:525:27 [INFO] [stdout] | [INFO] [stdout] 525 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 525 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 525 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 525 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:553:31 [INFO] [stdout] | [INFO] [stdout] 553 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 553 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 553 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 553 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:565:29 [INFO] [stdout] | [INFO] [stdout] 565 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 565 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 565 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 565 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:590:72 [INFO] [stdout] | [INFO] [stdout] 590 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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/matchingrules/expressions.rs:625:84 [INFO] [stdout] | [INFO] [stdout] 625 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:653:33 [INFO] [stdout] | [INFO] [stdout] 653 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 653 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 653 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 653 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:668:29 [INFO] [stdout] | [INFO] [stdout] 668 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 668 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 668 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 668 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:673:73 [INFO] [stdout] | [INFO] [stdout] 673 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:679:70 [INFO] [stdout] | [INFO] [stdout] 679 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:694:31 [INFO] [stdout] | [INFO] [stdout] 694 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 694 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 694 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 694 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:704:6 [INFO] [stdout] | [INFO] [stdout] 704 | ) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:711:69 [INFO] [stdout] | [INFO] [stdout] 711 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:731:6 [INFO] [stdout] | [INFO] [stdout] 731 | ) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:738:72 [INFO] [stdout] | [INFO] [stdout] 738 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:755:68 [INFO] [stdout] | [INFO] [stdout] 755 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:772:68 [INFO] [stdout] | [INFO] [stdout] 772 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:789:71 [INFO] [stdout] | [INFO] [stdout] 789 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:796:76 [INFO] [stdout] | [INFO] [stdout] 796 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:858:70 [INFO] [stdout] | [INFO] [stdout] 858 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:886:71 [INFO] [stdout] | [INFO] [stdout] 886 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:905:71 [INFO] [stdout] | [INFO] [stdout] 905 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:933:71 [INFO] [stdout] | [INFO] [stdout] 933 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:959:29 [INFO] [stdout] | [INFO] [stdout] 959 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 959 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 959 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 959 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:1030:27 [INFO] [stdout] | [INFO] [stdout] 1030 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 1030 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 1030 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 1030 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:1046:31 [INFO] [stdout] | [INFO] [stdout] 1046 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 1046 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 1046 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 1046 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:1065:29 [INFO] [stdout] | [INFO] [stdout] 1065 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 1065 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 1065 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 1065 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:1079:27 [INFO] [stdout] | [INFO] [stdout] 1079 | let message = from_utf8(&*buffer.get_ref()).unwrap().to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 1079 - let message = from_utf8(&*buffer.get_ref()).unwrap().to_string(); [INFO] [stdout] 1079 + let message = from_utf8(buffer.get_ref()).unwrap().to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 1079 | let message = from_utf8(&**buffer.get_ref()).unwrap().to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/matchingrules/mod.rs:48:16 [INFO] [stdout] | [INFO] [stdout] 48 | .map(|rule| MatchingRule::from_json(rule)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `MatchingRule::from_json` [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: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/matchingrules/mod.rs:186:16 [INFO] [stdout] | [INFO] [stdout] 186 | .filter(|item| item.is_some()) [INFO] [stdout] | ________________^ [INFO] [stdout] 187 | | .map(|item| item.unwrap()) [INFO] [stdout] | |________________________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] = note: `#[warn(clippy::option_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/matchingrules/mod.rs:180:17 [INFO] [stdout] | [INFO] [stdout] 180 | / if let Some(json) = g.to_json() { [INFO] [stdout] 181 | | Some((String::from(k), json)) [INFO] [stdout] 182 | | } else { [INFO] [stdout] 183 | | None [INFO] [stdout] 184 | | } [INFO] [stdout] | |_________________^ help: try: `g.to_json().map(|json| (String::from(k), json))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/matchingrules/mod.rs:481:5 [INFO] [stdout] | [INFO] [stdout] 481 | / match self { [INFO] [stdout] 482 | | MatchingRule::Values => true, [INFO] [stdout] 483 | | MatchingRule::EachValue(_) => true, [INFO] [stdout] 484 | | _ => false [INFO] [stdout] 485 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 481 - match self { [INFO] [stdout] 482 - MatchingRule::Values => true, [INFO] [stdout] 483 - MatchingRule::EachValue(_) => true, [INFO] [stdout] 484 - _ => false [INFO] [stdout] 485 - } [INFO] [stdout] 481 + matches!(self, MatchingRule::Values | MatchingRule::EachValue(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/matchingrules/mod.rs:490:5 [INFO] [stdout] | [INFO] [stdout] 490 | / match self { [INFO] [stdout] 491 | | MatchingRule::Type => true, [INFO] [stdout] 492 | | MatchingRule::MinType(_) => true, [INFO] [stdout] 493 | | MatchingRule::MaxType(_) => true, [INFO] [stdout] 494 | | MatchingRule::MinMaxType(_, _) => true, [INFO] [stdout] 495 | | _ => false [INFO] [stdout] 496 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 490 - match self { [INFO] [stdout] 491 - MatchingRule::Type => true, [INFO] [stdout] 492 - MatchingRule::MinType(_) => true, [INFO] [stdout] 493 - MatchingRule::MaxType(_) => true, [INFO] [stdout] 494 - MatchingRule::MinMaxType(_, _) => true, [INFO] [stdout] 495 - _ => false [INFO] [stdout] 496 - } [INFO] [stdout] 490 + matches!(self, MatchingRule::Type | MatchingRule::MinType(_) | MatchingRule::MaxType(_) | MatchingRule::MinMaxType(_, _)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/matchingrules/mod.rs:501:5 [INFO] [stdout] | [INFO] [stdout] 501 | / match self { [INFO] [stdout] 502 | | MatchingRule::MinType(_) => true, [INFO] [stdout] 503 | | MatchingRule::MaxType(_) => true, [INFO] [stdout] 504 | | MatchingRule::MinMaxType(_, _) => true, [INFO] [stdout] 505 | | _ => false [INFO] [stdout] 506 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 501 - match self { [INFO] [stdout] 502 - MatchingRule::MinType(_) => true, [INFO] [stdout] 503 - MatchingRule::MaxType(_) => true, [INFO] [stdout] 504 - MatchingRule::MinMaxType(_, _) => true, [INFO] [stdout] 505 - _ => false [INFO] [stdout] 506 - } [INFO] [stdout] 501 + matches!(self, MatchingRule::MinType(_) | MatchingRule::MaxType(_) | MatchingRule::MinMaxType(_, _)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/matchingrules/mod.rs:511:5 [INFO] [stdout] | [INFO] [stdout] 511 | / match self { [INFO] [stdout] 512 | | MatchingRule::Values => false, [INFO] [stdout] 513 | | MatchingRule::EachValue(_) => false, [INFO] [stdout] 514 | | MatchingRule::EachKey(_) => false, [INFO] [stdout] 515 | | _ => true [INFO] [stdout] 516 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 511 - match self { [INFO] [stdout] 512 - MatchingRule::Values => false, [INFO] [stdout] 513 - MatchingRule::EachValue(_) => false, [INFO] [stdout] 514 - MatchingRule::EachKey(_) => false, [INFO] [stdout] 515 - _ => true [INFO] [stdout] 516 - } [INFO] [stdout] 511 + !matches!(self, MatchingRule::Values | MatchingRule::EachValue(_) | MatchingRule::EachKey(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> src/matchingrules/mod.rs:658:14 [INFO] [stdout] | [INFO] [stdout] 658 | fn to_json(&self) -> Value { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.rules.get(0)` [INFO] [stdout] --> src/matchingrules/mod.rs:719:11 [INFO] [stdout] | [INFO] [stdout] 719 | match self.rules.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `self.rules.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: match expression looks like `matches!` macro [INFO] [stdout] --> src/matchingrules/mod.rs:727:34 [INFO] [stdout] | [INFO] [stdout] 727 | self.rules.iter().any(|rule| match rule { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 728 | | MatchingRule::Type => true, [INFO] [stdout] 729 | | MatchingRule::MinType(_) => true, [INFO] [stdout] 730 | | MatchingRule::MaxType(_) => true, [INFO] [stdout] 731 | | MatchingRule::MinMaxType(_, _) => true, [INFO] [stdout] 732 | | _ => false [INFO] [stdout] 733 | | }) [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 727 - self.rules.iter().any(|rule| match rule { [INFO] [stdout] 728 - MatchingRule::Type => true, [INFO] [stdout] 729 - MatchingRule::MinType(_) => true, [INFO] [stdout] 730 - MatchingRule::MaxType(_) => true, [INFO] [stdout] 731 - MatchingRule::MinMaxType(_, _) => true, [INFO] [stdout] 732 - _ => false [INFO] [stdout] 733 - }) [INFO] [stdout] 727 + self.rules.iter().any(|rule| matches!(rule, MatchingRule::Type | MatchingRule::MinType(_) | MatchingRule::MaxType(_) | MatchingRule::MinMaxType(_, _))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/matchingrules/mod.rs:743:34 [INFO] [stdout] | [INFO] [stdout] 743 | self.rules.iter().any(|rule| match rule { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 744 | | MatchingRule::Type => false, [INFO] [stdout] 745 | | MatchingRule::MinType(_) => false, [INFO] [stdout] 746 | | MatchingRule::MaxType(_) => false, [INFO] [stdout] 747 | | MatchingRule::MinMaxType(_, _) => false, [INFO] [stdout] 748 | | _ => true [INFO] [stdout] 749 | | }) [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 743 - self.rules.iter().any(|rule| match rule { [INFO] [stdout] 744 - MatchingRule::Type => false, [INFO] [stdout] 745 - MatchingRule::MinType(_) => false, [INFO] [stdout] 746 - MatchingRule::MaxType(_) => false, [INFO] [stdout] 747 - MatchingRule::MinMaxType(_, _) => false, [INFO] [stdout] 748 - _ => true [INFO] [stdout] 749 - }) [INFO] [stdout] 743 + self.rules.iter().any(|rule| !matches!(rule, MatchingRule::Type | MatchingRule::MinType(_) | MatchingRule::MaxType(_) | MatchingRule::MinMaxType(_, _))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/matchingrules/mod.rs:791:8 [INFO] [stdout] | [INFO] [stdout] 791 | if self.rules.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.rules.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: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/matchingrules/mod.rs:888:1 [INFO] [stdout] | [INFO] [stdout] 888 | impl <'a> Into<&'a str> for Category { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 888 ~ impl <'a> From for &'a str { [INFO] [stdout] 889 ~ fn from(val: Category) -> Self { [INFO] [stdout] 890 ~ match val { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/matchingrules/mod.rs:903:1 [INFO] [stdout] | [INFO] [stdout] 903 | impl Into for Category { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 903 ~ impl From for String { [INFO] [stdout] 904 ~ fn from(val: Category) -> Self { [INFO] [stdout] 905 ~ val.to_string() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/matchingrules/mod.rs:921:1 [INFO] [stdout] | [INFO] [stdout] 921 | / impl Default for Category { [INFO] [stdout] 922 | | fn default() -> Self { [INFO] [stdout] 923 | | Category::BODY [INFO] [stdout] 924 | | } [INFO] [stdout] 925 | | } [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 and mark the default variant [INFO] [stdout] | [INFO] [stdout] 841 + #[derive(Default)] [INFO] [stdout] 842 | pub enum Category { [INFO] [stdout] 843 | /// Request Method [INFO] [stdout] ... [INFO] [stdout] 851 | /// Body [INFO] [stdout] 852 ~ #[default] [INFO] [stdout] 853 ~ BODY, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/matchingrules/mod.rs:1117:9 [INFO] [stdout] | [INFO] [stdout] 1117 | / if let Value::Array(array) = matchers { [INFO] [stdout] 1118 | | for matcher in array { [INFO] [stdout] 1119 | | self.rule_from_json(DocPath::empty(), &matcher, rule_logic)?; [INFO] [stdout] 1120 | | } [INFO] [stdout] 1121 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/matchingrules/mod.rs:1116:19 [INFO] [stdout] | [INFO] [stdout] 1116 | if let Some(matchers) = rules.get("matchers") { [INFO] [stdout] | ^^^^^^^^ replace this binding [INFO] [stdout] 1117 | if let Value::Array(array) = matchers { [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/matchingrules/mod.rs:1116:7 [INFO] [stdout] | [INFO] [stdout] 1116 | / if let Some(matchers) = rules.get("matchers") { [INFO] [stdout] 1117 | | if let Value::Array(array) = matchers { [INFO] [stdout] 1118 | | for matcher in array { [INFO] [stdout] 1119 | | self.rule_from_json(DocPath::empty(), &matcher, rule_logic)?; [INFO] [stdout] ... | [INFO] [stdout] 1122 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1116 ~ if let Some(matchers) = rules.get("matchers") [INFO] [stdout] 1117 ~ && let Value::Array(array) = matchers { [INFO] [stdout] 1118 | for matcher in array { [INFO] [stdout] 1119 | self.rule_from_json(DocPath::empty(), &matcher, rule_logic)?; [INFO] [stdout] 1120 | } [INFO] [stdout] 1121 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/matchingrules/mod.rs:1119:51 [INFO] [stdout] | [INFO] [stdout] 1119 | self.rule_from_json(DocPath::empty(), &matcher, rule_logic)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `matcher` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/matchingrules/mod.rs:1147:9 [INFO] [stdout] | [INFO] [stdout] 1147 | / if let Value::Array(array) = matchers { [INFO] [stdout] 1148 | | for matcher in array { [INFO] [stdout] 1149 | | self.rule_from_json(DocPath::empty(), &matcher, rule_logic)?; [INFO] [stdout] 1150 | | } [INFO] [stdout] 1151 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/matchingrules/mod.rs:1146:19 [INFO] [stdout] | [INFO] [stdout] 1146 | if let Some(matchers) = rules.get("matchers") { [INFO] [stdout] | ^^^^^^^^ replace this binding [INFO] [stdout] 1147 | if let Value::Array(array) = matchers { [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/matchingrules/mod.rs:1146:7 [INFO] [stdout] | [INFO] [stdout] 1146 | / if let Some(matchers) = rules.get("matchers") { [INFO] [stdout] 1147 | | if let Value::Array(array) = matchers { [INFO] [stdout] 1148 | | for matcher in array { [INFO] [stdout] 1149 | | self.rule_from_json(DocPath::empty(), &matcher, rule_logic)?; [INFO] [stdout] ... | [INFO] [stdout] 1152 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1146 ~ if let Some(matchers) = rules.get("matchers") [INFO] [stdout] 1147 ~ && let Value::Array(array) = matchers { [INFO] [stdout] 1148 | for matcher in array { [INFO] [stdout] 1149 | self.rule_from_json(DocPath::empty(), &matcher, rule_logic)?; [INFO] [stdout] 1150 | } [INFO] [stdout] 1151 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/matchingrules/mod.rs:1149:51 [INFO] [stdout] | [INFO] [stdout] 1149 | self.rule_from_json(DocPath::empty(), &matcher, rule_logic)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `matcher` [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/matchingrules/mod.rs:1182:17 [INFO] [stdout] | [INFO] [stdout] 1182 | if let Some(&Value::Array(ref array)) = v.get("matchers") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 1182 - if let Some(&Value::Array(ref array)) = v.get("matchers") { [INFO] [stdout] 1182 + if let Some(Value::Array(array)) = v.get("matchers") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/matchingrules/mod.rs:1184:40 [INFO] [stdout] | [INFO] [stdout] 1184 | self.rule_from_json(k.clone(), &matcher, rule_logic)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `matcher` [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: re-implementing `PartialEq::ne` is unnecessary [INFO] [stdout] --> src/matchingrules/mod.rs:1242:3 [INFO] [stdout] | [INFO] [stdout] 1242 | fn ne(&self, other: &Self) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_ne_impl [INFO] [stdout] = note: `#[warn(clippy::partialeq_ne_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/matchingrules/mod.rs:1367:64 [INFO] [stdout] | [INFO] [stdout] 1367 | self.add_v2_rule("body", DocPath::new(format!("${}", &key[6..]))?, v)?; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/matchingrules/mod.rs:1363:7 [INFO] [stdout] | [INFO] [stdout] 1363 | if key.starts_with("$.body") { [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] 1363 ~ if let Some() = key.strip_prefix("$.body") { [INFO] [stdout] 1364 | if key == "$.body" { [INFO] [stdout] 1365 | self.add_v2_rule("body", DocPath::root(), v)?; [INFO] [stdout] 1366 | } else { [INFO] [stdout] 1367 ~ self.add_v2_rule("body", DocPath::new(format!("${}", ))?, v)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `skip(..).next()` on an iterator [INFO] [stdout] --> src/matchingrules/mod.rs:1374:11 [INFO] [stdout] | [INFO] [stdout] 1374 | }).skip(1).next(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next [INFO] [stdout] = note: `#[warn(clippy::iter_skip_next)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/matchingrules/mod.rs:1423:11 [INFO] [stdout] | [INFO] [stdout] 1423 | / if let Some(values) = value.as_object() { [INFO] [stdout] 1424 | | if !values.is_empty() { [INFO] [stdout] 1425 | | map.insert(name.to_string(), value); [INFO] [stdout] 1426 | | } [INFO] [stdout] 1427 | | } [INFO] [stdout] | |___________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1423 ~ if let Some(values) = value.as_object() [INFO] [stdout] 1424 ~ && !values.is_empty() { [INFO] [stdout] 1425 | map.insert(name.to_string(), value); [INFO] [stdout] 1426 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/matchingrules/mod.rs:1510:7 [INFO] [stdout] | [INFO] [stdout] 1510 | write!(f, "{}:\n", category)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] = note: `#[warn(clippy::write_with_newline)]` on by default [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 1510 - write!(f, "{}:\n", category)?; [INFO] [stdout] 1510 + writeln!(f, "{}:", category)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/matchingrules/mod.rs:1513:11 [INFO] [stdout] | [INFO] [stdout] 1513 | write!(f, " {} => []\n", path)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 1513 - write!(f, " {} => []\n", path)?; [INFO] [stdout] 1513 + writeln!(f, " {} => []", path)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/matchingrules/mod.rs:1515:11 [INFO] [stdout] | [INFO] [stdout] 1515 | write!(f, " {} => {:?}\n", path, rule_list.rules[0])?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 1515 - write!(f, " {} => {:?}\n", path, rule_list.rules[0])?; [INFO] [stdout] 1515 + writeln!(f, " {} => {:?}", path, rule_list.rules[0])?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/matchingrules/mod.rs:1517:11 [INFO] [stdout] | [INFO] [stdout] 1517 | write!(f, " {} => [\n", path)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 1517 - write!(f, " {} => [\n", path)?; [INFO] [stdout] 1517 + writeln!(f, " {} => [", path)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/matchingrules/mod.rs:1519:13 [INFO] [stdout] | [INFO] [stdout] 1519 | write!(f, " {:?}\n", rule)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 1519 - write!(f, " {:?}\n", rule)?; [INFO] [stdout] 1519 + writeln!(f, " {:?}", rule)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/matchingrules/mod.rs:1521:11 [INFO] [stdout] | [INFO] [stdout] 1521 | write!(f, " ]\n")?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 1521 - write!(f, " ]\n")?; [INFO] [stdout] 1521 + writeln!(f, " ]")?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/matchingrules/mod.rs:1541:20 [INFO] [stdout] | [INFO] [stdout] 1541 | Some(value) => match value { [INFO] [stdout] | ____________________^ [INFO] [stdout] 1542 | | &Value::Object(ref m) => { [INFO] [stdout] 1543 | | if m.keys().next().unwrap_or(&String::default()).starts_with("$") { [INFO] [stdout] 1544 | | matching_rules.load_from_v2_map(m)? [INFO] [stdout] ... | [INFO] [stdout] 1549 | | _ => () [INFO] [stdout] 1550 | | }, [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/matchingrules/mod.rs:1541:10 [INFO] [stdout] | [INFO] [stdout] 1541 | Some(value) => match value { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 1542 | &Value::Object(ref m) => { [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/matchingrules/mod.rs:1540:3 [INFO] [stdout] | [INFO] [stdout] 1540 | / match matchers_json { [INFO] [stdout] 1541 | | Some(value) => match value { [INFO] [stdout] 1542 | | &Value::Object(ref m) => { [INFO] [stdout] 1543 | | if m.keys().next().unwrap_or(&String::default()).starts_with("$") { [INFO] [stdout] ... | [INFO] [stdout] 1551 | | None => () [INFO] [stdout] 1552 | | } [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] 1540 ~ if let Some(value) = matchers_json { match value { [INFO] [stdout] 1541 + &Value::Object(ref m) => { [INFO] [stdout] 1542 + if m.keys().next().unwrap_or(&String::default()).starts_with("$") { [INFO] [stdout] 1543 + matching_rules.load_from_v2_map(m)? [INFO] [stdout] 1544 + } else { [INFO] [stdout] 1545 + matching_rules.load_from_v3_map(m)? [INFO] [stdout] 1546 + } [INFO] [stdout] 1547 + }, [INFO] [stdout] 1548 + _ => () [INFO] [stdout] 1549 + } } [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/matchingrules/mod.rs:1541:20 [INFO] [stdout] | [INFO] [stdout] 1541 | Some(value) => match value { [INFO] [stdout] | ____________________^ [INFO] [stdout] 1542 | | &Value::Object(ref m) => { [INFO] [stdout] 1543 | | if m.keys().next().unwrap_or(&String::default()).starts_with("$") { [INFO] [stdout] 1544 | | matching_rules.load_from_v2_map(m)? [INFO] [stdout] ... | [INFO] [stdout] 1549 | | _ => () [INFO] [stdout] 1550 | | }, [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] 1541 ~ Some(value) => if let &Value::Object(ref m) = value { [INFO] [stdout] 1542 + if m.keys().next().unwrap_or(&String::default()).starts_with("$") { [INFO] [stdout] 1543 + matching_rules.load_from_v2_map(m)? [INFO] [stdout] 1544 + } else { [INFO] [stdout] 1545 + matching_rules.load_from_v3_map(m)? [INFO] [stdout] 1546 + } [INFO] [stdout] 1547 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/matchingrules/mod.rs:1542:7 [INFO] [stdout] | [INFO] [stdout] 1542 | &Value::Object(ref m) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 1542 - &Value::Object(ref m) => { [INFO] [stdout] 1542 + Value::Object(m) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/generators/datetime_expressions.rs:179:8 [INFO] [stdout] | [INFO] [stdout] 179 | .map(|t| t.with_nanosecond(0)) [INFO] [stdout] | ________^ [INFO] [stdout] 180 | | .flatten() [INFO] [stdout] | |________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|t| t.with_nanosecond(0))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/generators/datetime_expressions.rs:177:8 [INFO] [stdout] | [INFO] [stdout] 177 | .map(|t| t.with_second(0)) [INFO] [stdout] | ________^ [INFO] [stdout] 178 | | .flatten() [INFO] [stdout] | |________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|t| t.with_second(0))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/generators/datetime_expressions.rs:410:27 [INFO] [stdout] | [INFO] [stdout] 410 | let message = from_utf8(&*buffer.get_ref()).unwrap().to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 410 - let message = from_utf8(&*buffer.get_ref()).unwrap().to_string(); [INFO] [stdout] 410 + let message = from_utf8(buffer.get_ref()).unwrap().to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 410 | let message = from_utf8(&**buffer.get_ref()).unwrap().to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/generators/date_expression_parser.rs:135:5 [INFO] [stdout] | [INFO] [stdout] 135 | / match self { [INFO] [stdout] 136 | | DateExpressionToken::Now => true, [INFO] [stdout] 137 | | DateExpressionToken::Today => true, [INFO] [stdout] 138 | | DateExpressionToken::Tomorrow => true, [INFO] [stdout] 139 | | DateExpressionToken::Yesterday => true, [INFO] [stdout] 140 | | _ => false [INFO] [stdout] 141 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 135 - match self { [INFO] [stdout] 136 - DateExpressionToken::Now => true, [INFO] [stdout] 137 - DateExpressionToken::Today => true, [INFO] [stdout] 138 - DateExpressionToken::Tomorrow => true, [INFO] [stdout] 139 - DateExpressionToken::Yesterday => true, [INFO] [stdout] 140 - _ => false [INFO] [stdout] 141 - } [INFO] [stdout] 135 + matches!(self, DateExpressionToken::Now | DateExpressionToken::Today | DateExpressionToken::Tomorrow | DateExpressionToken::Yesterday) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/generators/date_expression_parser.rs:145:5 [INFO] [stdout] | [INFO] [stdout] 145 | / match self { [INFO] [stdout] 146 | | DateExpressionToken::Plus => true, [INFO] [stdout] 147 | | DateExpressionToken::Minus => true, [INFO] [stdout] 148 | | _ => false [INFO] [stdout] 149 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 145 - match self { [INFO] [stdout] 146 - DateExpressionToken::Plus => true, [INFO] [stdout] 147 - DateExpressionToken::Minus => true, [INFO] [stdout] 148 - _ => false [INFO] [stdout] 149 - } [INFO] [stdout] 145 + matches!(self, DateExpressionToken::Plus | DateExpressionToken::Minus) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/generators/date_expression_parser.rs:166:26 [INFO] [stdout] | [INFO] [stdout] 166 | pub(crate) fn expression<'a>(lex: &mut Lexer, exp: &str) -> anyhow::Result { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/generators/date_expression_parser.rs:175:33 [INFO] [stdout] | [INFO] [stdout] 175 | adj.extend_from_slice(&*adjustments(lex, exp, &token)?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&adjustments(lex, exp, &token)?` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/generators/date_expression_parser.rs:181:29 [INFO] [stdout] | [INFO] [stdout] 181 | adj.extend_from_slice(&*adjustments(lex, exp, &token)?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&adjustments(lex, exp, &token)?` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/generators/date_expression_parser.rs:191:33 [INFO] [stdout] | [INFO] [stdout] 191 | adj.extend_from_slice(&*adjustments(lex, exp, &token)?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&adjustments(lex, exp, &token)?` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/generators/date_expression_parser.rs:205:33 [INFO] [stdout] | [INFO] [stdout] 205 | adj.extend_from_slice(&*adjustments(lex, exp, &token)?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&adjustments(lex, exp, &token)?` [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: match expression looks like `matches!` macro [INFO] [stdout] --> src/generators/time_expression_parser.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 67 | / match self { [INFO] [stdout] 68 | | TimeExpressionToken::Now => true, [INFO] [stdout] 69 | | TimeExpressionToken::Midnight => true, [INFO] [stdout] 70 | | TimeExpressionToken::Noon => true, [INFO] [stdout] 71 | | TimeExpressionToken::Digits(_) => true, [INFO] [stdout] 72 | | _ => false [INFO] [stdout] 73 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 67 - match self { [INFO] [stdout] 68 - TimeExpressionToken::Now => true, [INFO] [stdout] 69 - TimeExpressionToken::Midnight => true, [INFO] [stdout] 70 - TimeExpressionToken::Noon => true, [INFO] [stdout] 71 - TimeExpressionToken::Digits(_) => true, [INFO] [stdout] 72 - _ => false [INFO] [stdout] 73 - } [INFO] [stdout] 67 + matches!(self, TimeExpressionToken::Now | TimeExpressionToken::Midnight | TimeExpressionToken::Noon | TimeExpressionToken::Digits(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/generators/time_expression_parser.rs:77:5 [INFO] [stdout] | [INFO] [stdout] 77 | / match self { [INFO] [stdout] 78 | | TimeExpressionToken::Plus => true, [INFO] [stdout] 79 | | TimeExpressionToken::Minus => true, [INFO] [stdout] 80 | | _ => false [INFO] [stdout] 81 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 77 - match self { [INFO] [stdout] 78 - TimeExpressionToken::Plus => true, [INFO] [stdout] 79 - TimeExpressionToken::Minus => true, [INFO] [stdout] 80 - _ => false [INFO] [stdout] 81 - } [INFO] [stdout] 77 + matches!(self, TimeExpressionToken::Plus | TimeExpressionToken::Minus) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/generators/time_expression_parser.rs:106:41 [INFO] [stdout] | [INFO] [stdout] 106 | if let Some(Ok(token)) = next.map(|next| Ok(next)).or_else(|| lex.next()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Ok` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/generators/time_expression_parser.rs:109:33 [INFO] [stdout] | [INFO] [stdout] 109 | adj.extend_from_slice(&*a); [INFO] [stdout] | ^^^ help: try: `&a` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/generators/time_expression_parser.rs:116:29 [INFO] [stdout] | [INFO] [stdout] 116 | adj.extend_from_slice(&*a); [INFO] [stdout] | ^^^ help: try: `&a` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/generators/time_expression_parser.rs:127:33 [INFO] [stdout] | [INFO] [stdout] 127 | adj.extend_from_slice(&*a); [INFO] [stdout] | ^^^ help: try: `&a` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/generators/time_expression_parser.rs:142:33 [INFO] [stdout] | [INFO] [stdout] 142 | adj.extend_from_slice(&*a); [INFO] [stdout] | ^^^ help: try: `&a` [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: using `clone` on type `TimeExpressionToken` which implements the `Copy` trait [INFO] [stdout] --> src/generators/time_expression_parser.rs:230:19 [INFO] [stdout] | [INFO] [stdout] 230 | let mut token = token.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `token` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TimeExpressionToken` which implements the `Copy` trait [INFO] [stdout] --> src/generators/time_expression_parser.rs:241:15 [INFO] [stdout] | [INFO] [stdout] 241 | token = t.clone(); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `t` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/generators/form_urlencoded.rs:52:16 [INFO] [stdout] | [INFO] [stdout] 52 | return match generator.generate_value(¶m_value, context, matcher) { [INFO] [stdout] | ________________^ [INFO] [stdout] 53 | | Ok(new_value) => *param_value = new_value, [INFO] [stdout] 54 | | Err(_) => () [INFO] [stdout] 55 | | } [INFO] [stdout] | |_________^ help: try: `if let Ok(new_value) = generator.generate_value(¶m_value, context, matcher) { *param_value = new_value }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/form_urlencoded.rs:52:47 [INFO] [stdout] | [INFO] [stdout] 52 | return match generator.generate_value(¶m_value, context, matcher) { [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `param_value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/generators/xml.rs:63:12 [INFO] [stdout] | [INFO] [stdout] 63 | matcher: &Box, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn VariantMatcher + Send + Sync)` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/xml.rs:75:40 [INFO] [stdout] | [INFO] [stdout] 75 | if generate_values_for_xml_attribute(&el, key, generator, context, matcher, path.clone()) { [INFO] [stdout] | ^^^ help: change this to: `el` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/xml.rs:79:35 [INFO] [stdout] | [INFO] [stdout] 79 | if generate_values_for_xml_text(&el, key, generator, context, matcher, path.clone()) { [INFO] [stdout] | ^^^ help: change this to: `el` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/generators/xml.rs:99:12 [INFO] [stdout] | [INFO] [stdout] 99 | matcher: &Box, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn VariantMatcher + Send + Sync)` [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/generators/xml.rs:104:3 [INFO] [stdout] | [INFO] [stdout] 104 | / if let Some(v) = key.last_field() { [INFO] [stdout] 105 | | if v.starts_with("@") { [INFO] [stdout] 106 | | for attr in el.attributes() { [INFO] [stdout] 107 | | let mut attr_path = path.clone(); [INFO] [stdout] ... | [INFO] [stdout] 125 | | }; [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 104 ~ if let Some(v) = key.last_field() [INFO] [stdout] 105 ~ && v.starts_with("@") { [INFO] [stdout] 106 | for attr in el.attributes() { [INFO] [stdout] ... [INFO] [stdout] 123 | } [INFO] [stdout] 124 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/generators/xml.rs:135:12 [INFO] [stdout] | [INFO] [stdout] 135 | matcher: &Box, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn VariantMatcher + Send + Sync)` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/generators/mod.rs:45:15 [INFO] [stdout] | [INFO] [stdout] 45 | variants: &Vec<(usize, MatchingRuleCategory, HashMap)> [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&[(usize, MatchingRuleCategory, HashMap)]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/generators/mod.rs:69:1 [INFO] [stdout] | [INFO] [stdout] 69 | / impl Default for NoopVariantMatcher { [INFO] [stdout] 70 | | fn default() -> Self { [INFO] [stdout] 71 | | NoopVariantMatcher {} [INFO] [stdout] 72 | | } [INFO] [stdout] 73 | | } [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] 53 + #[derive(Default)] [INFO] [stdout] 54 | pub struct NoopVariantMatcher; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/generators/mod.rs:99:1 [INFO] [stdout] | [INFO] [stdout] 99 | / impl Default for UuidFormat { [INFO] [stdout] 100 | | fn default() -> Self { [INFO] [stdout] 101 | | UuidFormat::LowerCaseHyphenated [INFO] [stdout] 102 | | } [INFO] [stdout] 103 | | } [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 and mark the default variant [INFO] [stdout] | [INFO] [stdout] 77 + #[derive(Default)] [INFO] [stdout] 78 | pub enum UuidFormat { [INFO] [stdout] 79 | /// Simple UUID (e.g 936DA01f9abd4d9d80c702af85c822a8) [INFO] [stdout] 80 | Simple, [INFO] [stdout] 81 | /// lower-case hyphenated (e.g 936da01f-9abd-4d9d-80c7-02af85c822a8) [INFO] [stdout] 82 ~ #[default] [INFO] [stdout] 83 ~ LowerCaseHyphenated, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/generators/mod.rs:443:1 [INFO] [stdout] | [INFO] [stdout] 443 | impl <'a> Into<&'a str> for GeneratorCategory { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 443 ~ impl <'a> From for &'a str { [INFO] [stdout] 444 ~ fn from(val: GeneratorCategory) -> Self { [INFO] [stdout] 445 ~ match val { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/generators/mod.rs:457:1 [INFO] [stdout] | [INFO] [stdout] 457 | impl Into for GeneratorCategory { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 457 ~ impl From for String { [INFO] [stdout] 458 ~ fn from(val: GeneratorCategory) -> Self { [INFO] [stdout] 459 ~ let s: &str = val.into(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/generators/mod.rs:464:1 [INFO] [stdout] | [INFO] [stdout] 464 | impl Into for GeneratorCategory { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 464 ~ impl From for Category { [INFO] [stdout] 465 ~ fn from(val: GeneratorCategory) -> Self { [INFO] [stdout] 466 ~ match val { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/generators/mod.rs:487:14 [INFO] [stdout] | [INFO] [stdout] 487 | matcher: &Box [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn VariantMatcher + Send + Sync)` [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: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/generators/mod.rs:499:14 [INFO] [stdout] | [INFO] [stdout] 499 | matcher: &Box [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn VariantMatcher + Send + Sync)` [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: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/generators/mod.rs:507:14 [INFO] [stdout] | [INFO] [stdout] 507 | matcher: &Box [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn VariantMatcher + Send + Sync)` [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/generators/mod.rs:541:17 [INFO] [stdout] | [INFO] [stdout] 541 | &Value::Object(ref map) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 541 - &Value::Object(ref map) => { [INFO] [stdout] 541 + Value::Object(map) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/generators/mod.rs:568:9 [INFO] [stdout] | [INFO] [stdout] 568 | &Value::String(ref gen_type) => match Generator::from_map(gen_type, map) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 568 - &Value::String(ref gen_type) => match Generator::from_map(gen_type, map) { [INFO] [stdout] 568 + Value::String(gen_type) => match Generator::from_map(gen_type, map) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GeneratorCategory` which implements the `Copy` trait [INFO] [stdout] --> src/generators/mod.rs:584:25 [INFO] [stdout] | [INFO] [stdout] 584 | let cat: String = name.clone().into(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `(*name)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/generators/mod.rs:587:11 [INFO] [stdout] | [INFO] [stdout] 587 | / match category.get(&DocPath::empty()).or_else(|| category.get(&DocPath::root())) { [INFO] [stdout] 588 | | Some(generator) => { [INFO] [stdout] 589 | | let json = generator.to_json(); [INFO] [stdout] 590 | | if let Some(json) = json { [INFO] [stdout] ... | [INFO] [stdout] 594 | | None => () [INFO] [stdout] 595 | | } [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] 587 ~ if let Some(generator) = category.get(&DocPath::empty()).or_else(|| category.get(&DocPath::root())) { [INFO] [stdout] 588 + let json = generator.to_json(); [INFO] [stdout] 589 + if let Some(json) = json { [INFO] [stdout] 590 + map.insert(cat.clone(), json); [INFO] [stdout] 591 + } [INFO] [stdout] 592 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/generators/mod.rs:637:64 [INFO] [stdout] | [INFO] [stdout] 637 | let category_map = self.categories.entry(category.clone()).or_insert(HashMap::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GeneratorCategory` which implements the `Copy` trait [INFO] [stdout] --> src/generators/mod.rs:637:46 [INFO] [stdout] | [INFO] [stdout] 637 | let category_map = self.categories.entry(category.clone()).or_insert(HashMap::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try dereferencing it: `*category` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/generators/mod.rs:644:61 [INFO] [stdout] | [INFO] [stdout] 644 | let category_map = self.categories.entry(key.clone()).or_insert(HashMap::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GeneratorCategory` which implements the `Copy` trait [INFO] [stdout] --> src/generators/mod.rs:644:48 [INFO] [stdout] | [INFO] [stdout] 644 | let category_map = self.categories.entry(key.clone()).or_insert(HashMap::new()); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:697:15 [INFO] [stdout] | [INFO] [stdout] 697 | closure(&key, &value) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:697:21 [INFO] [stdout] | [INFO] [stdout] 697 | closure(&key, &value) [INFO] [stdout] | ^^^^^^ help: change this to: `value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/generators/mod.rs:705:3 [INFO] [stdout] | [INFO] [stdout] 705 | / match value { [INFO] [stdout] 706 | | &Value::Object(ref m) => match m.get("generators") { [INFO] [stdout] 707 | | Some(gen_val) => match gen_val { [INFO] [stdout] 708 | | &Value::Object(ref m) => generators.load_from_map(m)?, [INFO] [stdout] ... | [INFO] [stdout] 713 | | _ => () [INFO] [stdout] 714 | | } [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] 705 ~ if let &Value::Object(ref m) = value { match m.get("generators") { [INFO] [stdout] 706 + Some(gen_val) => match gen_val { [INFO] [stdout] 707 + &Value::Object(ref m) => generators.load_from_map(m)?, [INFO] [stdout] 708 + _ => () [INFO] [stdout] 709 + }, [INFO] [stdout] 710 + None => () [INFO] [stdout] 711 + } } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/generators/mod.rs:706:5 [INFO] [stdout] | [INFO] [stdout] 706 | &Value::Object(ref m) => match m.get("generators") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 706 - &Value::Object(ref m) => match m.get("generators") { [INFO] [stdout] 706 + Value::Object(m) => match m.get("generators") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/generators/mod.rs:707:24 [INFO] [stdout] | [INFO] [stdout] 707 | Some(gen_val) => match gen_val { [INFO] [stdout] | ________________________^ [INFO] [stdout] 708 | | &Value::Object(ref m) => generators.load_from_map(m)?, [INFO] [stdout] 709 | | _ => () [INFO] [stdout] 710 | | }, [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/generators/mod.rs:707:12 [INFO] [stdout] | [INFO] [stdout] 707 | Some(gen_val) => match gen_val { [INFO] [stdout] | ^^^^^^^ replace this binding [INFO] [stdout] 708 | &Value::Object(ref m) => generators.load_from_map(m)?, [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/generators/mod.rs:706:30 [INFO] [stdout] | [INFO] [stdout] 706 | &Value::Object(ref m) => match m.get("generators") { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 707 | | Some(gen_val) => match gen_val { [INFO] [stdout] 708 | | &Value::Object(ref m) => generators.load_from_map(m)?, [INFO] [stdout] 709 | | _ => () [INFO] [stdout] 710 | | }, [INFO] [stdout] 711 | | None => () [INFO] [stdout] 712 | | }, [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] 706 ~ &Value::Object(ref m) => if let Some(gen_val) = m.get("generators") { match gen_val { [INFO] [stdout] 707 + &Value::Object(ref m) => generators.load_from_map(m)?, [INFO] [stdout] 708 + _ => () [INFO] [stdout] 709 ~ } }, [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/generators/mod.rs:707:24 [INFO] [stdout] | [INFO] [stdout] 707 | Some(gen_val) => match gen_val { [INFO] [stdout] | ________________________^ [INFO] [stdout] 708 | | &Value::Object(ref m) => generators.load_from_map(m)?, [INFO] [stdout] 709 | | _ => () [INFO] [stdout] 710 | | }, [INFO] [stdout] | |_______^ help: try: `if let &Value::Object(ref m) = gen_val { generators.load_from_map(m)? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/generators/mod.rs:708:9 [INFO] [stdout] | [INFO] [stdout] 708 | &Value::Object(ref m) => generators.load_from_map(m)?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 708 - &Value::Object(ref m) => generators.load_from_map(m)?, [INFO] [stdout] 708 + Value::Object(m) => generators.load_from_map(m)?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/generators/mod.rs:780:5 [INFO] [stdout] | [INFO] [stdout] 780 | context.get(expression).map(|val| val.clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `context.get(expression).cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/generators/mod.rs:783:3 [INFO] [stdout] | [INFO] [stdout] 783 | data_type.clone().unwrap_or(DataType::RAW).wrap(result) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try dereferencing it: `(*data_type)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/generators/mod.rs:830:5 [INFO] [stdout] | [INFO] [stdout] 830 | / match self { [INFO] [stdout] 831 | | &Generator::RandomInt(min, max) => Ok(rand::rng().random_range(min as u16..(max as u16).saturating_add(1))), [INFO] [stdout] 832 | | &Generator::ProviderStateGenerator(ref exp, ref dt) => { [INFO] [stdout] ... | [INFO] [stdout] 847 | | _ => Err(anyhow!("Could not generate a u16 value from {} using {:?}", value, self)) [INFO] [stdout] 848 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] = note: `#[warn(clippy::match_ref_pats)]` on by default [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 830 ~ match *self { [INFO] [stdout] 831 ~ Generator::RandomInt(min, max) => Ok(rand::rng().random_range(min as u16..(max as u16).saturating_add(1))), [INFO] [stdout] 832 ~ Generator::ProviderStateGenerator(ref exp, ref dt) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/generators/mod.rs:832:7 [INFO] [stdout] | [INFO] [stdout] 832 | &Generator::ProviderStateGenerator(ref exp, ref dt) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 832 - &Generator::ProviderStateGenerator(ref exp, ref dt) => { [INFO] [stdout] 832 + Generator::ProviderStateGenerator(exp, dt) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/generators/mod.rs:863:32 [INFO] [stdout] | [INFO] [stdout] 863 | fn replace_with_regex(example: &String, url: String, re: Regex) -> String { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 863 - fn replace_with_regex(example: &String, url: String, re: Regex) -> String { [INFO] [stdout] 863 + fn replace_with_regex(example: &str, url: String, re: Regex) -> String { [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/generators/mod.rs:1259:9 [INFO] [stdout] | [INFO] [stdout] 1259 | / match self.value.pointer_mut(&pointer_str) { [INFO] [stdout] 1260 | | Some(json_value) => match generator.generate_value(&json_value.clone(), context, matcher) { [INFO] [stdout] 1261 | | Ok(new_value) => *json_value = new_value, [INFO] [stdout] 1262 | | Err(_) => () [INFO] [stdout] 1263 | | }, [INFO] [stdout] 1264 | | None => () [INFO] [stdout] 1265 | | } [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] 1259 ~ if let Some(json_value) = self.value.pointer_mut(&pointer_str) { match generator.generate_value(&json_value.clone(), context, matcher) { [INFO] [stdout] 1260 + Ok(new_value) => *json_value = new_value, [INFO] [stdout] 1261 + Err(_) => () [INFO] [stdout] 1262 + } } [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/generators/mod.rs:1260:31 [INFO] [stdout] | [INFO] [stdout] 1260 | Some(json_value) => match generator.generate_value(&json_value.clone(), context, matcher) { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 1261 | | Ok(new_value) => *json_value = new_value, [INFO] [stdout] 1262 | | Err(_) => () [INFO] [stdout] 1263 | | }, [INFO] [stdout] | |___________^ help: try: `if let Ok(new_value) = generator.generate_value(&json_value.clone(), context, matcher) { *json_value = new_value }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [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/generators/mod.rs:1268:7 [INFO] [stdout] | [INFO] [stdout] 1268 | / match generator.generate_value(&self.value.clone(), context, matcher) { [INFO] [stdout] 1269 | | Ok(new_value) => self.value = new_value, [INFO] [stdout] 1270 | | Err(_) => () [INFO] [stdout] 1271 | | } [INFO] [stdout] | |_______^ help: try: `if let Ok(new_value) = generator.generate_value(&self.value.clone(), context, matcher) { self.value = new_value }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/path_exp.rs:44:5 [INFO] [stdout] | [INFO] [stdout] 44 | / match self { [INFO] [stdout] 45 | | PathToken::Index(_) => true, [INFO] [stdout] 46 | | _ => false [INFO] [stdout] 47 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 44 - match self { [INFO] [stdout] 45 - PathToken::Index(_) => true, [INFO] [stdout] 46 - _ => false [INFO] [stdout] 47 - } [INFO] [stdout] 44 + matches!(self, PathToken::Index(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `DocPath` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/path_exp.rs:157:3 [INFO] [stdout] | [INFO] [stdout] 157 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/path_exp.rs:174:5 [INFO] [stdout] | [INFO] [stdout] 174 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 174 - return None; [INFO] [stdout] 174 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/path_exp.rs:184:5 [INFO] [stdout] | [INFO] [stdout] 184 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 184 - return None; [INFO] [stdout] 184 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/path_exp.rs:189:5 [INFO] [stdout] | [INFO] [stdout] 189 | &self.path_tokens == &[PathToken::Root] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 189 - &self.path_tokens == &[PathToken::Root] [INFO] [stdout] 189 + self.path_tokens == [PathToken::Root] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/path_exp.rs:322:26 [INFO] [stdout] | [INFO] [stdout] 322 | PathToken::Root => self.expr.push_str("$"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `self.expr.push('$')` [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: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/path_exp.rs:558:27 [INFO] [stdout] | [INFO] [stdout] 558 | chars.peek().map(|tup| (tup.0.clone(), tup.1.clone())) [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `tup.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/path_exp.rs:558:42 [INFO] [stdout] | [INFO] [stdout] 558 | chars.peek().map(|tup| (tup.0.clone(), tup.1.clone())) [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `tup.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/path_exp.rs:657:3 [INFO] [stdout] | [INFO] [stdout] 657 | / if let Some(ch) = next_char { [INFO] [stdout] 658 | | if ch.1 != ']' { [INFO] [stdout] 659 | | return Err(format!("Indexes can only consist of numbers or a \"*\", found \"{}\" instead in path expression \"{}\" at index... [INFO] [stdout] 660 | | ch.1, path, ch.0)) [INFO] [stdout] 661 | | } [INFO] [stdout] 662 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 657 ~ if let Some(ch) = next_char [INFO] [stdout] 658 ~ && ch.1 != ']' { [INFO] [stdout] 659 | return Err(format!("Indexes can only consist of numbers or a \"*\", found \"{}\" instead in path expression \"{}\" at index {}", [INFO] [stdout] 660 | ch.1, path, ch.0)) [INFO] [stdout] 661 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/query_strings.rs:36:27 [INFO] [stdout] | [INFO] [stdout] 36 | buffer.push('%' as u8); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'%'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/query_strings.rs:43:23 [INFO] [stdout] | [INFO] [stdout] 43 | buffer.push('%' as u8); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'%'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/query_strings.rs:46:26 [INFO] [stdout] | [INFO] [stdout] 46 | _ => buffer.push('%' as u8) [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'%'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/query_strings.rs:49:19 [INFO] [stdout] | [INFO] [stdout] 49 | buffer.push(' ' as u8); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b' '` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 16 [INFO] [stdout] --> src/query_strings.rs:76:21 [INFO] [stdout] | [INFO] [stdout] 76 | .filter(|u| u.is_digit(16)) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `u.is_ascii_hexdigit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] = note: `#[warn(clippy::is_digit_ascii_radix)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/query_strings.rs:78:11 [INFO] [stdout] | [INFO] [stdout] 78 | / match it.next() { [INFO] [stdout] 79 | | None => None, [INFO] [stdout] 80 | | Some(x) => Some((x, it.next().unwrap())) [INFO] [stdout] 81 | | } [INFO] [stdout] | |___________^ help: try: `it.next().map(|x| (x, it.next().unwrap()))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/query_strings.rs:112:40 [INFO] [stdout] | [INFO] [stdout] 112 | map.entry(name).or_insert_with(|| vec![]).push(value); [INFO] [stdout] | ^^^^^^^^^ help: replace the closure with `Vec::new`: `std::vec::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: match expression looks like `matches!` macro [INFO] [stdout] --> src/http_utils.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | / match self { [INFO] [stdout] 25 | | HttpAuth::None => true, [INFO] [stdout] 26 | | _ => false [INFO] [stdout] 27 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 24 - match self { [INFO] [stdout] 25 - HttpAuth::None => true, [INFO] [stdout] 26 - _ => false [INFO] [stdout] 27 - } [INFO] [stdout] 24 + matches!(self, HttpAuth::None) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/http_utils.rs:34:17 [INFO] [stdout] | [INFO] [stdout] 34 | let request = match auth { [INFO] [stdout] | _________________^ [INFO] [stdout] 35 | | &Some(ref auth) => { [INFO] [stdout] 36 | | match auth { [INFO] [stdout] 37 | | &HttpAuth::User(ref username, ref password) => client.get(url).basic_auth(username.clone(), password.clone()), [INFO] [stdout] ... | [INFO] [stdout] 42 | | &None => client.get(url) [INFO] [stdout] 43 | | }; [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 34 ~ let request = match *auth { [INFO] [stdout] 35 ~ Some(ref auth) => { [INFO] [stdout] 36 | match auth { [INFO] [stdout] ... [INFO] [stdout] 41 | }, [INFO] [stdout] 42 ~ None => client.get(url) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/http_utils.rs:35:5 [INFO] [stdout] | [INFO] [stdout] 35 | &Some(ref auth) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 35 - &Some(ref auth) => { [INFO] [stdout] 35 + Some(auth) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/http_utils.rs:36:7 [INFO] [stdout] | [INFO] [stdout] 36 | / match auth { [INFO] [stdout] 37 | | &HttpAuth::User(ref username, ref password) => client.get(url).basic_auth(username.clone(), password.clone()), [INFO] [stdout] 38 | | &HttpAuth::Token(ref token) => client.get(url).bearer_auth(token.clone()), [INFO] [stdout] 39 | | _ => client.get(url) [INFO] [stdout] 40 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 36 ~ match *auth { [INFO] [stdout] 37 ~ HttpAuth::User(ref username, ref password) => client.get(url).basic_auth(username.clone(), password.clone()), [INFO] [stdout] 38 ~ HttpAuth::Token(ref token) => client.get(url).bearer_auth(token.clone()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/http_utils.rs:37:9 [INFO] [stdout] | [INFO] [stdout] 37 | &HttpAuth::User(ref username, ref password) => client.get(url).basic_auth(username.clone(), password.clone()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 37 - &HttpAuth::User(ref username, ref password) => client.get(url).basic_auth(username.clone(), password.clone()), [INFO] [stdout] 37 + HttpAuth::User(username, password) => client.get(url).basic_auth(username.clone(), password.clone()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/http_utils.rs:38:9 [INFO] [stdout] | [INFO] [stdout] 38 | &HttpAuth::Token(ref token) => client.get(url).bearer_auth(token.clone()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 38 - &HttpAuth::Token(ref token) => client.get(url).bearer_auth(token.clone()), [INFO] [stdout] 38 + HttpAuth::Token(token) => client.get(url).bearer_auth(token.clone()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GeneratorCategory` which implements the `Copy` trait [INFO] [stdout] --> src/http_parts.rs:112:33 [INFO] [stdout] | [INFO] [stdout] 112 | let mr_category: Category = category.clone().into(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try dereferencing it: `(*category)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/request.rs:80:30 [INFO] [stdout] | [INFO] [stdout] 80 | self.lookup_header_value(&"content-type".to_string()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `"content-type"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: re-implementing `PartialEq::ne` is unnecessary [INFO] [stdout] --> src/request.rs:113:3 [INFO] [stdout] | [INFO] [stdout] 113 | fn ne(&self, other: &Self) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_ne_impl [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/response.rs:172:30 [INFO] [stdout] | [INFO] [stdout] 172 | self.lookup_header_value(&"content-type".to_string()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `"content-type"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: re-implementing `PartialEq::ne` is unnecessary [INFO] [stdout] --> src/response.rs:197:3 [INFO] [stdout] | [INFO] [stdout] 197 | fn ne(&self, other: &Self) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_ne_impl [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/interaction.rs:203:15 [INFO] [stdout] | [INFO] [stdout] 203 | if let Some(&Value::Array(ref array)) = pact_json.get("interactions") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 203 - if let Some(&Value::Array(ref array)) = pact_json.get("interactions") { [INFO] [stdout] 203 + if let Some(Value::Array(array)) = pact_json.get("interactions") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/sync_interaction.rs:165:39 [INFO] [stdout] | [INFO] [stdout] 165 | let id = pact_json.get("_id").map(|id| json_to_string(id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [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: match expression looks like `matches!` macro [INFO] [stdout] --> src/sync_interaction.rs:218:32 [INFO] [stdout] | [INFO] [stdout] 218 | .filter(|difference| match difference.0 { [INFO] [stdout] | ________________________________^ [INFO] [stdout] 219 | | DifferenceType::MatchingRules | DifferenceType::Body | DifferenceType::Headers => false, [INFO] [stdout] 220 | | _ => true [INFO] [stdout] 221 | | }) [INFO] [stdout] | |___________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 218 - .filter(|difference| match difference.0 { [INFO] [stdout] 219 - DifferenceType::MatchingRules | DifferenceType::Body | DifferenceType::Headers => false, [INFO] [stdout] 220 - _ => true [INFO] [stdout] 221 - }) [INFO] [stdout] 218 + .filter(|difference| !matches!(difference.0, DifferenceType::MatchingRules | DifferenceType::Body | DifferenceType::Headers)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/sync_interaction.rs:237:22 [INFO] [stdout] | [INFO] [stdout] 237 | description: format!("You can not combine message and request/response interactions") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"You can not combine message and request/response interactions".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: useless use of `format!` [INFO] [stdout] --> src/sync_interaction.rs:288:58 [INFO] [stdout] | [INFO] [stdout] 288 | ... format!("'providerState' is deprecated, use 'providerStates' instead"))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"'providerState' is deprecated, use 'providerStates' instead".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: useless use of `format!` [INFO] [stdout] --> src/sync_interaction.rs:293:56 [INFO] [stdout] | [INFO] [stdout] 293 | ... format!("'provider_state' is deprecated, use 'providerStates' instead"))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"'provider_state' is deprecated, use 'providerStates' instead".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: deref which would be done by auto-deref [INFO] [stdout] --> src/sync_interaction.rs:303:44 [INFO] [stdout] | [INFO] [stdout] 303 | ProviderState::verify_json(&*format!("{}/providerStates/{}", path, index), state, strict, spec_version) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&format!("{}/providerStates/{}", path, index)` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/sync_interaction.rs:317:58 [INFO] [stdout] | [INFO] [stdout] 317 | ... &format!("Unexpected attribute '{}'", key))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Unexpected attribute '{}'", key)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/message.rs:188:46 [INFO] [stdout] | [INFO] [stdout] 188 | let id = json.get("_id").map(|id| json_to_string(id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/message.rs:198:24 [INFO] [stdout] | [INFO] [stdout] 198 | Some(&Value::Object(ref v)) => v.iter().map(|(k, v)| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 198 - Some(&Value::Object(ref v)) => v.iter().map(|(k, v)| { [INFO] [stdout] 198 + Some(Value::Object(v)) => v.iter().map(|(k, v)| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/message.rs:209:18 [INFO] [stdout] | [INFO] [stdout] 209 | .map(|s| ContentType::parse(s.as_str()).ok()) [INFO] [stdout] | __________________^ [INFO] [stdout] 210 | | .flatten(); [INFO] [stdout] | |__________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|s| ContentType::parse(s.as_str()).ok())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/message.rs:299:59 [INFO] [stdout] | [INFO] [stdout] 299 | Some((_, v)) => ContentType::parse(json_to_string(&v).as_str()).ok(), [INFO] [stdout] | ^^ help: change this to: `v` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/pact.rs:159:23 [INFO] [stdout] | [INFO] [stdout] 159 | load_pact_from_json(&*path.to_string_lossy(), &pact_json) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&path.to_string_lossy()` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pact.rs:179:54 [INFO] [stdout] | [INFO] [stdout] 179 | PactSpecification::V4 => v4::pact::from_json(&source, json), [INFO] [stdout] | ^^^^^^^ help: change this to: `source` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:229:68 [INFO] [stdout] | [INFO] [stdout] 229 | let mut f = fs::OpenOptions::new().read(true).write(true).open(&path)?; [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/pact.rs:261:16 [INFO] [stdout] | [INFO] [stdout] 261 | Some(v) => match *v { [INFO] [stdout] | ________________^ [INFO] [stdout] 262 | | Value::Object(ref obj) => obj.iter().map(|(k, v)| { [INFO] [stdout] 263 | | let val = match *v { [INFO] [stdout] 264 | | Value::Object(ref obj) => obj.iter().map(|(k, v)| { [INFO] [stdout] ... | [INFO] [stdout] 279 | | _ => btreemap!{} [INFO] [stdout] 280 | | }, [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/pact.rs:261:10 [INFO] [stdout] | [INFO] [stdout] 260 | match pact_json.get("metadata") { [INFO] [stdout] | ------------------------- use: `pact_json.get("metadata").copied()` [INFO] [stdout] 261 | Some(v) => match *v { [INFO] [stdout] | ^ replace this binding [INFO] [stdout] 262 | Value::Object(ref obj) => obj.iter().map(|(k, v)| { [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:389:54 [INFO] [stdout] | [INFO] [stdout] 389 | ... &format!("'pact-specification' is deprecated, use 'pactSpecification' instead"))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("'pact-specification' is deprecated, use 'pactSpecification' instead")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/pact.rs:389:55 [INFO] [stdout] | [INFO] [stdout] 389 | ... &format!("'pact-specification' is deprecated, use 'pactSpecification' instead"))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"'pact-specification' is deprecated, use 'pactSpecification' instead".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: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:397:54 [INFO] [stdout] | [INFO] [stdout] 397 | ... &format!("'pactSpecificationVersion' is deprecated, use 'pactSpecification/version' instead"))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("'pactSpecificationVersion' is deprecated, use 'pactSpecification/version' instead")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/pact.rs:397:55 [INFO] [stdout] | [INFO] [stdout] 397 | ... &format!("'pactSpecificationVersion' is deprecated, use 'pactSpecification/version' instead"))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"'pactSpecificationVersion' is deprecated, use 'pactSpecification/version' instead".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: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:406:77 [INFO] [stdout] | [INFO] [stdout] 406 | ... &format!("pactSpecification version is NULL"))), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("pactSpecification version is NULL")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/pact.rs:406:78 [INFO] [stdout] | [INFO] [stdout] 406 | ... &format!("pactSpecification version is NULL"))), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"pactSpecification version is NULL".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: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:409:64 [INFO] [stdout] | [INFO] [stdout] 409 | ... &format!("'{}' is not a valid Pact specification version", version))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("'{}' is not a valid Pact specification version", version)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:412:67 [INFO] [stdout] | [INFO] [stdout] 412 | ... &format!("Version must be a String, got {}", json_type_of(version)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Version must be a String, got {}", json_type_of(version))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:416:60 [INFO] [stdout] | [INFO] [stdout] 416 | ... &format!("pactSpecification is missing the version attribute"))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("pactSpecification is missing the version attribute")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/pact.rs:416:61 [INFO] [stdout] | [INFO] [stdout] 416 | ... &format!("pactSpecification is missing the version attribute"))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"pactSpecification is missing the version attribute".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: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:420:61 [INFO] [stdout] | [INFO] [stdout] 420 | ... &format!("pactSpecification must be an Object, got {}", json_type_of(spec)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("pactSpecification must be an Object, got {}", json_type_of(spec))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:425:55 [INFO] [stdout] | [INFO] [stdout] 425 | ... &format!("Metadata must be an Object, got {}", json_type_of(metadata)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Metadata must be an Object, got {}", json_type_of(metadata))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/sync_pact.rs:90:8 [INFO] [stdout] | [INFO] [stdout] 90 | .filter(|i| i.is_some()) [INFO] [stdout] | ________^ [INFO] [stdout] 91 | | .map(|i| i.unwrap()) [INFO] [stdout] | |__________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `PactSpecification` which implements the `Copy` trait [INFO] [stdout] --> src/sync_pact.rs:103:5 [INFO] [stdout] | [INFO] [stdout] 103 | self.specification_version.clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.specification_version` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/sync_pact.rs:164:28 [INFO] [stdout] | [INFO] [stdout] 164 | determine_spec_version(&"".to_string(), &self.metadata) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `PactSpecification` which implements the `Copy` trait [INFO] [stdout] --> src/sync_pact.rs:187:55 [INFO] [stdout] | [INFO] [stdout] 187 | interactions: parse_interactions(pact_json, spec_version.clone())?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `spec_version` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `default` can be confused for the standard trait method `std::default::Default::default` [INFO] [stdout] --> src/sync_pact.rs:229:3 [INFO] [stdout] | [INFO] [stdout] 229 | / pub fn default() -> RequestResponsePact { [INFO] [stdout] 230 | | RequestResponsePact { [INFO] [stdout] 231 | | consumer: Consumer { name: "default_consumer".to_string() }, [INFO] [stdout] 232 | | provider: Provider { name: "default_provider".to_string() }, [INFO] [stdout] ... | [INFO] [stdout] 237 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `PactSpecification` which implements the `Copy` trait [INFO] [stdout] --> src/sync_pact.rs:334:36 [INFO] [stdout] | [INFO] [stdout] 334 | specification_version: self.specification_version.clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.specification_version` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/sync_pact.rs:383:63 [INFO] [stdout] | [INFO] [stdout] 383 | ... &format!("Must be an Object, got {}", json_type_of(pact_json)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Must be an Object, got {}", json_type_of(pact_json))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/sync_pact.rs:396:58 [INFO] [stdout] | [INFO] [stdout] 396 | results.push(PactFileVerificationResult::new(&format!("/{}", key), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("/{}", key)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/sync_pact.rs:398:58 [INFO] [stdout] | [INFO] [stdout] 398 | ... &format!("Unexpected attribute '{}'", key))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Unexpected attribute '{}'", key)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/sync_pact.rs:403:57 [INFO] [stdout] | [INFO] [stdout] 403 | ... &format!("Must be an Object, got {}", json_type_of(pact_json)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Must be an Object, got {}", json_type_of(pact_json))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/message_pact.rs:96:8 [INFO] [stdout] | [INFO] [stdout] 96 | .filter(|i| i.is_some()) [INFO] [stdout] | ________^ [INFO] [stdout] 97 | | .map(|i| i.unwrap()) [INFO] [stdout] | |__________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `PactSpecification` which implements the `Copy` trait [INFO] [stdout] --> src/message_pact.rs:109:5 [INFO] [stdout] | [INFO] [stdout] 109 | self.specification_version.clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.specification_version` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `PactSpecification` which implements the `Copy` trait [INFO] [stdout] --> src/message_pact.rs:206:36 [INFO] [stdout] | [INFO] [stdout] 206 | specification_version: spec_version.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `spec_version` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `default` can be confused for the standard trait method `std::default::Default::default` [INFO] [stdout] --> src/message_pact.rs:272:5 [INFO] [stdout] | [INFO] [stdout] 272 | / pub fn default() -> MessagePact { [INFO] [stdout] 273 | | MessagePact { [INFO] [stdout] 274 | | consumer: Consumer { name: "default_consumer".to_string() }, [INFO] [stdout] 275 | | provider: Provider { name: "default_provider".to_string() }, [INFO] [stdout] ... | [INFO] [stdout] 280 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/message_pact.rs:362:9 [INFO] [stdout] | [INFO] [stdout] 362 | &format!("Must be an Object, got {}", json_type_of(pact_json)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Must be an Object, got {}", json_type_of(pact_json))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/lib.rs:98:1 [INFO] [stdout] | [INFO] [stdout] 98 | / impl Default for PactSpecification { [INFO] [stdout] 99 | | fn default() -> Self { [INFO] [stdout] 100 | | PactSpecification::Unknown [INFO] [stdout] 101 | | } [INFO] [stdout] 102 | | } [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 and mark the default variant [INFO] [stdout] | [INFO] [stdout] 83 + #[derive(Default)] [INFO] [stdout] 84 | pub enum PactSpecification { [INFO] [stdout] 85 | /// Unknown or unsupported specification version [INFO] [stdout] 86 ~ #[default] [INFO] [stdout] 87 ~ Unknown, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/lib.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | //! `chronos` crate as a dependency. [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] = note: `#[warn(clippy::doc_lazy_continuation)]` on by default [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 8 | //! `chronos` crate as a dependency. [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: doc list item without indentation [INFO] [stdout] --> src/lib.rs:10:5 [INFO] [stdout] | [INFO] [stdout] 10 | //! crate as a dependency. [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: if this is supposed to be its own paragraph, add a blank line [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation [INFO] [stdout] help: indent this line [INFO] [stdout] | [INFO] [stdout] 10 | //! crate as a dependency. [INFO] [stdout] | ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct update has no effect, all the fields in the struct have already been specified [INFO] [stdout] --> src/content_types.rs:227:10 [INFO] [stdout] | [INFO] [stdout] 227 | .. ContentType::default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_update [INFO] [stdout] = note: `#[warn(clippy::needless_update)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/content_types.rs:240:1 [INFO] [stdout] | [INFO] [stdout] 240 | impl Into for &ContentType { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] = note: `#[warn(clippy::from_over_into)]` on by default [INFO] [stdout] help: replace the `Into` implementation with `From<&content_types::ContentType>` [INFO] [stdout] | [INFO] [stdout] 240 ~ impl From<&ContentType> for String { [INFO] [stdout] 241 ~ fn from(val: &ContentType) -> Self { [INFO] [stdout] 242 ~ val.to_string() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/content_types.rs:300:39 [INFO] [stdout] | [INFO] [stdout] 300 | } else if is_match(&HTMLREGEXP, &*s.to_uppercase()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `&s.to_uppercase()` [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 `impl` can be derived [INFO] [stdout] --> src/content_types.rs:322:1 [INFO] [stdout] | [INFO] [stdout] 322 | / impl Default for ContentTypeHint { [INFO] [stdout] 323 | | fn default() -> Self { [INFO] [stdout] 324 | | ContentTypeHint::DEFAULT [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#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 316 + #[derive(Default)] [INFO] [stdout] 317 | pub enum ContentTypeHint { [INFO] [stdout] 318 | BINARY, [INFO] [stdout] 319 | TEXT, [INFO] [stdout] 320 ~ #[default] [INFO] [stdout] 321 ~ DEFAULT [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/bodies.rs:121:88 [INFO] [stdout] | [INFO] [stdout] 121 | OptionalBody::Present(b, _, h) => OptionalBody::Present(b.clone(), content_type, h.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*h` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/bodies.rs:132:71 [INFO] [stdout] | [INFO] [stdout] 132 | OptionalBody::Present(b.clone(), ct.clone().or(content_type), h.clone()), [INFO] [stdout] | ^^^^^^^^^ help: try dereferencing it: `*h` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/bodies.rs:261:1 [INFO] [stdout] | [INFO] [stdout] 261 | / impl Default for OptionalBody { [INFO] [stdout] 262 | | fn default() -> Self { [INFO] [stdout] 263 | | OptionalBody::Missing [INFO] [stdout] 264 | | } [INFO] [stdout] 265 | | } [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 and mark the default variant [INFO] [stdout] | [INFO] [stdout] 21 + #[derive(Default)] [INFO] [stdout] 22 | pub enum OptionalBody { [INFO] [stdout] 23 | /// A body is missing if it is not present in the pact file [INFO] [stdout] 24 ~ #[default] [INFO] [stdout] 25 ~ Missing, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/v4/http_parts.rs:357:41 [INFO] [stdout] | [INFO] [stdout] 357 | buf.extend_from_slice(&*body_bytes); [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `&body_bytes` [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: redundant closure [INFO] [stdout] --> src/v4/interaction.rs:34:42 [INFO] [stdout] | [INFO] [stdout] 34 | markup: values.get("markup").map(|val| json_to_string(val)).unwrap_or_default(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [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: redundant closure [INFO] [stdout] --> src/v4/interaction.rs:35:51 [INFO] [stdout] | [INFO] [stdout] 35 | markup_type: values.get("markupType").map(|val| json_to_string(val)).unwrap_or_default() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/synch_http.rs:78:36 [INFO] [stdout] | [INFO] [stdout] 78 | let id = json.get("_id").map(|id| json_to_string(id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/synch_http.rs:79:37 [INFO] [stdout] | [INFO] [stdout] 79 | let key = json.get("key").map(|id| json_to_string(id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/synch_http.rs:107:14 [INFO] [stdout] | [INFO] [stdout] 107 | .map(|markup| InteractionMarkup::from_json(markup)).unwrap_or_default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `InteractionMarkup::from_json` [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/v4/message_parts.rs:41:14 [INFO] [stdout] | [INFO] [stdout] 41 | Some(&Value::Object(ref v)) => v.iter().map(|(k, v)| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] = note: `#[warn(clippy::needless_borrowed_reference)]` on by default [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 41 - Some(&Value::Object(ref v)) => v.iter().map(|(k, v)| { [INFO] [stdout] 41 + Some(Value::Object(v)) => v.iter().map(|(k, v)| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/sync_message.rs:79:36 [INFO] [stdout] | [INFO] [stdout] 79 | let id = json.get("_id").map(|id| json_to_string(id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/sync_message.rs:80:37 [INFO] [stdout] | [INFO] [stdout] 80 | let key = json.get("key").map(|id| json_to_string(id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/sync_message.rs:110:16 [INFO] [stdout] | [INFO] [stdout] 110 | .map(|message| MessageContents::from_json(message)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `MessageContents::from_json` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/sync_message.rs:115:14 [INFO] [stdout] | [INFO] [stdout] 115 | .map(|markup| InteractionMarkup::from_json(markup)).unwrap_or_default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `InteractionMarkup::from_json` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/async_message.rs:88:36 [INFO] [stdout] | [INFO] [stdout] 88 | let id = json.get("_id").map(|id| json_to_string(id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/async_message.rs:89:37 [INFO] [stdout] | [INFO] [stdout] 89 | let key = json.get("key").map(|id| json_to_string(id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/v4/async_message.rs:112:14 [INFO] [stdout] | [INFO] [stdout] 112 | Some(&Value::Object(ref v)) => v.iter().map(|(k, v)| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 112 - Some(&Value::Object(ref v)) => v.iter().map(|(k, v)| { [INFO] [stdout] 112 + Some(Value::Object(v)) => v.iter().map(|(k, v)| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/v4/async_message.rs:121:14 [INFO] [stdout] | [INFO] [stdout] 121 | .map(|markup| InteractionMarkup::from_json(markup)).unwrap_or_default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `InteractionMarkup::from_json` [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/v4/async_message.rs:299:5 [INFO] [stdout] | [INFO] [stdout] 299 | / if let Some(content_type) = self.contents.contents.content_type() { [INFO] [stdout] 300 | | if let Vacant(entry) = metadata.entry("contentType".to_string()) { [INFO] [stdout] 301 | | entry.insert(json!( content_type.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] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 299 ~ if let Some(content_type) = self.contents.contents.content_type() [INFO] [stdout] 300 ~ && let Vacant(entry) = metadata.entry("contentType".to_string()) { [INFO] [stdout] 301 | entry.insert(json!( content_type.to_string() )); [INFO] [stdout] 302 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/v4/pact.rs:134:74 [INFO] [stdout] | [INFO] [stdout] 134 | pub fn find_interaction_with_id(&self, interaction_id: &str) -> Option<&Box> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn V4Interaction + Send + Sync + RefUnwindSafe)` [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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/v4/pact.rs:146:44 [INFO] [stdout] | [INFO] [stdout] 146 | let mut metadata = meta_data_from_json(&json); [INFO] [stdout] | ^^^^^ help: change this to: `json` [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/v4/pact.rs:162:44 [INFO] [stdout] | [INFO] [stdout] 162 | interactions: interactions_from_json(&json, source)?, [INFO] [stdout] | ^^^^^ help: change this to: `json` [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: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/v4/pact.rs:187:26 [INFO] [stdout] | [INFO] [stdout] 187 | self.metadata.iter().map(|(k, v)| { [INFO] [stdout] | __________________________^ [INFO] [stdout] 188 | | match v { [INFO] [stdout] 189 | | Value::Object(map) => Some((k.clone(), map.iter() [INFO] [stdout] 190 | | .map(|(k, v)| (k.clone(), json_to_string(v))).collect())), [INFO] [stdout] ... | [INFO] [stdout] 193 | | }).flatten() [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] = note: `#[warn(clippy::map_flatten)]` on by default [INFO] [stdout] help: try replacing `map` with `filter_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 187 ~ self.metadata.iter().filter_map(|(k, v)| { [INFO] [stdout] 188 + match v { [INFO] [stdout] 189 + Value::Object(map) => Some((k.clone(), map.iter() [INFO] [stdout] 190 + .map(|(k, v)| (k.clone(), json_to_string(v))).collect())), [INFO] [stdout] 191 + _ => None [INFO] [stdout] 192 + } [INFO] [stdout] 193 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/v4/pact.rs:222:8 [INFO] [stdout] | [INFO] [stdout] 222 | .map(|i| i.as_request_response()) [INFO] [stdout] | ________^ [INFO] [stdout] 223 | | .flatten() [INFO] [stdout] | |________________^ help: try replacing `map` with `filter_map` and remove the `.flatten()`: `filter_map(|i| i.as_request_response())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/v4/pact.rs:225:41 [INFO] [stdout] | [INFO] [stdout] 225 | let metadata = self.metadata.iter().map(|(k, v)| { [INFO] [stdout] | _________________________________________^ [INFO] [stdout] 226 | | if k == "pactSpecification" { [INFO] [stdout] 227 | | Some((k.clone(), btreemap!{"version".to_string() => PactSpecification::V3.version_str()})) [INFO] [stdout] 228 | | } else { [INFO] [stdout] ... | [INFO] [stdout] 235 | | }).flatten() [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `filter_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 225 ~ let metadata = self.metadata.iter().filter_map(|(k, v)| { [INFO] [stdout] 226 + if k == "pactSpecification" { [INFO] [stdout] 227 + Some((k.clone(), btreemap!{"version".to_string() => PactSpecification::V3.version_str()})) [INFO] [stdout] 228 + } else { [INFO] [stdout] 229 + match v { [INFO] [stdout] 230 + Value::Object(map) => Some((k.clone(), map.iter() [INFO] [stdout] 231 + .map(|(k, v)| (k.clone(), json_to_string(v))).collect())), [INFO] [stdout] 232 + _ => None [INFO] [stdout] 233 + } [INFO] [stdout] 234 + } [INFO] [stdout] 235 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/v4/pact.rs:248:8 [INFO] [stdout] | [INFO] [stdout] 248 | .map(|i| i.as_message()) [INFO] [stdout] | ________^ [INFO] [stdout] 249 | | .flatten() [INFO] [stdout] | |________________^ help: try replacing `map` with `filter_map` and remove the `.flatten()`: `filter_map(|i| i.as_message())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Iterator` [INFO] [stdout] --> src/v4/pact.rs:251:41 [INFO] [stdout] | [INFO] [stdout] 251 | let metadata = self.metadata.iter().map(|(k, v)| { [INFO] [stdout] | _________________________________________^ [INFO] [stdout] 252 | | match v { [INFO] [stdout] 253 | | Value::Object(map) => Some((k.clone(), map.iter() [INFO] [stdout] 254 | | .map(|(k, v)| (k.clone(), json_to_string(v))).collect())), [INFO] [stdout] ... | [INFO] [stdout] 257 | | }).flatten() [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `filter_map` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 251 ~ let metadata = self.metadata.iter().filter_map(|(k, v)| { [INFO] [stdout] 252 + match v { [INFO] [stdout] 253 + Value::Object(map) => Some((k.clone(), map.iter() [INFO] [stdout] 254 + .map(|(k, v)| (k.clone(), json_to_string(v))).collect())), [INFO] [stdout] 255 + _ => None [INFO] [stdout] 256 + } [INFO] [stdout] 257 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/v4/pact.rs:337:1 [INFO] [stdout] | [INFO] [stdout] 337 | / impl Default for V4Pact { [INFO] [stdout] 338 | | fn default() -> Self { [INFO] [stdout] 339 | | V4Pact { [INFO] [stdout] 340 | | consumer: Default::default(), [INFO] [stdout] ... | [INFO] [stdout] 347 | | } [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] 32 + #[derive(Default)] [INFO] [stdout] 33 | pub struct V4Pact { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/v4/pact.rs:356:33 [INFO] [stdout] | [INFO] [stdout] 356 | Self::pact_from_json(&json, &*path.to_string_lossy()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&path.to_string_lossy()` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/v4/pact.rs:430:57 [INFO] [stdout] | [INFO] [stdout] 430 | ... &format!("Must be an Object, got {}", json_type_of(pact_json)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Must be an Object, got {}", json_type_of(pact_json))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/v4/mod.rs:32:1 [INFO] [stdout] | [INFO] [stdout] 32 | / impl Default for V4InteractionType { [INFO] [stdout] 33 | | fn default() -> Self { [INFO] [stdout] 34 | | V4InteractionType::Synchronous_HTTP [INFO] [stdout] 35 | | } [INFO] [stdout] 36 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 23 + #[derive(Default)] [INFO] [stdout] 24 | pub enum V4InteractionType { [INFO] [stdout] 25 | /// Synchronous HTTP Request Response [INFO] [stdout] 26 ~ #[default] [INFO] [stdout] 27 ~ Synchronous_HTTP, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/v4/mod.rs:66:34 [INFO] [stdout] | [INFO] [stdout] 66 | .or_else(|| headers.as_ref().map(|h| { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 67 | | match h.iter().find(|kv| kv.0.to_lowercase() == "content-type") { [INFO] [stdout] 68 | | Some((_, v)) => ContentType::parse(v[0].as_str()).ok(), [INFO] [stdout] 69 | | None => None [INFO] [stdout] 70 | | } [INFO] [stdout] 71 | | }).flatten()) [INFO] [stdout] | |________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] help: try replacing `map` with `and_then` and remove the `.flatten()` [INFO] [stdout] | [INFO] [stdout] 66 ~ .or_else(|| headers.as_ref().and_then(|h| { [INFO] [stdout] 67 + match h.iter().find(|kv| kv.0.to_lowercase() == "content-type") { [INFO] [stdout] 68 + Some((_, v)) => ContentType::parse(v[0].as_str()).ok(), [INFO] [stdout] 69 + None => None [INFO] [stdout] 70 + } [INFO] [stdout] 71 ~ })) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/v4/mod.rs:74:38 [INFO] [stdout] | [INFO] [stdout] 74 | detect_content_type_from_bytes(&*body.value().unwrap_or_default()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&body.value().unwrap_or_default()` [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: redundant closure [INFO] [stdout] --> src/provider_states.rs:67:45 [INFO] [stdout] | [INFO] [stdout] 67 | Value::Array(ref a) => a.iter().map(|i| ProviderState::from_json_v3(i)).collect(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `ProviderState::from_json_v3` [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/provider_states.rs:143:9 [INFO] [stdout] | [INFO] [stdout] 143 | / if let Some(params) = values.get("params") { [INFO] [stdout] 144 | | if !params.is_object() { [INFO] [stdout] 145 | | results.push(PactFileVerificationResult::new(path, ResultLevel::ERROR, [INFO] [stdout] 146 | | format!("Provider state 'params' must be an Object, got {}", json_type_of(pact_json)))) [INFO] [stdout] 147 | | } [INFO] [stdout] 148 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 143 ~ if let Some(params) = values.get("params") [INFO] [stdout] 144 ~ && !params.is_object() { [INFO] [stdout] 145 | results.push(PactFileVerificationResult::new(path, ResultLevel::ERROR, [INFO] [stdout] 146 | format!("Provider state 'params' must be an Object, got {}", json_type_of(pact_json)))) [INFO] [stdout] 147 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/json_utils.rs:108:22 [INFO] [stdout] | [INFO] [stdout] 108 | map.get(field).map(|f| json_to_string(f)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [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: manual implementation of `ok` [INFO] [stdout] --> src/json_utils.rs:155:9 [INFO] [stdout] | [INFO] [stdout] 155 | / match ContentType::parse(kv.1[0].as_str()) { [INFO] [stdout] 156 | | Ok(v) => Some(v), [INFO] [stdout] 157 | | Err(_) => None [INFO] [stdout] 158 | | } [INFO] [stdout] | |_________^ help: replace with: `ContentType::parse(kv.1[0].as_str()).ok()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err [INFO] [stdout] = note: `#[warn(clippy::manual_ok_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/json_utils.rs:250:3 [INFO] [stdout] | [INFO] [stdout] 240 | / let expanded_paths = root.descendants(&tree).fold(Vec::::new(), |mut acc, node_id| { [INFO] [stdout] 241 | | let node = tree.index(node_id); [INFO] [stdout] 242 | | if !node.get().is_empty() && node.first_child().is_none() { [INFO] [stdout] 243 | | let path: Vec = node_id.ancestors(&tree).map(|n| format!("{}", tree.index(n).get())).collect(); [INFO] [stdout] ... | [INFO] [stdout] 248 | | acc [INFO] [stdout] 249 | | }); [INFO] [stdout] | |_____- unnecessary `let` binding [INFO] [stdout] 250 | expanded_paths [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 240 ~ [INFO] [stdout] 241 ~ root.descendants(&tree).fold(Vec::::new(), |mut acc, node_id| { [INFO] [stdout] 242 + let node = tree.index(node_id); [INFO] [stdout] 243 + if !node.get().is_empty() && node.first_child().is_none() { [INFO] [stdout] 244 + let path: Vec = node_id.ancestors(&tree).map(|n| format!("{}", tree.index(n).get())).collect(); [INFO] [stdout] 245 + if path.len() == expression.len() { [INFO] [stdout] 246 + acc.push(path.iter().rev().join("/")); [INFO] [stdout] 247 + } [INFO] [stdout] 248 + } [INFO] [stdout] 249 + acc [INFO] [stdout] 250 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/json_utils.rs:243:64 [INFO] [stdout] | [INFO] [stdout] 243 | let path: Vec = node_id.ancestors(&tree).map(|n| format!("{}", tree.index(n).get())).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `tree.index(n).get().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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/json_utils.rs:253:33 [INFO] [stdout] | [INFO] [stdout] 253 | fn query_object_graph(path_exp: &Vec, tree: &mut Arena, root: NodeId, body: Value) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 253 - fn query_object_graph(path_exp: &Vec, tree: &mut Arena, root: NodeId, body: Value) { [INFO] [stdout] 253 + fn query_object_graph(path_exp: &[PathToken], tree: &mut Arena, root: NodeId, body: Value) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/json_utils.rs:257:3 [INFO] [stdout] | [INFO] [stdout] 257 | / loop { [INFO] [stdout] 258 | | match it.next() { [INFO] [stdout] 259 | | Some(token) => { [INFO] [stdout] 260 | | match token { [INFO] [stdout] ... | [INFO] [stdout] 313 | | } [INFO] [stdout] | |___^ help: try: `while let Some(token) = it.next() { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` 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/json_utils.rs:328:35 [INFO] [stdout] | [INFO] [stdout] 328 | expect!(::json_to_number(&json!({ "min": 5 }).as_object().unwrap(), "any", 1)).to(be_equal_to(1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_utils.rs:329:35 [INFO] [stdout] | [INFO] [stdout] 329 | expect!(::json_to_number(&json!({ "min": "5" }).as_object().unwrap(), "min", 1)).to(be_equal_to(1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": "5" }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_utils.rs:330:35 [INFO] [stdout] | [INFO] [stdout] 330 | expect!(::json_to_number(&json!({ "min": 5 }).as_object().unwrap(), "min", 1)).to(be_equal_to(5)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_utils.rs:331:35 [INFO] [stdout] | [INFO] [stdout] 331 | expect!(::json_to_number(&json!({ "min": -5 }).as_object().unwrap(), "min", 1)).to(be_equal_to(-5)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": -5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_utils.rs:332:35 [INFO] [stdout] | [INFO] [stdout] 332 | expect!(::json_to_number(&json!({ "min": 5.0 }).as_object().unwrap(), "min", 1)).to(be_equal_to(1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": 5.0 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_utils.rs:335:35 [INFO] [stdout] | [INFO] [stdout] 335 | expect!(::json_to_number(&json!({ "min": 5 }).as_object().unwrap(), "any", 1)).to(be_equal_to(1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_utils.rs:336:35 [INFO] [stdout] | [INFO] [stdout] 336 | expect!(::json_to_number(&json!({ "min": "5" }).as_object().unwrap(), "min", 1)).to(be_equal_to(1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": "5" }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_utils.rs:337:35 [INFO] [stdout] | [INFO] [stdout] 337 | expect!(::json_to_number(&json!({ "min": 5 }).as_object().unwrap(), "min", 1)).to(be_equal_to(5)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_utils.rs:338:35 [INFO] [stdout] | [INFO] [stdout] 338 | expect!(::json_to_number(&json!({ "min": -5 }).as_object().unwrap(), "min", 1)).to(be_equal_to(1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": -5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_utils.rs:339:35 [INFO] [stdout] | [INFO] [stdout] 339 | expect!(::json_to_number(&json!({ "min": 5.0 }).as_object().unwrap(), "min", 1)).to(be_equal_to(1)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": 5.0 }).as_object().unwrap()` [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 closure [INFO] [stdout] --> src/expression_parser.rs:353:32 [INFO] [stdout] | [INFO] [stdout] 353 | self.context.get(name).map(|val| json_to_string(val)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/expression_parser.rs:405:32 [INFO] [stdout] | [INFO] [stdout] 405 | Ok(json!(result.iter().map(|val| json_to_string(val)).join(""))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/time_utils.rs:828:44 [INFO] [stdout] | [INFO] [stdout] 828 | fn validate_matched_values(matched_values: &Vec<(DateTimePatternToken, String)>) -> Result<(), String> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 828 - fn validate_matched_values(matched_values: &Vec<(DateTimePatternToken, String)>) -> Result<(), String> { [INFO] [stdout] 828 + fn validate_matched_values(matched_values: &[(DateTimePatternToken, String)]) -> Result<(), String> { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/time_utils.rs:831:24 [INFO] [stdout] | [INFO] [stdout] 831 | .find(|(token, _)| match token { [INFO] [stdout] | ________________________^ [INFO] [stdout] 832 | | DateTimePatternToken::DayInMonth => true, [INFO] [stdout] 833 | | _ => false [INFO] [stdout] 834 | | }); [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] = note: `#[warn(clippy::match_like_matches_macro)]` on by default [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 831 - .find(|(token, _)| match token { [INFO] [stdout] 832 - DateTimePatternToken::DayInMonth => true, [INFO] [stdout] 833 - _ => false [INFO] [stdout] 834 - }); [INFO] [stdout] 831 + .find(|(token, _)| matches!(token, DateTimePatternToken::DayInMonth)); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/time_utils.rs:836:24 [INFO] [stdout] | [INFO] [stdout] 836 | .find(|(token, _)| match token { [INFO] [stdout] | ________________________^ [INFO] [stdout] 837 | | DateTimePatternToken::Month(_) => true, [INFO] [stdout] 838 | | _ => false [INFO] [stdout] 839 | | }); [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 836 - .find(|(token, _)| match token { [INFO] [stdout] 837 - DateTimePatternToken::Month(_) => true, [INFO] [stdout] 838 - _ => false [INFO] [stdout] 839 - }); [INFO] [stdout] 836 + .find(|(token, _)| matches!(token, DateTimePatternToken::Month(_))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/time_utils.rs:841:24 [INFO] [stdout] | [INFO] [stdout] 841 | .find(|(token, _)| match token { [INFO] [stdout] | ________________________^ [INFO] [stdout] 842 | | DateTimePatternToken::Year(_) => true, [INFO] [stdout] 843 | | _ => false [INFO] [stdout] 844 | | }); [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 841 - .find(|(token, _)| match token { [INFO] [stdout] 842 - DateTimePatternToken::Year(_) => true, [INFO] [stdout] 843 - _ => false [INFO] [stdout] 844 - }); [INFO] [stdout] 841 + .find(|(token, _)| matches!(token, DateTimePatternToken::Year(_))); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/xml_utils.rs:51:3 [INFO] [stdout] | [INFO] [stdout] 38 | / let expanded_paths = root.descendants(&tree) [INFO] [stdout] 39 | | .fold(Vec::::new(), |mut acc, node_id| { [INFO] [stdout] 40 | | let node = tree.index(node_id); [INFO] [stdout] 41 | | if !node.get().is_empty() && node.first_child().is_none() { [INFO] [stdout] ... | [INFO] [stdout] 49 | | acc [INFO] [stdout] 50 | | }); [INFO] [stdout] | |_____- unnecessary `let` binding [INFO] [stdout] 51 | expanded_paths [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 38 ~ [INFO] [stdout] 39 ~ root.descendants(&tree) [INFO] [stdout] 40 + .fold(Vec::::new(), |mut acc, node_id| { [INFO] [stdout] 41 + let node = tree.index(node_id); [INFO] [stdout] 42 + if !node.get().is_empty() && node.first_child().is_none() { [INFO] [stdout] 43 + let path: Vec = node_id.ancestors(&tree) [INFO] [stdout] 44 + .map(|n| format!("{}", tree.index(n).get())) [INFO] [stdout] 45 + .collect(); [INFO] [stdout] 46 + if path.len() == tokens.len() { [INFO] [stdout] 47 + acc.push(path.iter().rev().join("/")); [INFO] [stdout] 48 + } [INFO] [stdout] 49 + } [INFO] [stdout] 50 + acc [INFO] [stdout] 51 + }) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/xml_utils.rs:34:17 [INFO] [stdout] | [INFO] [stdout] 34 | .filter(|t| match t { [INFO] [stdout] | _________________^ [INFO] [stdout] 35 | | PathToken::Index(_) => false, [INFO] [stdout] 36 | | _ => true [INFO] [stdout] 37 | | }).collect_vec(); [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 34 - .filter(|t| match t { [INFO] [stdout] 35 - PathToken::Index(_) => false, [INFO] [stdout] 36 - _ => true [INFO] [stdout] 37 - }).collect_vec(); [INFO] [stdout] 34 + .filter(|t| !matches!(t, PathToken::Index(_))).collect_vec(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/xml_utils.rs:43:18 [INFO] [stdout] | [INFO] [stdout] 43 | .map(|n| format!("{}", tree.index(n).get())) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `tree.index(n).get().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: deref which would be done by auto-deref [INFO] [stdout] --> src/xml_utils.rs:96:64 [INFO] [stdout] | [INFO] [stdout] 96 | query_graph(remaining_tokens, tree, node_id, *child, index); [INFO] [stdout] | ^^^^^^ help: try: `child` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/xml_utils.rs:114:64 [INFO] [stdout] | [INFO] [stdout] 114 | query_graph(remaining_tokens, tree, parent_id, *child, index); [INFO] [stdout] | ^^^^^^ help: try: `child` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/xml_utils.rs:135:60 [INFO] [stdout] | [INFO] [stdout] 135 | query_graph(remaining_tokens, tree, node_id, *child, index); [INFO] [stdout] | ^^^^^^ help: try: `child` [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/xml_utils.rs:169:5 [INFO] [stdout] | [INFO] [stdout] 169 | / if let PathToken::Field(name) = token { [INFO] [stdout] 170 | | if name.starts_with('@') { [INFO] [stdout] 171 | | let attribute_name = &name[1..]; [INFO] [stdout] 172 | | let attributes = resolve_namespaces(element.attributes()); [INFO] [stdout] ... | [INFO] [stdout] 178 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 169 ~ if let PathToken::Field(name) = token [INFO] [stdout] 170 ~ && name.starts_with('@') { [INFO] [stdout] 171 | let attribute_name = &name[1..]; [INFO] [stdout] ... [INFO] [stdout] 176 | } [INFO] [stdout] 177 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/xml_utils.rs:171:30 [INFO] [stdout] | [INFO] [stdout] 171 | let attribute_name = &name[1..]; [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/xml_utils.rs:170:7 [INFO] [stdout] | [INFO] [stdout] 170 | if name.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] 170 ~ if let Some(attribute_name) = name.strip_prefix('@') { [INFO] [stdout] 171 ~ let attributes = resolve_namespaces(element.attributes()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/xml_utils.rs:267:26 [INFO] [stdout] | [INFO] [stdout] 267 | let index: usize = (&captures[2]).parse().unwrap_or_default(); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `captures[2]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/xml_utils.rs:289:32 [INFO] [stdout] | [INFO] [stdout] 289 | element.attributes().get(&first_part[1..]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/xml_utils.rs:288:5 [INFO] [stdout] | [INFO] [stdout] 288 | if first_part.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] 288 ~ if let Some() = first_part.strip_prefix('@') { [INFO] [stdout] 289 ~ element.attributes().get() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression borrows a value the compiler would automatically borrow [INFO] [stdout] --> src/xml_utils.rs:300:26 [INFO] [stdout] | [INFO] [stdout] 300 | let index: usize = (&captures[2]).parse().unwrap_or_default(); [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `captures[2]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for copying elements [INFO] [stdout] --> src/xml_utils.rs:302:19 [INFO] [stdout] | [INFO] [stdout] 302 | let child = grouped_children.get(name) [INFO] [stdout] | ___________________^ [INFO] [stdout] 303 | | .map(|values| values.get(index)) [INFO] [stdout] 304 | | .flatten() [INFO] [stdout] 305 | | .map(|value| *value); [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 `copied` method [INFO] [stdout] | [INFO] [stdout] 302 ~ let child = grouped_children.get(name) [INFO] [stdout] 303 + .map(|values| values.get(index)) [INFO] [stdout] 304 ~ .flatten().copied(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/xml_utils.rs:303:10 [INFO] [stdout] | [INFO] [stdout] 303 | .map(|values| values.get(index)) [INFO] [stdout] | __________^ [INFO] [stdout] 304 | | .flatten() [INFO] [stdout] | |__________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|values| values.get(index))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/matchingrules/expressions.rs:188:1 [INFO] [stdout] | [INFO] [stdout] 188 | impl Into for ValueType { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 188 ~ impl From for DataType { [INFO] [stdout] 189 ~ fn from(val: ValueType) -> Self { [INFO] [stdout] 190 ~ match val { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary closure used to substitute value for `Option::None` [INFO] [stdout] --> src/matchingrules/expressions.rs:254:18 [INFO] [stdout] | [INFO] [stdout] 254 | generator: self.generator.as_ref().or_else(|| other.generator.as_ref()).cloned(), [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 `or` instead [INFO] [stdout] | [INFO] [stdout] 254 - generator: self.generator.as_ref().or_else(|| other.generator.as_ref()).cloned(), [INFO] [stdout] 254 + generator: self.generator.as_ref().or(other.generator.as_ref()).cloned(), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-then-else expression returns a bool literal [INFO] [stdout] --> src/matchingrules/expressions.rs:353:7 [INFO] [stdout] | [INFO] [stdout] 353 | / if token == MatcherDefinitionToken::Matching || token == MatcherDefinitionToken::NotEmpty || [INFO] [stdout] 354 | | token == MatcherDefinitionToken::EachKey || token == MatcherDefinitionToken::EachValue || [INFO] [stdout] 355 | | token == MatcherDefinitionToken::AtLeast || token == MatcherDefinitionToken::AtMost { [INFO] [stdout] 356 | | true [INFO] [stdout] 357 | | } else { [INFO] [stdout] 358 | | false [INFO] [stdout] 359 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_bool [INFO] [stdout] = note: `#[warn(clippy::needless_bool)]` on by default [INFO] [stdout] help: you can reduce it to [INFO] [stdout] | [INFO] [stdout] 353 ~ token == MatcherDefinitionToken::Matching || token == MatcherDefinitionToken::NotEmpty || [INFO] [stdout] 354 + token == MatcherDefinitionToken::EachKey || token == MatcherDefinitionToken::EachValue || [INFO] [stdout] 355 + token == MatcherDefinitionToken::AtLeast || token == MatcherDefinitionToken::AtMost [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:462:31 [INFO] [stdout] | [INFO] [stdout] 462 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] = note: `#[warn(clippy::borrow_deref_ref)]` on by default [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 462 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 462 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 462 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/matchingrules/expressions.rs:470:21 [INFO] [stdout] | [INFO] [stdout] 470 | .with_message(format!("Expected a type of matching rule definition but got the end of the expression")) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Expected a type of matching rule definition but got the end of the expression".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: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:475:29 [INFO] [stdout] | [INFO] [stdout] 475 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 475 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 475 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 475 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:511:29 [INFO] [stdout] | [INFO] [stdout] 511 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 511 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 511 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 511 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:525:27 [INFO] [stdout] | [INFO] [stdout] 525 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 525 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 525 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 525 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:553:31 [INFO] [stdout] | [INFO] [stdout] 553 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 553 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 553 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 553 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:565:29 [INFO] [stdout] | [INFO] [stdout] 565 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 565 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 565 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 565 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:590:72 [INFO] [stdout] | [INFO] [stdout] 590 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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/matchingrules/expressions.rs:625:84 [INFO] [stdout] | [INFO] [stdout] 625 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:653:33 [INFO] [stdout] | [INFO] [stdout] 653 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 653 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 653 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 653 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:668:29 [INFO] [stdout] | [INFO] [stdout] 668 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 668 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 668 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 668 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:673:73 [INFO] [stdout] | [INFO] [stdout] 673 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:679:70 [INFO] [stdout] | [INFO] [stdout] 679 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:694:31 [INFO] [stdout] | [INFO] [stdout] 694 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 694 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 694 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 694 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:704:6 [INFO] [stdout] | [INFO] [stdout] 704 | ) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:711:69 [INFO] [stdout] | [INFO] [stdout] 711 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:731:6 [INFO] [stdout] | [INFO] [stdout] 731 | ) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:738:72 [INFO] [stdout] | [INFO] [stdout] 738 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:755:68 [INFO] [stdout] | [INFO] [stdout] 755 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:772:68 [INFO] [stdout] | [INFO] [stdout] 772 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:789:71 [INFO] [stdout] | [INFO] [stdout] 789 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:796:76 [INFO] [stdout] | [INFO] [stdout] 796 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:858:70 [INFO] [stdout] | [INFO] [stdout] 858 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:886:71 [INFO] [stdout] | [INFO] [stdout] 886 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:905:71 [INFO] [stdout] | [INFO] [stdout] 905 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/matchingrules/expressions.rs:933:71 [INFO] [stdout] | [INFO] [stdout] 933 | ...v: &str) -> anyhow::Result<(String, ValueType, Option, Option, Option)> { [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: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:959:29 [INFO] [stdout] | [INFO] [stdout] 959 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 959 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 959 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 959 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:1030:27 [INFO] [stdout] | [INFO] [stdout] 1030 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 1030 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 1030 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 1030 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:1046:31 [INFO] [stdout] | [INFO] [stdout] 1046 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 1046 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 1046 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 1046 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:1065:29 [INFO] [stdout] | [INFO] [stdout] 1065 | let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 1065 - let message = from_utf8(&*buffer.get_ref())?.to_string(); [INFO] [stdout] 1065 + let message = from_utf8(buffer.get_ref())?.to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 1065 | let message = from_utf8(&**buffer.get_ref())?.to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/matchingrules/expressions.rs:1079:27 [INFO] [stdout] | [INFO] [stdout] 1079 | let message = from_utf8(&*buffer.get_ref()).unwrap().to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 1079 - let message = from_utf8(&*buffer.get_ref()).unwrap().to_string(); [INFO] [stdout] 1079 + let message = from_utf8(buffer.get_ref()).unwrap().to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 1079 | let message = from_utf8(&**buffer.get_ref()).unwrap().to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/matchingrules/mod.rs:48:16 [INFO] [stdout] | [INFO] [stdout] 48 | .map(|rule| MatchingRule::from_json(rule)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `MatchingRule::from_json` [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: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/matchingrules/mod.rs:186:16 [INFO] [stdout] | [INFO] [stdout] 186 | .filter(|item| item.is_some()) [INFO] [stdout] | ________________^ [INFO] [stdout] 187 | | .map(|item| item.unwrap()) [INFO] [stdout] | |________________________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] = note: `#[warn(clippy::option_filter_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/matchingrules/mod.rs:180:17 [INFO] [stdout] | [INFO] [stdout] 180 | / if let Some(json) = g.to_json() { [INFO] [stdout] 181 | | Some((String::from(k), json)) [INFO] [stdout] 182 | | } else { [INFO] [stdout] 183 | | None [INFO] [stdout] 184 | | } [INFO] [stdout] | |_________________^ help: try: `g.to_json().map(|json| (String::from(k), json))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/matchingrules/mod.rs:481:5 [INFO] [stdout] | [INFO] [stdout] 481 | / match self { [INFO] [stdout] 482 | | MatchingRule::Values => true, [INFO] [stdout] 483 | | MatchingRule::EachValue(_) => true, [INFO] [stdout] 484 | | _ => false [INFO] [stdout] 485 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 481 - match self { [INFO] [stdout] 482 - MatchingRule::Values => true, [INFO] [stdout] 483 - MatchingRule::EachValue(_) => true, [INFO] [stdout] 484 - _ => false [INFO] [stdout] 485 - } [INFO] [stdout] 481 + matches!(self, MatchingRule::Values | MatchingRule::EachValue(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/matchingrules/mod.rs:490:5 [INFO] [stdout] | [INFO] [stdout] 490 | / match self { [INFO] [stdout] 491 | | MatchingRule::Type => true, [INFO] [stdout] 492 | | MatchingRule::MinType(_) => true, [INFO] [stdout] 493 | | MatchingRule::MaxType(_) => true, [INFO] [stdout] 494 | | MatchingRule::MinMaxType(_, _) => true, [INFO] [stdout] 495 | | _ => false [INFO] [stdout] 496 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 490 - match self { [INFO] [stdout] 491 - MatchingRule::Type => true, [INFO] [stdout] 492 - MatchingRule::MinType(_) => true, [INFO] [stdout] 493 - MatchingRule::MaxType(_) => true, [INFO] [stdout] 494 - MatchingRule::MinMaxType(_, _) => true, [INFO] [stdout] 495 - _ => false [INFO] [stdout] 496 - } [INFO] [stdout] 490 + matches!(self, MatchingRule::Type | MatchingRule::MinType(_) | MatchingRule::MaxType(_) | MatchingRule::MinMaxType(_, _)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/matchingrules/mod.rs:501:5 [INFO] [stdout] | [INFO] [stdout] 501 | / match self { [INFO] [stdout] 502 | | MatchingRule::MinType(_) => true, [INFO] [stdout] 503 | | MatchingRule::MaxType(_) => true, [INFO] [stdout] 504 | | MatchingRule::MinMaxType(_, _) => true, [INFO] [stdout] 505 | | _ => false [INFO] [stdout] 506 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 501 - match self { [INFO] [stdout] 502 - MatchingRule::MinType(_) => true, [INFO] [stdout] 503 - MatchingRule::MaxType(_) => true, [INFO] [stdout] 504 - MatchingRule::MinMaxType(_, _) => true, [INFO] [stdout] 505 - _ => false [INFO] [stdout] 506 - } [INFO] [stdout] 501 + matches!(self, MatchingRule::MinType(_) | MatchingRule::MaxType(_) | MatchingRule::MinMaxType(_, _)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/matchingrules/mod.rs:511:5 [INFO] [stdout] | [INFO] [stdout] 511 | / match self { [INFO] [stdout] 512 | | MatchingRule::Values => false, [INFO] [stdout] 513 | | MatchingRule::EachValue(_) => false, [INFO] [stdout] 514 | | MatchingRule::EachKey(_) => false, [INFO] [stdout] 515 | | _ => true [INFO] [stdout] 516 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 511 - match self { [INFO] [stdout] 512 - MatchingRule::Values => false, [INFO] [stdout] 513 - MatchingRule::EachValue(_) => false, [INFO] [stdout] 514 - MatchingRule::EachKey(_) => false, [INFO] [stdout] 515 - _ => true [INFO] [stdout] 516 - } [INFO] [stdout] 511 + !matches!(self, MatchingRule::Values | MatchingRule::EachValue(_) | MatchingRule::EachKey(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value [INFO] [stdout] --> src/matchingrules/mod.rs:658:14 [INFO] [stdout] | [INFO] [stdout] 658 | fn to_json(&self) -> Value { [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider choosing a less ambiguous name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stdout] = note: `#[warn(clippy::wrong_self_convention)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `self.rules.get(0)` [INFO] [stdout] --> src/matchingrules/mod.rs:719:11 [INFO] [stdout] | [INFO] [stdout] 719 | match self.rules.get(0) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try: `self.rules.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: match expression looks like `matches!` macro [INFO] [stdout] --> src/matchingrules/mod.rs:727:34 [INFO] [stdout] | [INFO] [stdout] 727 | self.rules.iter().any(|rule| match rule { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 728 | | MatchingRule::Type => true, [INFO] [stdout] 729 | | MatchingRule::MinType(_) => true, [INFO] [stdout] 730 | | MatchingRule::MaxType(_) => true, [INFO] [stdout] 731 | | MatchingRule::MinMaxType(_, _) => true, [INFO] [stdout] 732 | | _ => false [INFO] [stdout] 733 | | }) [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 727 - self.rules.iter().any(|rule| match rule { [INFO] [stdout] 728 - MatchingRule::Type => true, [INFO] [stdout] 729 - MatchingRule::MinType(_) => true, [INFO] [stdout] 730 - MatchingRule::MaxType(_) => true, [INFO] [stdout] 731 - MatchingRule::MinMaxType(_, _) => true, [INFO] [stdout] 732 - _ => false [INFO] [stdout] 733 - }) [INFO] [stdout] 727 + self.rules.iter().any(|rule| matches!(rule, MatchingRule::Type | MatchingRule::MinType(_) | MatchingRule::MaxType(_) | MatchingRule::MinMaxType(_, _))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/matchingrules/mod.rs:743:34 [INFO] [stdout] | [INFO] [stdout] 743 | self.rules.iter().any(|rule| match rule { [INFO] [stdout] | __________________________________^ [INFO] [stdout] 744 | | MatchingRule::Type => false, [INFO] [stdout] 745 | | MatchingRule::MinType(_) => false, [INFO] [stdout] 746 | | MatchingRule::MaxType(_) => false, [INFO] [stdout] 747 | | MatchingRule::MinMaxType(_, _) => false, [INFO] [stdout] 748 | | _ => true [INFO] [stdout] 749 | | }) [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 743 - self.rules.iter().any(|rule| match rule { [INFO] [stdout] 744 - MatchingRule::Type => false, [INFO] [stdout] 745 - MatchingRule::MinType(_) => false, [INFO] [stdout] 746 - MatchingRule::MaxType(_) => false, [INFO] [stdout] 747 - MatchingRule::MinMaxType(_, _) => false, [INFO] [stdout] 748 - _ => true [INFO] [stdout] 749 - }) [INFO] [stdout] 743 + self.rules.iter().any(|rule| !matches!(rule, MatchingRule::Type | MatchingRule::MinType(_) | MatchingRule::MaxType(_) | MatchingRule::MinMaxType(_, _))) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/matchingrules/mod.rs:791:8 [INFO] [stdout] | [INFO] [stdout] 791 | if self.rules.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `self.rules.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: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/matchingrules/mod.rs:888:1 [INFO] [stdout] | [INFO] [stdout] 888 | impl <'a> Into<&'a str> for Category { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 888 ~ impl <'a> From for &'a str { [INFO] [stdout] 889 ~ fn from(val: Category) -> Self { [INFO] [stdout] 890 ~ match val { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/matchingrules/mod.rs:903:1 [INFO] [stdout] | [INFO] [stdout] 903 | impl Into for Category { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 903 ~ impl From for String { [INFO] [stdout] 904 ~ fn from(val: Category) -> Self { [INFO] [stdout] 905 ~ val.to_string() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/matchingrules/mod.rs:921:1 [INFO] [stdout] | [INFO] [stdout] 921 | / impl Default for Category { [INFO] [stdout] 922 | | fn default() -> Self { [INFO] [stdout] 923 | | Category::BODY [INFO] [stdout] 924 | | } [INFO] [stdout] 925 | | } [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 and mark the default variant [INFO] [stdout] | [INFO] [stdout] 841 + #[derive(Default)] [INFO] [stdout] 842 | pub enum Category { [INFO] [stdout] 843 | /// Request Method [INFO] [stdout] ... [INFO] [stdout] 851 | /// Body [INFO] [stdout] 852 ~ #[default] [INFO] [stdout] 853 ~ BODY, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/matchingrules/mod.rs:1117:9 [INFO] [stdout] | [INFO] [stdout] 1117 | / if let Value::Array(array) = matchers { [INFO] [stdout] 1118 | | for matcher in array { [INFO] [stdout] 1119 | | self.rule_from_json(DocPath::empty(), &matcher, rule_logic)?; [INFO] [stdout] 1120 | | } [INFO] [stdout] 1121 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/matchingrules/mod.rs:1116:19 [INFO] [stdout] | [INFO] [stdout] 1116 | if let Some(matchers) = rules.get("matchers") { [INFO] [stdout] | ^^^^^^^^ replace this binding [INFO] [stdout] 1117 | if let Value::Array(array) = matchers { [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/matchingrules/mod.rs:1116:7 [INFO] [stdout] | [INFO] [stdout] 1116 | / if let Some(matchers) = rules.get("matchers") { [INFO] [stdout] 1117 | | if let Value::Array(array) = matchers { [INFO] [stdout] 1118 | | for matcher in array { [INFO] [stdout] 1119 | | self.rule_from_json(DocPath::empty(), &matcher, rule_logic)?; [INFO] [stdout] ... | [INFO] [stdout] 1122 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1116 ~ if let Some(matchers) = rules.get("matchers") [INFO] [stdout] 1117 ~ && let Value::Array(array) = matchers { [INFO] [stdout] 1118 | for matcher in array { [INFO] [stdout] 1119 | self.rule_from_json(DocPath::empty(), &matcher, rule_logic)?; [INFO] [stdout] 1120 | } [INFO] [stdout] 1121 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/matchingrules/mod.rs:1119:51 [INFO] [stdout] | [INFO] [stdout] 1119 | self.rule_from_json(DocPath::empty(), &matcher, rule_logic)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `matcher` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if let` can be collapsed into the outer `if let` [INFO] [stdout] --> src/matchingrules/mod.rs:1147:9 [INFO] [stdout] | [INFO] [stdout] 1147 | / if let Value::Array(array) = matchers { [INFO] [stdout] 1148 | | for matcher in array { [INFO] [stdout] 1149 | | self.rule_from_json(DocPath::empty(), &matcher, rule_logic)?; [INFO] [stdout] 1150 | | } [INFO] [stdout] 1151 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/matchingrules/mod.rs:1146:19 [INFO] [stdout] | [INFO] [stdout] 1146 | if let Some(matchers) = rules.get("matchers") { [INFO] [stdout] | ^^^^^^^^ replace this binding [INFO] [stdout] 1147 | if let Value::Array(array) = matchers { [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/matchingrules/mod.rs:1146:7 [INFO] [stdout] | [INFO] [stdout] 1146 | / if let Some(matchers) = rules.get("matchers") { [INFO] [stdout] 1147 | | if let Value::Array(array) = matchers { [INFO] [stdout] 1148 | | for matcher in array { [INFO] [stdout] 1149 | | self.rule_from_json(DocPath::empty(), &matcher, rule_logic)?; [INFO] [stdout] ... | [INFO] [stdout] 1152 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1146 ~ if let Some(matchers) = rules.get("matchers") [INFO] [stdout] 1147 ~ && let Value::Array(array) = matchers { [INFO] [stdout] 1148 | for matcher in array { [INFO] [stdout] 1149 | self.rule_from_json(DocPath::empty(), &matcher, rule_logic)?; [INFO] [stdout] 1150 | } [INFO] [stdout] 1151 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/matchingrules/mod.rs:1149:51 [INFO] [stdout] | [INFO] [stdout] 1149 | self.rule_from_json(DocPath::empty(), &matcher, rule_logic)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `matcher` [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/matchingrules/mod.rs:1182:17 [INFO] [stdout] | [INFO] [stdout] 1182 | if let Some(&Value::Array(ref array)) = v.get("matchers") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 1182 - if let Some(&Value::Array(ref array)) = v.get("matchers") { [INFO] [stdout] 1182 + if let Some(Value::Array(array)) = v.get("matchers") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/matchingrules/mod.rs:1184:40 [INFO] [stdout] | [INFO] [stdout] 1184 | self.rule_from_json(k.clone(), &matcher, rule_logic)?; [INFO] [stdout] | ^^^^^^^^ help: change this to: `matcher` [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: re-implementing `PartialEq::ne` is unnecessary [INFO] [stdout] --> src/matchingrules/mod.rs:1242:3 [INFO] [stdout] | [INFO] [stdout] 1242 | fn ne(&self, other: &Self) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_ne_impl [INFO] [stdout] = note: `#[warn(clippy::partialeq_ne_impl)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/matchingrules/mod.rs:1367:64 [INFO] [stdout] | [INFO] [stdout] 1367 | self.add_v2_rule("body", DocPath::new(format!("${}", &key[6..]))?, v)?; [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/matchingrules/mod.rs:1363:7 [INFO] [stdout] | [INFO] [stdout] 1363 | if key.starts_with("$.body") { [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] 1363 ~ if let Some() = key.strip_prefix("$.body") { [INFO] [stdout] 1364 | if key == "$.body" { [INFO] [stdout] 1365 | self.add_v2_rule("body", DocPath::root(), v)?; [INFO] [stdout] 1366 | } else { [INFO] [stdout] 1367 ~ self.add_v2_rule("body", DocPath::new(format!("${}", ))?, v)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `skip(..).next()` on an iterator [INFO] [stdout] --> src/matchingrules/mod.rs:1374:11 [INFO] [stdout] | [INFO] [stdout] 1374 | }).skip(1).next(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use `nth` instead: `.nth(1)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next [INFO] [stdout] = note: `#[warn(clippy::iter_skip_next)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/matchingrules/mod.rs:1423:11 [INFO] [stdout] | [INFO] [stdout] 1423 | / if let Some(values) = value.as_object() { [INFO] [stdout] 1424 | | if !values.is_empty() { [INFO] [stdout] 1425 | | map.insert(name.to_string(), value); [INFO] [stdout] 1426 | | } [INFO] [stdout] 1427 | | } [INFO] [stdout] | |___________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 1423 ~ if let Some(values) = value.as_object() [INFO] [stdout] 1424 ~ && !values.is_empty() { [INFO] [stdout] 1425 | map.insert(name.to_string(), value); [INFO] [stdout] 1426 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/matchingrules/mod.rs:1510:7 [INFO] [stdout] | [INFO] [stdout] 1510 | write!(f, "{}:\n", category)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] = note: `#[warn(clippy::write_with_newline)]` on by default [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 1510 - write!(f, "{}:\n", category)?; [INFO] [stdout] 1510 + writeln!(f, "{}:", category)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/matchingrules/mod.rs:1513:11 [INFO] [stdout] | [INFO] [stdout] 1513 | write!(f, " {} => []\n", path)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 1513 - write!(f, " {} => []\n", path)?; [INFO] [stdout] 1513 + writeln!(f, " {} => []", path)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/matchingrules/mod.rs:1515:11 [INFO] [stdout] | [INFO] [stdout] 1515 | write!(f, " {} => {:?}\n", path, rule_list.rules[0])?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 1515 - write!(f, " {} => {:?}\n", path, rule_list.rules[0])?; [INFO] [stdout] 1515 + writeln!(f, " {} => {:?}", path, rule_list.rules[0])?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/matchingrules/mod.rs:1517:11 [INFO] [stdout] | [INFO] [stdout] 1517 | write!(f, " {} => [\n", path)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 1517 - write!(f, " {} => [\n", path)?; [INFO] [stdout] 1517 + writeln!(f, " {} => [", path)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/matchingrules/mod.rs:1519:13 [INFO] [stdout] | [INFO] [stdout] 1519 | write!(f, " {:?}\n", rule)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 1519 - write!(f, " {:?}\n", rule)?; [INFO] [stdout] 1519 + writeln!(f, " {:?}", rule)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `write!()` with a format string that ends in a single newline [INFO] [stdout] --> src/matchingrules/mod.rs:1521:11 [INFO] [stdout] | [INFO] [stdout] 1521 | write!(f, " ]\n")?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#write_with_newline [INFO] [stdout] help: use `writeln!` instead [INFO] [stdout] | [INFO] [stdout] 1521 - write!(f, " ]\n")?; [INFO] [stdout] 1521 + writeln!(f, " ]")?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/matchingrules/mod.rs:1541:20 [INFO] [stdout] | [INFO] [stdout] 1541 | Some(value) => match value { [INFO] [stdout] | ____________________^ [INFO] [stdout] 1542 | | &Value::Object(ref m) => { [INFO] [stdout] 1543 | | if m.keys().next().unwrap_or(&String::default()).starts_with("$") { [INFO] [stdout] 1544 | | matching_rules.load_from_v2_map(m)? [INFO] [stdout] ... | [INFO] [stdout] 1549 | | _ => () [INFO] [stdout] 1550 | | }, [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/matchingrules/mod.rs:1541:10 [INFO] [stdout] | [INFO] [stdout] 1541 | Some(value) => match value { [INFO] [stdout] | ^^^^^ replace this binding [INFO] [stdout] 1542 | &Value::Object(ref m) => { [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/matchingrules/mod.rs:1540:3 [INFO] [stdout] | [INFO] [stdout] 1540 | / match matchers_json { [INFO] [stdout] 1541 | | Some(value) => match value { [INFO] [stdout] 1542 | | &Value::Object(ref m) => { [INFO] [stdout] 1543 | | if m.keys().next().unwrap_or(&String::default()).starts_with("$") { [INFO] [stdout] ... | [INFO] [stdout] 1551 | | None => () [INFO] [stdout] 1552 | | } [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] 1540 ~ if let Some(value) = matchers_json { match value { [INFO] [stdout] 1541 + &Value::Object(ref m) => { [INFO] [stdout] 1542 + if m.keys().next().unwrap_or(&String::default()).starts_with("$") { [INFO] [stdout] 1543 + matching_rules.load_from_v2_map(m)? [INFO] [stdout] 1544 + } else { [INFO] [stdout] 1545 + matching_rules.load_from_v3_map(m)? [INFO] [stdout] 1546 + } [INFO] [stdout] 1547 + }, [INFO] [stdout] 1548 + _ => () [INFO] [stdout] 1549 + } } [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/matchingrules/mod.rs:1541:20 [INFO] [stdout] | [INFO] [stdout] 1541 | Some(value) => match value { [INFO] [stdout] | ____________________^ [INFO] [stdout] 1542 | | &Value::Object(ref m) => { [INFO] [stdout] 1543 | | if m.keys().next().unwrap_or(&String::default()).starts_with("$") { [INFO] [stdout] 1544 | | matching_rules.load_from_v2_map(m)? [INFO] [stdout] ... | [INFO] [stdout] 1549 | | _ => () [INFO] [stdout] 1550 | | }, [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] 1541 ~ Some(value) => if let &Value::Object(ref m) = value { [INFO] [stdout] 1542 + if m.keys().next().unwrap_or(&String::default()).starts_with("$") { [INFO] [stdout] 1543 + matching_rules.load_from_v2_map(m)? [INFO] [stdout] 1544 + } else { [INFO] [stdout] 1545 + matching_rules.load_from_v3_map(m)? [INFO] [stdout] 1546 + } [INFO] [stdout] 1547 ~ }, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/matchingrules/mod.rs:1542:7 [INFO] [stdout] | [INFO] [stdout] 1542 | &Value::Object(ref m) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 1542 - &Value::Object(ref m) => { [INFO] [stdout] 1542 + Value::Object(m) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/matchingrules/mod.rs:1978:37 [INFO] [stdout] | [INFO] [stdout] 1978 | matching_rules.load_from_v2_map(&matching_rules_map).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: change this to: `matching_rules_map` [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: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/generators/datetime_expressions.rs:179:8 [INFO] [stdout] | [INFO] [stdout] 179 | .map(|t| t.with_nanosecond(0)) [INFO] [stdout] | ________^ [INFO] [stdout] 180 | | .flatten() [INFO] [stdout] | |________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|t| t.with_nanosecond(0))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/generators/datetime_expressions.rs:177:8 [INFO] [stdout] | [INFO] [stdout] 177 | .map(|t| t.with_second(0)) [INFO] [stdout] | ________^ [INFO] [stdout] 178 | | .flatten() [INFO] [stdout] | |________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|t| t.with_second(0))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref on an immutable reference [INFO] [stdout] --> src/generators/datetime_expressions.rs:410:27 [INFO] [stdout] | [INFO] [stdout] 410 | let message = from_utf8(&*buffer.get_ref()).unwrap().to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_deref_ref [INFO] [stdout] help: if you would like to reborrow, try removing `&*` [INFO] [stdout] | [INFO] [stdout] 410 - let message = from_utf8(&*buffer.get_ref()).unwrap().to_string(); [INFO] [stdout] 410 + let message = from_utf8(buffer.get_ref()).unwrap().to_string(); [INFO] [stdout] | [INFO] [stdout] help: if you would like to deref, try using `&**` [INFO] [stdout] | [INFO] [stdout] 410 | let message = from_utf8(&**buffer.get_ref()).unwrap().to_string(); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/generators/date_expression_parser.rs:135:5 [INFO] [stdout] | [INFO] [stdout] 135 | / match self { [INFO] [stdout] 136 | | DateExpressionToken::Now => true, [INFO] [stdout] 137 | | DateExpressionToken::Today => true, [INFO] [stdout] 138 | | DateExpressionToken::Tomorrow => true, [INFO] [stdout] 139 | | DateExpressionToken::Yesterday => true, [INFO] [stdout] 140 | | _ => false [INFO] [stdout] 141 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 135 - match self { [INFO] [stdout] 136 - DateExpressionToken::Now => true, [INFO] [stdout] 137 - DateExpressionToken::Today => true, [INFO] [stdout] 138 - DateExpressionToken::Tomorrow => true, [INFO] [stdout] 139 - DateExpressionToken::Yesterday => true, [INFO] [stdout] 140 - _ => false [INFO] [stdout] 141 - } [INFO] [stdout] 135 + matches!(self, DateExpressionToken::Now | DateExpressionToken::Today | DateExpressionToken::Tomorrow | DateExpressionToken::Yesterday) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/generators/date_expression_parser.rs:145:5 [INFO] [stdout] | [INFO] [stdout] 145 | / match self { [INFO] [stdout] 146 | | DateExpressionToken::Plus => true, [INFO] [stdout] 147 | | DateExpressionToken::Minus => true, [INFO] [stdout] 148 | | _ => false [INFO] [stdout] 149 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 145 - match self { [INFO] [stdout] 146 - DateExpressionToken::Plus => true, [INFO] [stdout] 147 - DateExpressionToken::Minus => true, [INFO] [stdout] 148 - _ => false [INFO] [stdout] 149 - } [INFO] [stdout] 145 + matches!(self, DateExpressionToken::Plus | DateExpressionToken::Minus) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/generators/date_expression_parser.rs:166:26 [INFO] [stdout] | [INFO] [stdout] 166 | pub(crate) fn expression<'a>(lex: &mut Lexer, exp: &str) -> anyhow::Result { [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#extra_unused_lifetimes [INFO] [stdout] = note: `#[warn(clippy::extra_unused_lifetimes)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: deref which would be done by auto-deref [INFO] [stdout] --> src/generators/date_expression_parser.rs:175:33 [INFO] [stdout] | [INFO] [stdout] 175 | adj.extend_from_slice(&*adjustments(lex, exp, &token)?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&adjustments(lex, exp, &token)?` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/generators/date_expression_parser.rs:181:29 [INFO] [stdout] | [INFO] [stdout] 181 | adj.extend_from_slice(&*adjustments(lex, exp, &token)?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&adjustments(lex, exp, &token)?` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/generators/date_expression_parser.rs:191:33 [INFO] [stdout] | [INFO] [stdout] 191 | adj.extend_from_slice(&*adjustments(lex, exp, &token)?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&adjustments(lex, exp, &token)?` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/generators/date_expression_parser.rs:205:33 [INFO] [stdout] | [INFO] [stdout] 205 | adj.extend_from_slice(&*adjustments(lex, exp, &token)?); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&adjustments(lex, exp, &token)?` [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: match expression looks like `matches!` macro [INFO] [stdout] --> src/generators/time_expression_parser.rs:67:5 [INFO] [stdout] | [INFO] [stdout] 67 | / match self { [INFO] [stdout] 68 | | TimeExpressionToken::Now => true, [INFO] [stdout] 69 | | TimeExpressionToken::Midnight => true, [INFO] [stdout] 70 | | TimeExpressionToken::Noon => true, [INFO] [stdout] 71 | | TimeExpressionToken::Digits(_) => true, [INFO] [stdout] 72 | | _ => false [INFO] [stdout] 73 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 67 - match self { [INFO] [stdout] 68 - TimeExpressionToken::Now => true, [INFO] [stdout] 69 - TimeExpressionToken::Midnight => true, [INFO] [stdout] 70 - TimeExpressionToken::Noon => true, [INFO] [stdout] 71 - TimeExpressionToken::Digits(_) => true, [INFO] [stdout] 72 - _ => false [INFO] [stdout] 73 - } [INFO] [stdout] 67 + matches!(self, TimeExpressionToken::Now | TimeExpressionToken::Midnight | TimeExpressionToken::Noon | TimeExpressionToken::Digits(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/generators/time_expression_parser.rs:77:5 [INFO] [stdout] | [INFO] [stdout] 77 | / match self { [INFO] [stdout] 78 | | TimeExpressionToken::Plus => true, [INFO] [stdout] 79 | | TimeExpressionToken::Minus => true, [INFO] [stdout] 80 | | _ => false [INFO] [stdout] 81 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 77 - match self { [INFO] [stdout] 78 - TimeExpressionToken::Plus => true, [INFO] [stdout] 79 - TimeExpressionToken::Minus => true, [INFO] [stdout] 80 - _ => false [INFO] [stdout] 81 - } [INFO] [stdout] 77 + matches!(self, TimeExpressionToken::Plus | TimeExpressionToken::Minus) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/generators/time_expression_parser.rs:106:41 [INFO] [stdout] | [INFO] [stdout] 106 | if let Some(Ok(token)) = next.map(|next| Ok(next)).or_else(|| lex.next()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `Ok` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/generators/time_expression_parser.rs:109:33 [INFO] [stdout] | [INFO] [stdout] 109 | adj.extend_from_slice(&*a); [INFO] [stdout] | ^^^ help: try: `&a` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/generators/time_expression_parser.rs:116:29 [INFO] [stdout] | [INFO] [stdout] 116 | adj.extend_from_slice(&*a); [INFO] [stdout] | ^^^ help: try: `&a` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/generators/time_expression_parser.rs:127:33 [INFO] [stdout] | [INFO] [stdout] 127 | adj.extend_from_slice(&*a); [INFO] [stdout] | ^^^ help: try: `&a` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/generators/time_expression_parser.rs:142:33 [INFO] [stdout] | [INFO] [stdout] 142 | adj.extend_from_slice(&*a); [INFO] [stdout] | ^^^ help: try: `&a` [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: using `clone` on type `TimeExpressionToken` which implements the `Copy` trait [INFO] [stdout] --> src/generators/time_expression_parser.rs:230:19 [INFO] [stdout] | [INFO] [stdout] 230 | let mut token = token.clone(); [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `token` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `TimeExpressionToken` which implements the `Copy` trait [INFO] [stdout] --> src/generators/time_expression_parser.rs:241:15 [INFO] [stdout] | [INFO] [stdout] 241 | token = t.clone(); [INFO] [stdout] | ^^^^^^^^^ help: try removing the `clone` call: `t` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/generators/form_urlencoded.rs:52:16 [INFO] [stdout] | [INFO] [stdout] 52 | return match generator.generate_value(¶m_value, context, matcher) { [INFO] [stdout] | ________________^ [INFO] [stdout] 53 | | Ok(new_value) => *param_value = new_value, [INFO] [stdout] 54 | | Err(_) => () [INFO] [stdout] 55 | | } [INFO] [stdout] | |_________^ help: try: `if let Ok(new_value) = generator.generate_value(¶m_value, context, matcher) { *param_value = new_value }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/form_urlencoded.rs:52:47 [INFO] [stdout] | [INFO] [stdout] 52 | return match generator.generate_value(¶m_value, context, matcher) { [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `param_value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/generators/xml.rs:63:12 [INFO] [stdout] | [INFO] [stdout] 63 | matcher: &Box, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn VariantMatcher + Send + Sync)` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/xml.rs:75:40 [INFO] [stdout] | [INFO] [stdout] 75 | if generate_values_for_xml_attribute(&el, key, generator, context, matcher, path.clone()) { [INFO] [stdout] | ^^^ help: change this to: `el` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/xml.rs:79:35 [INFO] [stdout] | [INFO] [stdout] 79 | if generate_values_for_xml_text(&el, key, generator, context, matcher, path.clone()) { [INFO] [stdout] | ^^^ help: change this to: `el` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/generators/xml.rs:99:12 [INFO] [stdout] | [INFO] [stdout] 99 | matcher: &Box, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn VariantMatcher + Send + Sync)` [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/generators/xml.rs:104:3 [INFO] [stdout] | [INFO] [stdout] 104 | / if let Some(v) = key.last_field() { [INFO] [stdout] 105 | | if v.starts_with("@") { [INFO] [stdout] 106 | | for attr in el.attributes() { [INFO] [stdout] 107 | | let mut attr_path = path.clone(); [INFO] [stdout] ... | [INFO] [stdout] 125 | | }; [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 104 ~ if let Some(v) = key.last_field() [INFO] [stdout] 105 ~ && v.starts_with("@") { [INFO] [stdout] 106 | for attr in el.attributes() { [INFO] [stdout] ... [INFO] [stdout] 123 | } [INFO] [stdout] 124 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/generators/xml.rs:135:12 [INFO] [stdout] | [INFO] [stdout] 135 | matcher: &Box, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn VariantMatcher + Send + Sync)` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/generators/mod.rs:45:15 [INFO] [stdout] | [INFO] [stdout] 45 | variants: &Vec<(usize, MatchingRuleCategory, HashMap)> [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `&[(usize, MatchingRuleCategory, HashMap)]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/generators/mod.rs:69:1 [INFO] [stdout] | [INFO] [stdout] 69 | / impl Default for NoopVariantMatcher { [INFO] [stdout] 70 | | fn default() -> Self { [INFO] [stdout] 71 | | NoopVariantMatcher {} [INFO] [stdout] 72 | | } [INFO] [stdout] 73 | | } [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] 53 + #[derive(Default)] [INFO] [stdout] 54 | pub struct NoopVariantMatcher; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/generators/mod.rs:99:1 [INFO] [stdout] | [INFO] [stdout] 99 | / impl Default for UuidFormat { [INFO] [stdout] 100 | | fn default() -> Self { [INFO] [stdout] 101 | | UuidFormat::LowerCaseHyphenated [INFO] [stdout] 102 | | } [INFO] [stdout] 103 | | } [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 and mark the default variant [INFO] [stdout] | [INFO] [stdout] 77 + #[derive(Default)] [INFO] [stdout] 78 | pub enum UuidFormat { [INFO] [stdout] 79 | /// Simple UUID (e.g 936DA01f9abd4d9d80c702af85c822a8) [INFO] [stdout] 80 | Simple, [INFO] [stdout] 81 | /// lower-case hyphenated (e.g 936da01f-9abd-4d9d-80c7-02af85c822a8) [INFO] [stdout] 82 ~ #[default] [INFO] [stdout] 83 ~ LowerCaseHyphenated, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/generators/mod.rs:443:1 [INFO] [stdout] | [INFO] [stdout] 443 | impl <'a> Into<&'a str> for GeneratorCategory { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 443 ~ impl <'a> From for &'a str { [INFO] [stdout] 444 ~ fn from(val: GeneratorCategory) -> Self { [INFO] [stdout] 445 ~ match val { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/generators/mod.rs:457:1 [INFO] [stdout] | [INFO] [stdout] 457 | impl Into for GeneratorCategory { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: `impl From for Foreign` is allowed by the orphan rules, for more information see [INFO] [stdout] https://doc.rust-lang.org/reference/items/implementations.html#trait-implementation-coherence [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 457 ~ impl From for String { [INFO] [stdout] 458 ~ fn from(val: GeneratorCategory) -> Self { [INFO] [stdout] 459 ~ let s: &str = val.into(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: an implementation of `From` is preferred since it gives you `Into<_>` for free where the reverse isn't true [INFO] [stdout] --> src/generators/mod.rs:464:1 [INFO] [stdout] | [INFO] [stdout] 464 | impl Into for GeneratorCategory { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into [INFO] [stdout] help: replace the `Into` implementation with `From` [INFO] [stdout] | [INFO] [stdout] 464 ~ impl From for Category { [INFO] [stdout] 465 ~ fn from(val: GeneratorCategory) -> Self { [INFO] [stdout] 466 ~ match val { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/generators/mod.rs:487:14 [INFO] [stdout] | [INFO] [stdout] 487 | matcher: &Box [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn VariantMatcher + Send + Sync)` [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: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/generators/mod.rs:499:14 [INFO] [stdout] | [INFO] [stdout] 499 | matcher: &Box [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn VariantMatcher + Send + Sync)` [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: you seem to be trying to use `&Box`. Consider using just `&T` [INFO] [stdout] --> src/generators/mod.rs:507:14 [INFO] [stdout] | [INFO] [stdout] 507 | matcher: &Box [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&(dyn VariantMatcher + Send + Sync)` [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/generators/mod.rs:541:17 [INFO] [stdout] | [INFO] [stdout] 541 | &Value::Object(ref map) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 541 - &Value::Object(ref map) => { [INFO] [stdout] 541 + Value::Object(map) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/generators/mod.rs:568:9 [INFO] [stdout] | [INFO] [stdout] 568 | &Value::String(ref gen_type) => match Generator::from_map(gen_type, map) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 568 - &Value::String(ref gen_type) => match Generator::from_map(gen_type, map) { [INFO] [stdout] 568 + Value::String(gen_type) => match Generator::from_map(gen_type, map) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GeneratorCategory` which implements the `Copy` trait [INFO] [stdout] --> src/generators/mod.rs:584:25 [INFO] [stdout] | [INFO] [stdout] 584 | let cat: String = name.clone().into(); [INFO] [stdout] | ^^^^^^^^^^^^ help: try dereferencing it: `(*name)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/generators/mod.rs:587:11 [INFO] [stdout] | [INFO] [stdout] 587 | / match category.get(&DocPath::empty()).or_else(|| category.get(&DocPath::root())) { [INFO] [stdout] 588 | | Some(generator) => { [INFO] [stdout] 589 | | let json = generator.to_json(); [INFO] [stdout] 590 | | if let Some(json) = json { [INFO] [stdout] ... | [INFO] [stdout] 594 | | None => () [INFO] [stdout] 595 | | } [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] 587 ~ if let Some(generator) = category.get(&DocPath::empty()).or_else(|| category.get(&DocPath::root())) { [INFO] [stdout] 588 + let json = generator.to_json(); [INFO] [stdout] 589 + if let Some(json) = json { [INFO] [stdout] 590 + map.insert(cat.clone(), json); [INFO] [stdout] 591 + } [INFO] [stdout] 592 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/generators/mod.rs:637:64 [INFO] [stdout] | [INFO] [stdout] 637 | let category_map = self.categories.entry(category.clone()).or_insert(HashMap::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GeneratorCategory` which implements the `Copy` trait [INFO] [stdout] --> src/generators/mod.rs:637:46 [INFO] [stdout] | [INFO] [stdout] 637 | let category_map = self.categories.entry(category.clone()).or_insert(HashMap::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try dereferencing it: `*category` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `or_insert` to construct default value [INFO] [stdout] --> src/generators/mod.rs:644:61 [INFO] [stdout] | [INFO] [stdout] 644 | let category_map = self.categories.entry(key.clone()).or_insert(HashMap::new()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unwrap_or_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GeneratorCategory` which implements the `Copy` trait [INFO] [stdout] --> src/generators/mod.rs:644:48 [INFO] [stdout] | [INFO] [stdout] 644 | let category_map = self.categories.entry(key.clone()).or_insert(HashMap::new()); [INFO] [stdout] | ^^^^^^^^^^^ help: try dereferencing it: `*key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:697:15 [INFO] [stdout] | [INFO] [stdout] 697 | closure(&key, &value) [INFO] [stdout] | ^^^^ help: change this to: `key` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:697:21 [INFO] [stdout] | [INFO] [stdout] 697 | closure(&key, &value) [INFO] [stdout] | ^^^^^^ help: change this to: `value` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/generators/mod.rs:705:3 [INFO] [stdout] | [INFO] [stdout] 705 | / match value { [INFO] [stdout] 706 | | &Value::Object(ref m) => match m.get("generators") { [INFO] [stdout] 707 | | Some(gen_val) => match gen_val { [INFO] [stdout] 708 | | &Value::Object(ref m) => generators.load_from_map(m)?, [INFO] [stdout] ... | [INFO] [stdout] 713 | | _ => () [INFO] [stdout] 714 | | } [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] 705 ~ if let &Value::Object(ref m) = value { match m.get("generators") { [INFO] [stdout] 706 + Some(gen_val) => match gen_val { [INFO] [stdout] 707 + &Value::Object(ref m) => generators.load_from_map(m)?, [INFO] [stdout] 708 + _ => () [INFO] [stdout] 709 + }, [INFO] [stdout] 710 + None => () [INFO] [stdout] 711 + } } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/generators/mod.rs:706:5 [INFO] [stdout] | [INFO] [stdout] 706 | &Value::Object(ref m) => match m.get("generators") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 706 - &Value::Object(ref m) => match m.get("generators") { [INFO] [stdout] 706 + Value::Object(m) => match m.get("generators") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/generators/mod.rs:707:24 [INFO] [stdout] | [INFO] [stdout] 707 | Some(gen_val) => match gen_val { [INFO] [stdout] | ________________________^ [INFO] [stdout] 708 | | &Value::Object(ref m) => generators.load_from_map(m)?, [INFO] [stdout] 709 | | _ => () [INFO] [stdout] 710 | | }, [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/generators/mod.rs:707:12 [INFO] [stdout] | [INFO] [stdout] 707 | Some(gen_val) => match gen_val { [INFO] [stdout] | ^^^^^^^ replace this binding [INFO] [stdout] 708 | &Value::Object(ref m) => generators.load_from_map(m)?, [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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/generators/mod.rs:706:30 [INFO] [stdout] | [INFO] [stdout] 706 | &Value::Object(ref m) => match m.get("generators") { [INFO] [stdout] | ______________________________^ [INFO] [stdout] 707 | | Some(gen_val) => match gen_val { [INFO] [stdout] 708 | | &Value::Object(ref m) => generators.load_from_map(m)?, [INFO] [stdout] 709 | | _ => () [INFO] [stdout] 710 | | }, [INFO] [stdout] 711 | | None => () [INFO] [stdout] 712 | | }, [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] 706 ~ &Value::Object(ref m) => if let Some(gen_val) = m.get("generators") { match gen_val { [INFO] [stdout] 707 + &Value::Object(ref m) => generators.load_from_map(m)?, [INFO] [stdout] 708 + _ => () [INFO] [stdout] 709 ~ } }, [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/generators/mod.rs:707:24 [INFO] [stdout] | [INFO] [stdout] 707 | Some(gen_val) => match gen_val { [INFO] [stdout] | ________________________^ [INFO] [stdout] 708 | | &Value::Object(ref m) => generators.load_from_map(m)?, [INFO] [stdout] 709 | | _ => () [INFO] [stdout] 710 | | }, [INFO] [stdout] | |_______^ help: try: `if let &Value::Object(ref m) = gen_val { generators.load_from_map(m)? }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/generators/mod.rs:708:9 [INFO] [stdout] | [INFO] [stdout] 708 | &Value::Object(ref m) => generators.load_from_map(m)?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 708 - &Value::Object(ref m) => generators.load_from_map(m)?, [INFO] [stdout] 708 + Value::Object(m) => generators.load_from_map(m)?, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/generators/mod.rs:780:5 [INFO] [stdout] | [INFO] [stdout] 780 | context.get(expression).map(|val| val.clone()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `context.get(expression).cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `Option` which implements the `Copy` trait [INFO] [stdout] --> src/generators/mod.rs:783:3 [INFO] [stdout] | [INFO] [stdout] 783 | data_type.clone().unwrap_or(DataType::RAW).wrap(result) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: try dereferencing it: `(*data_type)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/generators/mod.rs:830:5 [INFO] [stdout] | [INFO] [stdout] 830 | / match self { [INFO] [stdout] 831 | | &Generator::RandomInt(min, max) => Ok(rand::rng().random_range(min as u16..(max as u16).saturating_add(1))), [INFO] [stdout] 832 | | &Generator::ProviderStateGenerator(ref exp, ref dt) => { [INFO] [stdout] ... | [INFO] [stdout] 847 | | _ => Err(anyhow!("Could not generate a u16 value from {} using {:?}", value, self)) [INFO] [stdout] 848 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] = note: `#[warn(clippy::match_ref_pats)]` on by default [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 830 ~ match *self { [INFO] [stdout] 831 ~ Generator::RandomInt(min, max) => Ok(rand::rng().random_range(min as u16..(max as u16).saturating_add(1))), [INFO] [stdout] 832 ~ Generator::ProviderStateGenerator(ref exp, ref dt) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/generators/mod.rs:832:7 [INFO] [stdout] | [INFO] [stdout] 832 | &Generator::ProviderStateGenerator(ref exp, ref dt) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 832 - &Generator::ProviderStateGenerator(ref exp, ref dt) => { [INFO] [stdout] 832 + Generator::ProviderStateGenerator(exp, dt) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/generators/mod.rs:863:32 [INFO] [stdout] | [INFO] [stdout] 863 | fn replace_with_regex(example: &String, url: String, re: Regex) -> String { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 863 - fn replace_with_regex(example: &String, url: String, re: Regex) -> String { [INFO] [stdout] 863 + fn replace_with_regex(example: &str, url: String, re: Regex) -> String { [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/generators/mod.rs:1259:9 [INFO] [stdout] | [INFO] [stdout] 1259 | / match self.value.pointer_mut(&pointer_str) { [INFO] [stdout] 1260 | | Some(json_value) => match generator.generate_value(&json_value.clone(), context, matcher) { [INFO] [stdout] 1261 | | Ok(new_value) => *json_value = new_value, [INFO] [stdout] 1262 | | Err(_) => () [INFO] [stdout] 1263 | | }, [INFO] [stdout] 1264 | | None => () [INFO] [stdout] 1265 | | } [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] 1259 ~ if let Some(json_value) = self.value.pointer_mut(&pointer_str) { match generator.generate_value(&json_value.clone(), context, matcher) { [INFO] [stdout] 1260 + Ok(new_value) => *json_value = new_value, [INFO] [stdout] 1261 + Err(_) => () [INFO] [stdout] 1262 + } } [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/generators/mod.rs:1260:31 [INFO] [stdout] | [INFO] [stdout] 1260 | Some(json_value) => match generator.generate_value(&json_value.clone(), context, matcher) { [INFO] [stdout] | _______________________________^ [INFO] [stdout] 1261 | | Ok(new_value) => *json_value = new_value, [INFO] [stdout] 1262 | | Err(_) => () [INFO] [stdout] 1263 | | }, [INFO] [stdout] | |___________^ help: try: `if let Ok(new_value) = generator.generate_value(&json_value.clone(), context, matcher) { *json_value = new_value }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [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/generators/mod.rs:1268:7 [INFO] [stdout] | [INFO] [stdout] 1268 | / match generator.generate_value(&self.value.clone(), context, matcher) { [INFO] [stdout] 1269 | | Ok(new_value) => self.value = new_value, [INFO] [stdout] 1270 | | Err(_) => () [INFO] [stdout] 1271 | | } [INFO] [stdout] | |_______^ help: try: `if let Ok(new_value) = generator.generate_value(&self.value.clone(), context, matcher) { self.value = new_value }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1665:41 [INFO] [stdout] | [INFO] [stdout] 1665 | ...t!(Generator::from_map("Uuid", &json!({ "format": "simple"}).as_object().unwrap())).to(be_some().value(Generator::Uuid(Some(Uui... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "format": "simple"}).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1666:41 [INFO] [stdout] | [INFO] [stdout] 1666 | ...t!(Generator::from_map("Uuid", &json!({ "format": "other"}).as_object().unwrap())).to(be_some().value(Generator::Uuid(None))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "format": "other"}).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1673:46 [INFO] [stdout] | [INFO] [stdout] 1673 | ...ndomInt", &json!({ "min": 5 }).as_object().unwrap())).to(be_some().value(Generator::RandomInt(5, 10))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1674:46 [INFO] [stdout] | [INFO] [stdout] 1674 | ...ndomInt", &json!({ "max": 5 }).as_object().unwrap())).to(be_some().value(Generator::RandomInt(0, 5))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "max": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1675:46 [INFO] [stdout] | [INFO] [stdout] 1675 | ...nerator::from_map("RandomInt", &json!({ "min": 5, "max": 6 }).as_object().unwrap())).to(be_some().value(Generator::RandomInt(5,... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": 5, "max": 6 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1676:46 [INFO] [stdout] | [INFO] [stdout] 1676 | ...tor::from_map("RandomInt", &json!({ "min": 0, "max": 1234567890 }).as_object().unwrap())).to(be_some().value(Generator::RandomI... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": 0, "max": 1234567890 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1682:50 [INFO] [stdout] | [INFO] [stdout] 1682 | ...Decimal", &json!({ "min": 5 }).as_object().unwrap())).to(be_some().value(Generator::RandomDecimal(10))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1683:50 [INFO] [stdout] | [INFO] [stdout] 1683 | ...imal", &json!({ "digits": 5 }).as_object().unwrap())).to(be_some().value(Generator::RandomDecimal(5))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "digits": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1689:54 [INFO] [stdout] | [INFO] [stdout] 1689 | ...decimal", &json!({ "min": 5 }).as_object().unwrap())).to(be_some().value(Generator::RandomHexadecimal(10))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1690:54 [INFO] [stdout] | [INFO] [stdout] 1690 | ...imal", &json!({ "digits": 5 }).as_object().unwrap())).to(be_some().value(Generator::RandomHexadecimal(5))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "digits": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1696:49 [INFO] [stdout] | [INFO] [stdout] 1696 | ...mString", &json!({ "min": 5 }).as_object().unwrap())).to(be_some().value(Generator::RandomString(10))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1697:49 [INFO] [stdout] | [INFO] [stdout] 1697 | ...String", &json!({ "size": 5 }).as_object().unwrap())).to(be_some().value(Generator::RandomString(5))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "size": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1703:42 [INFO] [stdout] | [INFO] [stdout] 1703 | expect!(Generator::from_map("Regex", &json!({ "min": 5 }).as_object().unwrap())).to(be_none()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1704:42 [INFO] [stdout] | [INFO] [stdout] 1704 | ...", &json!({ "regex": "\\d+" }).as_object().unwrap())).to(be_some().value(Generator::Regex("\\d+".to_string()))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "regex": "\\d+" }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1705:42 [INFO] [stdout] | [INFO] [stdout] 1705 | ...Regex", &json!({ "regex": 5 }).as_object().unwrap())).to(be_some().value(Generator::Regex("5".to_string()))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "regex": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1711:41 [INFO] [stdout] | [INFO] [stdout] 1711 | expect!(Generator::from_map("Date", &json!({ "min": 5 }).as_object().unwrap())).to(be_some().value(Generator::Date(None, None))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1712:41 [INFO] [stdout] | [INFO] [stdout] 1712 | ...(Generator::from_map("Date", &json!({ "format": "yyyy-MM-dd" }).as_object().unwrap())).to(be_some().value(Generator::Date(Some(... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "format": "yyyy-MM-dd" }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1713:41 [INFO] [stdout] | [INFO] [stdout] 1713 | ...Date", &json!({ "format": 5 }).as_object().unwrap())).to(be_some().value(Generator::Date(Some("5".to_string()), None))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "format": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1714:41 [INFO] [stdout] | [INFO] [stdout] 1714 | ...(Generator::from_map("Date", &json!({ "expression": "now" }).as_object().unwrap())).to(be_some().value(Generator::Date(None, So... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "expression": "now" }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1720:41 [INFO] [stdout] | [INFO] [stdout] 1720 | expect!(Generator::from_map("Time", &json!({ "min": 5 }).as_object().unwrap())).to(be_some().value(Generator::Time(None, None))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1721:41 [INFO] [stdout] | [INFO] [stdout] 1721 | ...(Generator::from_map("Time", &json!({ "format": "yyyy-MM-dd" }).as_object().unwrap())).to(be_some().value(Generator::Time(Some(... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "format": "yyyy-MM-dd" }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1722:41 [INFO] [stdout] | [INFO] [stdout] 1722 | ...Time", &json!({ "format": 5 }).as_object().unwrap())).to(be_some().value(Generator::Time(Some("5".to_string()), None))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "format": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1723:41 [INFO] [stdout] | [INFO] [stdout] 1723 | ...(Generator::from_map("Time", &json!({ "expression": "now" }).as_object().unwrap())).to(be_some().value(Generator::Time(None, So... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "expression": "now" }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1729:45 [INFO] [stdout] | [INFO] [stdout] 1729 | ...ateTime", &json!({ "min": 5 }).as_object().unwrap())).to(be_some().value(Generator::DateTime(None, None))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "min": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1730:45 [INFO] [stdout] | [INFO] [stdout] 1730 | ...erator::from_map("DateTime", &json!({ "format": "yyyy-MM-dd" }).as_object().unwrap())).to(be_some().value(Generator::DateTime(S... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "format": "yyyy-MM-dd" }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1731:45 [INFO] [stdout] | [INFO] [stdout] 1731 | ...Time", &json!({ "format": 5 }).as_object().unwrap())).to(be_some().value(Generator::DateTime(Some("5".to_string()), None))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "format": 5 }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1732:45 [INFO] [stdout] | [INFO] [stdout] 1732 | ...erator::from_map("DateTime", &json!({ "expression": "now" }).as_object().unwrap())).to(be_some().value(Generator::DateTime(None... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "expression": "now" }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1738:50 [INFO] [stdout] | [INFO] [stdout] 1738 | expect!(Generator::from_map("ProviderState", &json!({ "expression": "5" }).as_object().unwrap())).to( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "expression": "5" }).as_object().unwrap()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/generators/mod.rs:1740:50 [INFO] [stdout] | [INFO] [stdout] 1740 | expect!(Generator::from_map("ProviderState", &json!({ "expression": "5", "dataType": "INTEGER" }).as_object().unwrap())).to( [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `json!({ "expression": "5", "dataType": "INTEGER" }).as_object().unwrap()` [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: usage of a legacy numeric method [INFO] [stdout] --> src/generators/mod.rs:1941:42 [INFO] [stdout] | [INFO] [stdout] 1941 | assert_that!(Generator::RandomInt(0, i32::max_value()).generate_value(&0, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants [INFO] [stdout] = note: `#[warn(clippy::legacy_numeric_constants)]` on by default [INFO] [stdout] help: use the associated constant instead [INFO] [stdout] | [INFO] [stdout] 1941 - assert_that!(Generator::RandomInt(0, i32::max_value()).generate_value(&0, [INFO] [stdout] 1941 + assert_that!(Generator::RandomInt(0, i32::MAX).generate_value(&0, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `&str` [INFO] [stdout] --> src/generators/mod.rs:1948:18 [INFO] [stdout] | [INFO] [stdout] 1948 | &hashmap!{ "a".into() => json!(1234) }, &NoopVariantMatcher.boxed())).to(be_ok().value(1234)); [INFO] [stdout] | ^^^^^^^^^^ help: consider removing `.into()`: `"a"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/generators/mod.rs:2063:15 [INFO] [stdout] | [INFO] [stdout] 2063 | expect!(first_char != '0' || (first_char == '0' && second_char == '.')).to(be_true()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 2063 - expect!(first_char != '0' || (first_char == '0' && second_char == '.')).to(be_true()); [INFO] [stdout] 2063 + expect!(!(first_char == '0' && second_char != '.')).to(be_true()); [INFO] [stdout] | [INFO] [stdout] 2063 - expect!(first_char != '0' || (first_char == '0' && second_char == '.')).to(be_true()); [INFO] [stdout] 2063 + expect!(first_char != '0' || second_char == '.').to(be_true()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match expression looks like `matches!` macro [INFO] [stdout] --> src/path_exp.rs:44:5 [INFO] [stdout] | [INFO] [stdout] 44 | / match self { [INFO] [stdout] 45 | | PathToken::Index(_) => true, [INFO] [stdout] 46 | | _ => false [INFO] [stdout] 47 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 44 - match self { [INFO] [stdout] 45 - PathToken::Index(_) => true, [INFO] [stdout] 46 - _ => false [INFO] [stdout] 47 - } [INFO] [stdout] 44 + matches!(self, PathToken::Index(_)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `DocPath` has a public `len` method, but no `is_empty` method [INFO] [stdout] --> src/path_exp.rs:157:3 [INFO] [stdout] | [INFO] [stdout] 157 | pub fn len(&self) -> usize { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_without_is_empty [INFO] [stdout] = note: `#[warn(clippy::len_without_is_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/path_exp.rs:174:5 [INFO] [stdout] | [INFO] [stdout] 174 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 174 - return None; [INFO] [stdout] 174 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/path_exp.rs:184:5 [INFO] [stdout] | [INFO] [stdout] 184 | return None; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 184 - return None; [INFO] [stdout] 184 + None [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: needlessly taken reference of both operands [INFO] [stdout] --> src/path_exp.rs:189:5 [INFO] [stdout] | [INFO] [stdout] 189 | &self.path_tokens == &[PathToken::Root] [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] = note: `#[warn(clippy::op_ref)]` on by default [INFO] [stdout] help: use the values directly [INFO] [stdout] | [INFO] [stdout] 189 - &self.path_tokens == &[PathToken::Root] [INFO] [stdout] 189 + self.path_tokens == [PathToken::Root] [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/path_exp.rs:322:26 [INFO] [stdout] | [INFO] [stdout] 322 | PathToken::Root => self.expr.push_str("$"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `self.expr.push('$')` [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: using `clone` on type `usize` which implements the `Copy` trait [INFO] [stdout] --> src/path_exp.rs:558:27 [INFO] [stdout] | [INFO] [stdout] 558 | chars.peek().map(|tup| (tup.0.clone(), tup.1.clone())) [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `tup.0` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `char` which implements the `Copy` trait [INFO] [stdout] --> src/path_exp.rs:558:42 [INFO] [stdout] | [INFO] [stdout] 558 | chars.peek().map(|tup| (tup.0.clone(), tup.1.clone())) [INFO] [stdout] | ^^^^^^^^^^^^^ help: try removing the `clone` call: `tup.1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/path_exp.rs:657:3 [INFO] [stdout] | [INFO] [stdout] 657 | / if let Some(ch) = next_char { [INFO] [stdout] 658 | | if ch.1 != ']' { [INFO] [stdout] 659 | | return Err(format!("Indexes can only consist of numbers or a \"*\", found \"{}\" instead in path expression \"{}\" at index... [INFO] [stdout] 660 | | ch.1, path, ch.0)) [INFO] [stdout] 661 | | } [INFO] [stdout] 662 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 657 ~ if let Some(ch) = next_char [INFO] [stdout] 658 ~ && ch.1 != ']' { [INFO] [stdout] 659 | return Err(format!("Indexes can only consist of numbers or a \"*\", found \"{}\" instead in path expression \"{}\" at index {}", [INFO] [stdout] 660 | ch.1, path, ch.0)) [INFO] [stdout] 661 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/query_strings.rs:36:27 [INFO] [stdout] | [INFO] [stdout] 36 | buffer.push('%' as u8); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'%'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] = note: `#[warn(clippy::char_lit_as_u8)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/query_strings.rs:43:23 [INFO] [stdout] | [INFO] [stdout] 43 | buffer.push('%' as u8); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'%'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/query_strings.rs:46:26 [INFO] [stdout] | [INFO] [stdout] 46 | _ => buffer.push('%' as u8) [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b'%'` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting a character literal to `u8` truncates [INFO] [stdout] --> src/query_strings.rs:49:19 [INFO] [stdout] | [INFO] [stdout] 49 | buffer.push(' ' as u8); [INFO] [stdout] | ^^^^^^^^^ help: use a byte literal instead: `b' '` [INFO] [stdout] | [INFO] [stdout] = note: `char` is four bytes wide, but `u8` is a single byte [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of `char::is_digit` with literal radix of 16 [INFO] [stdout] --> src/query_strings.rs:76:21 [INFO] [stdout] | [INFO] [stdout] 76 | .filter(|u| u.is_digit(16)) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `u.is_ascii_hexdigit()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix [INFO] [stdout] = note: `#[warn(clippy::is_digit_ascii_radix)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/query_strings.rs:78:11 [INFO] [stdout] | [INFO] [stdout] 78 | / match it.next() { [INFO] [stdout] 79 | | None => None, [INFO] [stdout] 80 | | Some(x) => Some((x, it.next().unwrap())) [INFO] [stdout] 81 | | } [INFO] [stdout] | |___________^ help: try: `it.next().map(|x| (x, it.next().unwrap()))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/query_strings.rs:112:40 [INFO] [stdout] | [INFO] [stdout] 112 | map.entry(name).or_insert_with(|| vec![]).push(value); [INFO] [stdout] | ^^^^^^^^^ help: replace the closure with `Vec::new`: `std::vec::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: match expression looks like `matches!` macro [INFO] [stdout] --> src/http_utils.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | / match self { [INFO] [stdout] 25 | | HttpAuth::None => true, [INFO] [stdout] 26 | | _ => false [INFO] [stdout] 27 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 24 - match self { [INFO] [stdout] 25 - HttpAuth::None => true, [INFO] [stdout] 26 - _ => false [INFO] [stdout] 27 - } [INFO] [stdout] 24 + matches!(self, HttpAuth::None) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/http_utils.rs:34:17 [INFO] [stdout] | [INFO] [stdout] 34 | let request = match auth { [INFO] [stdout] | _________________^ [INFO] [stdout] 35 | | &Some(ref auth) => { [INFO] [stdout] 36 | | match auth { [INFO] [stdout] 37 | | &HttpAuth::User(ref username, ref password) => client.get(url).basic_auth(username.clone(), password.clone()), [INFO] [stdout] ... | [INFO] [stdout] 42 | | &None => client.get(url) [INFO] [stdout] 43 | | }; [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 34 ~ let request = match *auth { [INFO] [stdout] 35 ~ Some(ref auth) => { [INFO] [stdout] 36 | match auth { [INFO] [stdout] ... [INFO] [stdout] 41 | }, [INFO] [stdout] 42 ~ None => client.get(url) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/http_utils.rs:35:5 [INFO] [stdout] | [INFO] [stdout] 35 | &Some(ref auth) => { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 35 - &Some(ref auth) => { [INFO] [stdout] 35 + Some(auth) => { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you don't need to add `&` to all patterns [INFO] [stdout] --> src/http_utils.rs:36:7 [INFO] [stdout] | [INFO] [stdout] 36 | / match auth { [INFO] [stdout] 37 | | &HttpAuth::User(ref username, ref password) => client.get(url).basic_auth(username.clone(), password.clone()), [INFO] [stdout] 38 | | &HttpAuth::Token(ref token) => client.get(url).bearer_auth(token.clone()), [INFO] [stdout] 39 | | _ => client.get(url) [INFO] [stdout] 40 | | } [INFO] [stdout] | |_______^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stdout] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stdout] | [INFO] [stdout] 36 ~ match *auth { [INFO] [stdout] 37 ~ HttpAuth::User(ref username, ref password) => client.get(url).basic_auth(username.clone(), password.clone()), [INFO] [stdout] 38 ~ HttpAuth::Token(ref token) => client.get(url).bearer_auth(token.clone()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/http_utils.rs:37:9 [INFO] [stdout] | [INFO] [stdout] 37 | &HttpAuth::User(ref username, ref password) => client.get(url).basic_auth(username.clone(), password.clone()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 37 - &HttpAuth::User(ref username, ref password) => client.get(url).basic_auth(username.clone(), password.clone()), [INFO] [stdout] 37 + HttpAuth::User(username, password) => client.get(url).basic_auth(username.clone(), password.clone()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/http_utils.rs:38:9 [INFO] [stdout] | [INFO] [stdout] 38 | &HttpAuth::Token(ref token) => client.get(url).bearer_auth(token.clone()), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 38 - &HttpAuth::Token(ref token) => client.get(url).bearer_auth(token.clone()), [INFO] [stdout] 38 + HttpAuth::Token(token) => client.get(url).bearer_auth(token.clone()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `GeneratorCategory` which implements the `Copy` trait [INFO] [stdout] --> src/http_parts.rs:112:33 [INFO] [stdout] | [INFO] [stdout] 112 | let mr_category: Category = category.clone().into(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: try dereferencing it: `(*category)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/request.rs:80:30 [INFO] [stdout] | [INFO] [stdout] 80 | self.lookup_header_value(&"content-type".to_string()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `"content-type"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: re-implementing `PartialEq::ne` is unnecessary [INFO] [stdout] --> src/request.rs:113:3 [INFO] [stdout] | [INFO] [stdout] 113 | fn ne(&self, other: &Self) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_ne_impl [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/response.rs:172:30 [INFO] [stdout] | [INFO] [stdout] 172 | self.lookup_header_value(&"content-type".to_string()) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `"content-type"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: re-implementing `PartialEq::ne` is unnecessary [INFO] [stdout] --> src/response.rs:197:3 [INFO] [stdout] | [INFO] [stdout] 197 | fn ne(&self, other: &Self) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_ne_impl [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/interaction.rs:203:15 [INFO] [stdout] | [INFO] [stdout] 203 | if let Some(&Value::Array(ref array)) = pact_json.get("interactions") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 203 - if let Some(&Value::Array(ref array)) = pact_json.get("interactions") { [INFO] [stdout] 203 + if let Some(Value::Array(array)) = pact_json.get("interactions") { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/sync_interaction.rs:165:39 [INFO] [stdout] | [INFO] [stdout] 165 | let id = pact_json.get("_id").map(|id| json_to_string(id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [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: match expression looks like `matches!` macro [INFO] [stdout] --> src/sync_interaction.rs:218:32 [INFO] [stdout] | [INFO] [stdout] 218 | .filter(|difference| match difference.0 { [INFO] [stdout] | ________________________________^ [INFO] [stdout] 219 | | DifferenceType::MatchingRules | DifferenceType::Body | DifferenceType::Headers => false, [INFO] [stdout] 220 | | _ => true [INFO] [stdout] 221 | | }) [INFO] [stdout] | |___________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_like_matches_macro [INFO] [stdout] help: use `matches!` directly [INFO] [stdout] | [INFO] [stdout] 218 - .filter(|difference| match difference.0 { [INFO] [stdout] 219 - DifferenceType::MatchingRules | DifferenceType::Body | DifferenceType::Headers => false, [INFO] [stdout] 220 - _ => true [INFO] [stdout] 221 - }) [INFO] [stdout] 218 + .filter(|difference| !matches!(difference.0, DifferenceType::MatchingRules | DifferenceType::Body | DifferenceType::Headers)) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/sync_interaction.rs:237:22 [INFO] [stdout] | [INFO] [stdout] 237 | description: format!("You can not combine message and request/response interactions") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"You can not combine message and request/response interactions".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: useless use of `format!` [INFO] [stdout] --> src/sync_interaction.rs:288:58 [INFO] [stdout] | [INFO] [stdout] 288 | ... format!("'providerState' is deprecated, use 'providerStates' instead"))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"'providerState' is deprecated, use 'providerStates' instead".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: useless use of `format!` [INFO] [stdout] --> src/sync_interaction.rs:293:56 [INFO] [stdout] | [INFO] [stdout] 293 | ... format!("'provider_state' is deprecated, use 'providerStates' instead"))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"'provider_state' is deprecated, use 'providerStates' instead".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: deref which would be done by auto-deref [INFO] [stdout] --> src/sync_interaction.rs:303:44 [INFO] [stdout] | [INFO] [stdout] 303 | ProviderState::verify_json(&*format!("{}/providerStates/{}", path, index), state, strict, spec_version) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&format!("{}/providerStates/{}", path, index)` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/sync_interaction.rs:317:58 [INFO] [stdout] | [INFO] [stdout] 317 | ... &format!("Unexpected attribute '{}'", key))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Unexpected attribute '{}'", key)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/message.rs:188:46 [INFO] [stdout] | [INFO] [stdout] 188 | let id = json.get("_id").map(|id| json_to_string(id)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the function itself: `json_to_string` [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: dereferencing a tuple pattern where every element takes a reference [INFO] [stdout] --> src/message.rs:198:24 [INFO] [stdout] | [INFO] [stdout] 198 | Some(&Value::Object(ref v)) => v.iter().map(|(k, v)| { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrowed_reference [INFO] [stdout] help: try removing the `&` and `ref` parts [INFO] [stdout] | [INFO] [stdout] 198 - Some(&Value::Object(ref v)) => v.iter().map(|(k, v)| { [INFO] [stdout] 198 + Some(Value::Object(v)) => v.iter().map(|(k, v)| { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `map(..).flatten()` on `Option` [INFO] [stdout] --> src/message.rs:209:18 [INFO] [stdout] | [INFO] [stdout] 209 | .map(|s| ContentType::parse(s.as_str()).ok()) [INFO] [stdout] | __________________^ [INFO] [stdout] 210 | | .flatten(); [INFO] [stdout] | |__________________________^ help: try replacing `map` with `and_then` and remove the `.flatten()`: `and_then(|s| ContentType::parse(s.as_str()).ok())` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_flatten [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/message.rs:299:59 [INFO] [stdout] | [INFO] [stdout] 299 | Some((_, v)) => ContentType::parse(json_to_string(&v).as_str()).ok(), [INFO] [stdout] | ^^ help: change this to: `v` [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: deref which would be done by auto-deref [INFO] [stdout] --> src/pact.rs:159:23 [INFO] [stdout] | [INFO] [stdout] 159 | load_pact_from_json(&*path.to_string_lossy(), &pact_json) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&path.to_string_lossy()` [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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/pact.rs:179:54 [INFO] [stdout] | [INFO] [stdout] 179 | PactSpecification::V4 => v4::pact::from_json(&source, json), [INFO] [stdout] | ^^^^^^^ help: change this to: `source` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:229:68 [INFO] [stdout] | [INFO] [stdout] 229 | let mut f = fs::OpenOptions::new().read(true).write(true).open(&path)?; [INFO] [stdout] | ^^^^^ help: change this to: `path` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` can be collapsed into the outer `match` [INFO] [stdout] --> src/pact.rs:261:16 [INFO] [stdout] | [INFO] [stdout] 261 | Some(v) => match *v { [INFO] [stdout] | ________________^ [INFO] [stdout] 262 | | Value::Object(ref obj) => obj.iter().map(|(k, v)| { [INFO] [stdout] 263 | | let val = match *v { [INFO] [stdout] 264 | | Value::Object(ref obj) => obj.iter().map(|(k, v)| { [INFO] [stdout] ... | [INFO] [stdout] 279 | | _ => btreemap!{} [INFO] [stdout] 280 | | }, [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] help: the outer pattern can be modified to include the inner pattern [INFO] [stdout] --> src/pact.rs:261:10 [INFO] [stdout] | [INFO] [stdout] 260 | match pact_json.get("metadata") { [INFO] [stdout] | ------------------------- use: `pact_json.get("metadata").copied()` [INFO] [stdout] 261 | Some(v) => match *v { [INFO] [stdout] | ^ replace this binding [INFO] [stdout] 262 | Value::Object(ref obj) => obj.iter().map(|(k, v)| { [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:389:54 [INFO] [stdout] | [INFO] [stdout] 389 | ... &format!("'pact-specification' is deprecated, use 'pactSpecification' instead"))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("'pact-specification' is deprecated, use 'pactSpecification' instead")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/pact.rs:389:55 [INFO] [stdout] | [INFO] [stdout] 389 | ... &format!("'pact-specification' is deprecated, use 'pactSpecification' instead"))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"'pact-specification' is deprecated, use 'pactSpecification' instead".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: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:397:54 [INFO] [stdout] | [INFO] [stdout] 397 | ... &format!("'pactSpecificationVersion' is deprecated, use 'pactSpecification/version' instead"))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("'pactSpecificationVersion' is deprecated, use 'pactSpecification/version' instead")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/pact.rs:397:55 [INFO] [stdout] | [INFO] [stdout] 397 | ... &format!("'pactSpecificationVersion' is deprecated, use 'pactSpecification/version' instead"))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"'pactSpecificationVersion' is deprecated, use 'pactSpecification/version' instead".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: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:406:77 [INFO] [stdout] | [INFO] [stdout] 406 | ... &format!("pactSpecification version is NULL"))), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("pactSpecification version is NULL")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/pact.rs:406:78 [INFO] [stdout] | [INFO] [stdout] 406 | ... &format!("pactSpecification version is NULL"))), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"pactSpecification version is NULL".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: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:409:64 [INFO] [stdout] | [INFO] [stdout] 409 | ... &format!("'{}' is not a valid Pact specification version", version))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("'{}' is not a valid Pact specification version", version)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:412:67 [INFO] [stdout] | [INFO] [stdout] 412 | ... &format!("Version must be a String, got {}", json_type_of(version)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Version must be a String, got {}", json_type_of(version))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:416:60 [INFO] [stdout] | [INFO] [stdout] 416 | ... &format!("pactSpecification is missing the version attribute"))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("pactSpecification is missing the version attribute")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/pact.rs:416:61 [INFO] [stdout] | [INFO] [stdout] 416 | ... &format!("pactSpecification is missing the version attribute"))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"pactSpecification is missing the version attribute".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: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:420:61 [INFO] [stdout] | [INFO] [stdout] 420 | ... &format!("pactSpecification must be an Object, got {}", json_type_of(spec)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("pactSpecification must be an Object, got {}", json_type_of(spec))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/pact.rs:425:55 [INFO] [stdout] | [INFO] [stdout] 425 | ... &format!("Metadata must be an Object, got {}", json_type_of(metadata)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Metadata must be an Object, got {}", json_type_of(metadata))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/pact.rs:464:47 [INFO] [stdout] | [INFO] [stdout] 464 | let pact = RequestResponsePact::from_json(&"".to_string(), &serde_json::from_str(pact_json).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/pact.rs:477:47 [INFO] [stdout] | [INFO] [stdout] 477 | let pact = RequestResponsePact::from_json(&"".to_string(), &serde_json::from_str(pact_json).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/pact.rs:489:47 [INFO] [stdout] | [INFO] [stdout] 489 | let pact = RequestResponsePact::from_json(&"".to_string(), &serde_json::from_str(pact_json).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/pact.rs:504:47 [INFO] [stdout] | [INFO] [stdout] 504 | let pact = RequestResponsePact::from_json(&"".to_string(), &serde_json::from_str(pact_json).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/pact.rs:519:47 [INFO] [stdout] | [INFO] [stdout] 519 | let pact = RequestResponsePact::from_json(&"".to_string(), &serde_json::from_str(pact_json).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/pact.rs:534:47 [INFO] [stdout] | [INFO] [stdout] 534 | let pact = RequestResponsePact::from_json(&"".to_string(), &serde_json::from_str(pact_json).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/pact.rs:549:47 [INFO] [stdout] | [INFO] [stdout] 549 | let pact = RequestResponsePact::from_json(&"".to_string(), &serde_json::from_str(pact_json).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/pact.rs:585:47 [INFO] [stdout] | [INFO] [stdout] 585 | let pact = RequestResponsePact::from_json(&"".to_string(), &serde_json::from_str(pact_json).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/pact.rs:659:47 [INFO] [stdout] | [INFO] [stdout] 659 | let pact = RequestResponsePact::from_json(&"".to_string(), &serde_json::from_str(pact_json).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/pact.rs:738:47 [INFO] [stdout] | [INFO] [stdout] 738 | let pact = RequestResponsePact::from_json(&"".to_string(), &serde_json::from_str(pact_json).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/pact.rs:814:47 [INFO] [stdout] | [INFO] [stdout] 814 | let pact = RequestResponsePact::from_json(&"".to_string(), &serde_json::from_str(pact_json).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/pact.rs:848:47 [INFO] [stdout] | [INFO] [stdout] 848 | let pact = RequestResponsePact::from_json(&"".to_string(), &serde_json::from_str(pact_json).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/sync_pact.rs:90:8 [INFO] [stdout] | [INFO] [stdout] 90 | .filter(|i| i.is_some()) [INFO] [stdout] | ________^ [INFO] [stdout] 91 | | .map(|i| i.unwrap()) [INFO] [stdout] | |__________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `PactSpecification` which implements the `Copy` trait [INFO] [stdout] --> src/sync_pact.rs:103:5 [INFO] [stdout] | [INFO] [stdout] 103 | self.specification_version.clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.specification_version` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/sync_pact.rs:164:28 [INFO] [stdout] | [INFO] [stdout] 164 | determine_spec_version(&"".to_string(), &self.metadata) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `PactSpecification` which implements the `Copy` trait [INFO] [stdout] --> src/sync_pact.rs:187:55 [INFO] [stdout] | [INFO] [stdout] 187 | interactions: parse_interactions(pact_json, spec_version.clone())?, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `spec_version` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `default` can be confused for the standard trait method `std::default::Default::default` [INFO] [stdout] --> src/sync_pact.rs:229:3 [INFO] [stdout] | [INFO] [stdout] 229 | / pub fn default() -> RequestResponsePact { [INFO] [stdout] 230 | | RequestResponsePact { [INFO] [stdout] 231 | | consumer: Consumer { name: "default_consumer".to_string() }, [INFO] [stdout] 232 | | provider: Provider { name: "default_provider".to_string() }, [INFO] [stdout] ... | [INFO] [stdout] 237 | | } [INFO] [stdout] | |___^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `PactSpecification` which implements the `Copy` trait [INFO] [stdout] --> src/sync_pact.rs:334:36 [INFO] [stdout] | [INFO] [stdout] 334 | specification_version: self.specification_version.clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.specification_version` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/sync_pact.rs:383:63 [INFO] [stdout] | [INFO] [stdout] 383 | ... &format!("Must be an Object, got {}", json_type_of(pact_json)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Must be an Object, got {}", json_type_of(pact_json))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/sync_pact.rs:396:58 [INFO] [stdout] | [INFO] [stdout] 396 | results.push(PactFileVerificationResult::new(&format!("/{}", key), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("/{}", key)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/sync_pact.rs:398:58 [INFO] [stdout] | [INFO] [stdout] 398 | ... &format!("Unexpected attribute '{}'", key))); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Unexpected attribute '{}'", key)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/sync_pact.rs:403:57 [INFO] [stdout] | [INFO] [stdout] 403 | ... &format!("Must be an Object, got {}", json_type_of(pact_json)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Must be an Object, got {}", json_type_of(pact_json))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/sync_pact.rs:557:47 [INFO] [stdout] | [INFO] [stdout] 557 | let pact = RequestResponsePact::from_json(&"test", &pact_json)?; [INFO] [stdout] | ^^^^^^^ help: change this to: `"test"` [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: `filter` for `Some` followed by `unwrap` [INFO] [stdout] --> src/message_pact.rs:96:8 [INFO] [stdout] | [INFO] [stdout] 96 | .filter(|i| i.is_some()) [INFO] [stdout] | ________^ [INFO] [stdout] 97 | | .map(|i| i.unwrap()) [INFO] [stdout] | |__________________________^ help: consider using `flatten` instead: `flatten()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_filter_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `PactSpecification` which implements the `Copy` trait [INFO] [stdout] --> src/message_pact.rs:109:5 [INFO] [stdout] | [INFO] [stdout] 109 | self.specification_version.clone() [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `self.specification_version` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `PactSpecification` which implements the `Copy` trait [INFO] [stdout] --> src/message_pact.rs:206:36 [INFO] [stdout] | [INFO] [stdout] 206 | specification_version: spec_version.clone(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: try removing the `clone` call: `spec_version` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `default` can be confused for the standard trait method `std::default::Default::default` [INFO] [stdout] --> src/message_pact.rs:272:5 [INFO] [stdout] | [INFO] [stdout] 272 | / pub fn default() -> MessagePact { [INFO] [stdout] 273 | | MessagePact { [INFO] [stdout] 274 | | consumer: Consumer { name: "default_consumer".to_string() }, [INFO] [stdout] 275 | | provider: Provider { name: "default_provider".to_string() }, [INFO] [stdout] ... | [INFO] [stdout] 280 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/message_pact.rs:362:9 [INFO] [stdout] | [INFO] [stdout] 362 | &format!("Must be an Object, got {}", json_type_of(pact_json)))) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `format!("Must be an Object, got {}", json_type_of(pact_json))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/message_pact.rs:392:13 [INFO] [stdout] | [INFO] [stdout] 392 | &"".to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/message_pact.rs:406:13 [INFO] [stdout] | [INFO] [stdout] 406 | &"".to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/message_pact.rs:419:13 [INFO] [stdout] | [INFO] [stdout] 419 | &"".to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/message_pact.rs:435:13 [INFO] [stdout] | [INFO] [stdout] 435 | &"".to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/message_pact.rs:451:13 [INFO] [stdout] | [INFO] [stdout] 451 | &"".to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/message_pact.rs:467:13 [INFO] [stdout] | [INFO] [stdout] 467 | &"".to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/message_pact.rs:483:13 [INFO] [stdout] | [INFO] [stdout] 483 | &"".to_string(), [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/message_pact.rs:512:43 [INFO] [stdout] | [INFO] [stdout] 512 | let pact = MessagePact::from_json(&"".to_string(), &serde_json::from_str(pact_json).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/message_pact.rs:552:43 [INFO] [stdout] | [INFO] [stdout] 552 | let pact = MessagePact::from_json(&"".to_string(), &serde_json::from_str(pact_json).unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: use: `""` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/lib.rs:98:1 [INFO] [stdout] | [INFO] [stdout] 98 | / impl Default for PactSpecification { [INFO] [stdout] 99 | | fn default() -> Self { [INFO] [stdout] 100 | | PactSpecification::Unknown [INFO] [stdout] 101 | | } [INFO] [stdout] 102 | | } [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 and mark the default variant [INFO] [stdout] | [INFO] [stdout] 83 + #[derive(Default)] [INFO] [stdout] 84 | pub enum PactSpecification { [INFO] [stdout] 85 | /// Unknown or unsupported specification version [INFO] [stdout] 86 ~ #[default] [INFO] [stdout] 87 ~ Unknown, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `json.get("interactions").unwrap().as_array().unwrap().get(0)` [INFO] [stdout] --> src/tests.rs:334:21 [INFO] [stdout] | [INFO] [stdout] 334 | let interaction = json.get("interactions").unwrap().as_array().unwrap().get(0).unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `json.get("interactions").unwrap().as_array().unwrap().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: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:816:51 [INFO] [stdout] | [INFO] [stdout] 816 | expect!(DocPath::new_unwrap("$").matches_path(&vec!["$"])).to(be_true()); [INFO] [stdout] | ^^^^^^^^^^ help: you can use a slice directly: `&["$"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] = note: `#[warn(clippy::useless_vec)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:817:51 [INFO] [stdout] | [INFO] [stdout] 817 | expect!(DocPath::new_unwrap("$").matches_path(&vec![])).to(be_false()); [INFO] [stdout] | ^^^^^^^ help: you can use a slice directly: `&[]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:822:56 [INFO] [stdout] | [INFO] [stdout] 822 | expect!(DocPath::new_unwrap("$.name").matches_path(&vec!["$", "name"])).to(be_true()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "name"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:823:59 [INFO] [stdout] | [INFO] [stdout] 823 | expect!(DocPath::new_unwrap("$['name']").matches_path(&vec!["$", "name"])).to(be_true()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "name"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:824:62 [INFO] [stdout] | [INFO] [stdout] 824 | expect!(DocPath::new_unwrap("$.name.other").matches_path(&vec!["$", "name", "other"])).to(be_true()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "name", "other"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:825:65 [INFO] [stdout] | [INFO] [stdout] 825 | expect!(DocPath::new_unwrap("$['name'].other").matches_path(&vec!["$", "name", "other"])).to(be_true()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "name", "other"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:826:56 [INFO] [stdout] | [INFO] [stdout] 826 | expect!(DocPath::new_unwrap("$.name").matches_path(&vec!["$", "other"])).to(be_false()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "other"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:827:56 [INFO] [stdout] | [INFO] [stdout] 827 | expect!(DocPath::new_unwrap("$.name").matches_path(&vec!["$", "name", "other"])).to(be_true()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "name", "other"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:828:57 [INFO] [stdout] | [INFO] [stdout] 828 | expect!(DocPath::new_unwrap("$.other").matches_path(&vec!["$", "name", "other"])).to(be_false()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "name", "other"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:829:62 [INFO] [stdout] | [INFO] [stdout] 829 | expect!(DocPath::new_unwrap("$.name.other").matches_path(&vec!["$", "name"])).to(be_false()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "name"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:834:54 [INFO] [stdout] | [INFO] [stdout] 834 | expect!(DocPath::new_unwrap("$[0]").matches_path(&vec!["$", "0"])).to(be_true()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "0"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:835:59 [INFO] [stdout] | [INFO] [stdout] 835 | expect!(DocPath::new_unwrap("$.name[1]").matches_path(&vec!["$", "name", "1"])).to(be_true()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "name", "1"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:836:56 [INFO] [stdout] | [INFO] [stdout] 836 | expect!(DocPath::new_unwrap("$.name").matches_path(&vec!["$", "0"])).to(be_false()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "0"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:837:59 [INFO] [stdout] | [INFO] [stdout] 837 | expect!(DocPath::new_unwrap("$.name[1]").matches_path(&vec!["$", "name", "0"])).to(be_false()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "name", "0"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:838:59 [INFO] [stdout] | [INFO] [stdout] 838 | expect!(DocPath::new_unwrap("$[1].name").matches_path(&vec!["$", "name", "1"])).to(be_false()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "name", "1"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:843:54 [INFO] [stdout] | [INFO] [stdout] 843 | expect!(DocPath::new_unwrap("$[*]").matches_path(&vec!["$", "0"])).to(be_true()); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "0"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:844:53 [INFO] [stdout] | [INFO] [stdout] 844 | expect!(DocPath::new_unwrap("$.*").matches_path(&vec!["$", "name"])).to(be_true()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "name"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:845:58 [INFO] [stdout] | [INFO] [stdout] 845 | expect!(DocPath::new_unwrap("$.*.name").matches_path(&vec!["$", "some", "name"])).to(be_true()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "some", "name"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:846:59 [INFO] [stdout] | [INFO] [stdout] 846 | expect!(DocPath::new_unwrap("$.name[*]").matches_path(&vec!["$", "name", "0"])).to(be_true()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "name", "0"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:847:64 [INFO] [stdout] | [INFO] [stdout] 847 | expect!(DocPath::new_unwrap("$.name[*].name").matches_path(&vec!["$", "name", "1", "name"])).to(be_true()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "name", "1", "name"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/path_exp.rs:848:54 [INFO] [stdout] | [INFO] [stdout] 848 | expect!(DocPath::new_unwrap("$[*]").matches_path(&vec!["$", "name"])).to(be_false()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: you can use a slice directly: `&["$", "name"]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/iterator_utils.rs:45:43 [INFO] [stdout] | [INFO] [stdout] 45 | expect!(CartesianProductIterator::new(&vec![1], &Vec::::new()).next()).to(be_none()); [INFO] [stdout] | ^^^^^^^^ help: you can use a slice directly: `&[1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `vec!` [INFO] [stdout] --> src/iterator_utils.rs:46:65 [INFO] [stdout] | [INFO] [stdout] 46 | expect!(CartesianProductIterator::new(&Vec::::new(), &vec![1]).next()).to(be_none()); [INFO] [stdout] | ^^^^^^^^ help: you can use a slice directly: `&[1]` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 05s [INFO] [stderr] warning: the following packages contain code that will be rejected by a future version of Rust: syn v0.14.9 [INFO] [stderr] note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 1` [INFO] running `Command { std: "docker" "inspect" "637203b3321da66a231db49aae1c4f3ba31ee90d2aac3a20cc2915dd5adc760d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "637203b3321da66a231db49aae1c4f3ba31ee90d2aac3a20cc2915dd5adc760d", kill_on_drop: false }` [INFO] [stdout] 637203b3321da66a231db49aae1c4f3ba31ee90d2aac3a20cc2915dd5adc760d