[INFO] fetching crate elm-parser 4.0.11... [INFO] linting elm-parser-4.0.11 against nightly for clippy-nonminimal_bool-denied [INFO] extracting crate elm-parser 4.0.11 into /workspace/builds/worker-1-tc1/source [INFO] started tweaking crates.io crate elm-parser 4.0.11 [INFO] finished tweaking crates.io crate elm-parser 4.0.11 [INFO] tweaked toml for crates.io crate elm-parser 4.0.11 written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of crates.io crate elm-parser 4.0.11 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 elm-parser 4.0.11 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] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded typed-builder v0.18.2 [INFO] [stderr] Downloaded quote-use-macros v0.8.4 [INFO] [stderr] Downloaded cps v0.2.3 [INFO] [stderr] Downloaded litrs v0.2.3 [INFO] [stderr] Downloaded derive-where v1.2.5 [INFO] [stderr] Downloaded config v0.14.0 [INFO] [stderr] Downloaded serde_qs v0.12.0 [INFO] [stderr] Downloaded leptos_macro v0.6.15 [INFO] [stderr] Downloaded hashbrown v0.14.1 [INFO] [stderr] Downloaded leptos_reactive v0.6.15 [INFO] [stderr] Downloaded const_format v0.2.31 [INFO] [stderr] Downloaded indexmap v2.0.2 [INFO] [stderr] Downloaded regex v1.10.0 [INFO] [stderr] Downloaded regex-syntax v0.8.1 [INFO] [stderr] Downloaded ciborium v0.2.1 [INFO] [stderr] Downloaded idna v0.4.0 [INFO] [stderr] Downloaded url v2.4.1 [INFO] [stderr] Downloaded self_cell v1.0.1 [INFO] [stderr] Downloaded const_format_proc_macros v0.2.31 [INFO] [stderr] Downloaded pad-adapter v0.1.1 [INFO] [stderr] Downloaded leptos_dom v0.6.15 [INFO] [stderr] Downloaded manyhow v0.10.4 [INFO] [stderr] Downloaded leptos_hot_reload v0.6.15 [INFO] [stderr] Downloaded regex-automata v0.4.1 [INFO] [stderr] Downloaded yansi v1.0.0-rc.1 [INFO] [stderr] Downloaded rstml v0.11.2 [INFO] [stderr] Downloaded ciborium-ll v0.2.1 [INFO] [stderr] Downloaded gloo-utils v0.2.0 [INFO] [stderr] Downloaded gloo-net v0.6.0 [INFO] [stderr] Downloaded server_fn v0.6.15 [INFO] [stderr] Downloaded leptos_config v0.6.15 [INFO] [stderr] Downloaded drain_filter_polyfill v0.1.3 [INFO] [stderr] Downloaded inventory v0.3.12 [INFO] [stderr] Downloaded attribute-derive-macro v0.9.2 [INFO] [stderr] Downloaded manyhow-macros v0.10.4 [INFO] [stderr] Downloaded attribute-derive v0.9.2 [INFO] [stderr] Downloaded oco_ref v0.1.1 [INFO] [stderr] Downloaded leptos_server v0.6.15 [INFO] [stderr] Downloaded ciborium-io v0.2.1 [INFO] [stderr] Downloaded server_fn_macro v0.6.15 [INFO] [stderr] Downloaded server_fn_macro_default v0.6.15 [INFO] [stderr] Downloaded typed-builder-macro v0.18.2 [INFO] [stderr] Downloaded quote-use v0.8.4 [INFO] [stderr] Downloaded xxhash-rust v0.8.7 [INFO] [stderr] Downloaded leptos v0.6.15 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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] e9d224af12b240acecf5db57524a0c960af7a5fc18b5d16c276122d79a09aec7 [INFO] running `Command { std: "docker" "start" "-a" "e9d224af12b240acecf5db57524a0c960af7a5fc18b5d16c276122d79a09aec7", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "e9d224af12b240acecf5db57524a0c960af7a5fc18b5d16c276122d79a09aec7", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "e9d224af12b240acecf5db57524a0c960af7a5fc18b5d16c276122d79a09aec7", kill_on_drop: false }` [INFO] [stdout] e9d224af12b240acecf5db57524a0c960af7a5fc18b5d16c276122d79a09aec7 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-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] dcf4e484216974171e6d464fa14468c3a253ab2dc0010db85604bd047610f265 [INFO] running `Command { std: "docker" "start" "-a" "dcf4e484216974171e6d464fa14468c3a253ab2dc0010db85604bd047610f265", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.79 [INFO] [stderr] Compiling serde v1.0.197 [INFO] [stderr] Compiling wasm-bindgen-shared v0.2.95 [INFO] [stderr] Compiling bumpalo v3.14.0 [INFO] [stderr] Compiling log v0.4.20 [INFO] [stderr] Compiling thiserror v1.0.49 [INFO] [stderr] Compiling wasm-bindgen v0.2.95 [INFO] [stderr] Compiling smallvec v1.11.1 [INFO] [stderr] Compiling futures-channel v0.3.28 [INFO] [stderr] Compiling ppv-lite86 v0.2.17 [INFO] [stderr] Compiling libc v0.2.149 [INFO] [stderr] Checking hashbrown v0.14.1 [INFO] [stderr] Compiling phf_shared v0.10.0 [INFO] [stderr] Compiling unicode-xid v0.2.4 [INFO] [stderr] Compiling futures-util v0.3.28 [INFO] [stderr] Compiling serde_json v1.0.114 [INFO] [stderr] Compiling proc-macro-error v1.0.4 [INFO] [stderr] Compiling unicode-segmentation v1.10.1 [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Checking siphasher v0.3.11 [INFO] [stderr] Checking indexmap v2.0.2 [INFO] [stderr] Compiling proc-macro2-diagnostics v0.10.1 [INFO] [stderr] Checking parking_lot_core v0.9.8 [INFO] [stderr] Checking percent-encoding v2.3.0 [INFO] [stderr] Compiling xxhash-rust v0.8.7 [INFO] [stderr] Compiling getrandom v0.2.10 [INFO] [stderr] Compiling slotmap v1.0.6 [INFO] [stderr] Checking half v1.8.2 [INFO] [stderr] Checking ciborium-io v0.2.1 [INFO] [stderr] Checking bytes v1.5.0 [INFO] [stderr] Compiling rand_core v0.6.4 [INFO] [stderr] Compiling camino v1.1.6 [INFO] [stderr] Compiling anyhow v1.0.75 [INFO] [stderr] Compiling yansi v1.0.0-rc.1 [INFO] [stderr] Compiling paste v1.0.14 [INFO] [stderr] Compiling lock_api v0.4.10 [INFO] [stderr] Checking parking_lot v0.12.1 [INFO] [stderr] Checking idna v0.4.0 [INFO] [stderr] Checking ciborium-ll v0.2.1 [INFO] [stderr] Checking phf v0.10.1 [INFO] [stderr] Checking form_urlencoded v1.2.0 [INFO] [stderr] Checking tracing-core v0.1.31 [INFO] [stderr] Checking winnow v0.6.20 [INFO] [stderr] Compiling collection_literals v1.0.1 [INFO] [stderr] Checking http v1.1.0 [INFO] [stderr] Compiling prettyplease v0.2.15 [INFO] [stderr] Compiling interpolator v0.5.0 [INFO] [stderr] Compiling rand_chacha v0.3.1 [INFO] [stderr] Compiling convert_case v0.6.0 [INFO] [stderr] Compiling walkdir v2.4.0 [INFO] [stderr] Checking dashmap v5.5.3 [INFO] [stderr] Checking send_wrapper v0.6.0 [INFO] [stderr] Compiling rand v0.8.5 [INFO] [stderr] Checking url v2.4.1 [INFO] [stderr] Compiling pin-project-lite v0.2.13 [INFO] [stderr] Compiling utf8-width v0.1.6 [INFO] [stderr] Compiling quote v1.0.35 [INFO] [stderr] Checking regex-syntax v0.8.1 [INFO] [stderr] Checking self_cell v1.0.1 [INFO] [stderr] Compiling either v1.9.0 [INFO] [stderr] Checking nom v7.1.3 [INFO] [stderr] Compiling html-escape v0.2.13 [INFO] [stderr] Compiling uuid v1.4.1 [INFO] [stderr] Checking pathdiff v0.2.1 [INFO] [stderr] Compiling syn v2.0.53 [INFO] [stderr] Compiling proc-macro-utils v0.8.0 [INFO] [stderr] Compiling proc-macro-utils v0.10.0 [INFO] [stderr] Checking itertools v0.12.1 [INFO] [stderr] Compiling const_format_proc_macros v0.2.31 [INFO] [stderr] Compiling proc-macro-error-attr v1.0.4 [INFO] [stderr] Compiling proc-macro-error-attr2 v2.0.0 [INFO] [stderr] Compiling phf_generator v0.10.0 [INFO] [stderr] Compiling string_cache_codegen v0.5.2 [INFO] [stderr] Compiling phf_codegen v0.10.0 [INFO] [stderr] Compiling manyhow-macros v0.10.4 [INFO] [stderr] Compiling proc-macro-error2 v2.0.1 [INFO] [stderr] Checking inventory v0.3.12 [INFO] [stderr] Checking pad-adapter v0.1.1 [INFO] [stderr] Checking drain_filter_polyfill v0.1.3 [INFO] [stderr] Compiling litrs v0.2.3 [INFO] [stderr] Checking numerals v0.1.4 [INFO] [stderr] Compiling markup5ever v0.11.0 [INFO] [stderr] Compiling const_format v0.2.31 [INFO] [stderr] Checking regex-automata v0.4.1 [INFO] [stderr] Compiling wasm-bindgen-backend v0.2.95 [INFO] [stderr] Compiling server_fn_macro v0.6.15 [INFO] [stderr] Compiling manyhow v0.10.4 [INFO] [stderr] Checking regex v1.10.0 [INFO] [stderr] Compiling serde_derive v1.0.197 [INFO] [stderr] Compiling thiserror-impl v1.0.49 [INFO] [stderr] Compiling futures-macro v0.3.28 [INFO] [stderr] Compiling tracing-attributes v0.1.26 [INFO] [stderr] Compiling pin-project-internal v1.1.3 [INFO] [stderr] Compiling quote-use-macros v0.8.4 [INFO] [stderr] Compiling syn_derive v0.1.8 [INFO] [stderr] Compiling server_fn_macro_default v0.6.15 [INFO] [stderr] Compiling derive-where v1.2.5 [INFO] [stderr] Compiling typed-builder-macro v0.18.2 [INFO] [stderr] Compiling async-recursion v1.0.5 [INFO] [stderr] Compiling html5ever v0.26.0 [INFO] [stderr] Compiling cps v0.2.3 [INFO] [stderr] Compiling quote-use v0.8.4 [INFO] [stderr] Compiling attribute-derive-macro v0.9.2 [INFO] [stderr] Compiling rstml v0.11.2 [INFO] [stderr] Checking typed-builder v0.18.2 [INFO] [stderr] Checking tracing v0.1.37 [INFO] [stderr] Checking pin-project v1.1.3 [INFO] [stderr] Compiling wasm-bindgen-macro-support v0.2.95 [INFO] [stderr] Compiling attribute-derive v0.9.2 [INFO] [stderr] Compiling wasm-bindgen-macro v0.2.95 [INFO] [stderr] Checking js-sys v0.3.72 [INFO] [stderr] Checking futures-executor v0.3.28 [INFO] [stderr] Checking futures v0.3.28 [INFO] [stderr] Checking toml_datetime v0.6.8 [INFO] [stderr] Checking serde_spanned v0.6.8 [INFO] [stderr] Checking string_cache v0.8.7 [INFO] [stderr] Checking oco_ref v0.1.1 [INFO] [stderr] Checking serde_qs v0.12.0 [INFO] [stderr] Checking ciborium v0.2.1 [INFO] [stderr] Compiling leptos_hot_reload v0.6.15 [INFO] [stderr] Checking toml_edit v0.22.20 [INFO] [stderr] Compiling leptos_macro v0.6.15 [INFO] [stderr] Checking web-sys v0.3.72 [INFO] [stderr] Checking wasm-bindgen-futures v0.4.37 [INFO] [stderr] Checking serde-wasm-bindgen v0.6.5 [INFO] [stderr] Checking xml5ever v0.17.0 [INFO] [stderr] Checking markup5ever_rcdom v0.2.0 [INFO] [stderr] Checking select v0.6.0 [INFO] [stderr] Checking toml v0.8.19 [INFO] [stderr] Checking config v0.14.0 [INFO] [stderr] Checking leptos_config v0.6.15 [INFO] [stderr] Checking gloo-utils v0.2.0 [INFO] [stderr] Checking wasm-streams v0.4.1 [INFO] [stderr] Checking leptos_reactive v0.6.15 [INFO] [stderr] Checking gloo-net v0.6.0 [INFO] [stderr] Checking server_fn v0.6.15 [INFO] [stderr] Checking leptos_dom v0.6.15 [INFO] [stderr] Checking leptos_server v0.6.15 [INFO] [stderr] Checking leptos v0.6.15 [INFO] [stderr] Checking elm-parser v4.0.11 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused import: `nom::bytes::complete::tag` [INFO] [stdout] --> src/desugarer.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use nom::bytes::complete::tag; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `syn::ext` [INFO] [stdout] --> src/desugarer.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use syn::ext; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `CellTrait::Cell`, `Datacell::*`, and `ElementCell::*` [INFO] [stdout] --> src/element_text.rs:1:42 [INFO] [stdout] | [INFO] [stdout] 1 | use crate::datacell::{BlockChildType::*, CellTrait::Cell, Datacell::*, ElementCell::*}; [INFO] [stdout] | ^^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Emitter` [INFO] [stdout] --> src/helpers.rs:2:15 [INFO] [stdout] | [INFO] [stdout] 2 | emitter::{Emitter, TagInfo}, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `nom::bytes::complete::tag` [INFO] [stdout] --> src/desugarer.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use nom::bytes::complete::tag; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `syn::ext` [INFO] [stdout] --> src/desugarer.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use syn::ext; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `CellTrait::Cell`, `Datacell::*`, and `ElementCell::*` [INFO] [stdout] --> src/element_text.rs:1:42 [INFO] [stdout] | [INFO] [stdout] 1 | use crate::datacell::{BlockChildType::*, CellTrait::Cell, Datacell::*, ElementCell::*}; [INFO] [stdout] | ^^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Emitter` [INFO] [stdout] --> src/helpers.rs:2:15 [INFO] [stdout] | [INFO] [stdout] 2 | emitter::{Emitter, TagInfo}, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/desugarer.rs:309:21 [INFO] [stdout] | [INFO] [stdout] 309 | let mut no_wrap = false; [INFO] [stdout] | ----^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `no_wrap` [INFO] [stdout] --> src/desugarer.rs:309:21 [INFO] [stdout] | [INFO] [stdout] 309 | let mut no_wrap = false; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_no_wrap` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/desugarer.rs:309:21 [INFO] [stdout] | [INFO] [stdout] 309 | let mut no_wrap = false; [INFO] [stdout] | ----^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `no_wrap` [INFO] [stdout] --> src/desugarer.rs:309:21 [INFO] [stdout] | [INFO] [stdout] 309 | let mut no_wrap = false; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_no_wrap` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `found_symbol` is never read [INFO] [stdout] --> src/element_text.rs:298:32 [INFO] [stdout] | [INFO] [stdout] 298 | let mut found_symbol = ""; [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `found_symbol` is never read [INFO] [stdout] --> src/element_text.rs:298:32 [INFO] [stdout] | [INFO] [stdout] 298 | let mut found_symbol = ""; [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `is_nested` is never read [INFO] [stdout] --> src/parser.rs:73:13 [INFO] [stdout] | [INFO] [stdout] 73 | is_nested = &false; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding [INFO] [stdout] | [INFO] [stdout] 63 ~ is_nested: &mut bool, [INFO] [stdout] 64 | tag_stack: &mut Vec, [INFO] [stdout] ... [INFO] [stdout] 72 | } else if *is_nested { [INFO] [stdout] 73 ~ *is_nested = false; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `is_nested` is never read [INFO] [stdout] --> src/parser.rs:73:13 [INFO] [stdout] | [INFO] [stdout] 73 | is_nested = &false; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding [INFO] [stdout] | [INFO] [stdout] 63 ~ is_nested: &mut bool, [INFO] [stdout] 64 | tag_stack: &mut Vec, [INFO] [stdout] ... [INFO] [stdout] 72 | } else if *is_nested { [INFO] [stdout] 73 ~ *is_nested = false; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `to_tag_name` is never used [INFO] [stdout] --> src/counter/counter_commands.rs:37:8 [INFO] [stdout] | [INFO] [stdout] 16 | impl CommandType { [INFO] [stdout] | ---------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 37 | fn to_tag_name(&self) -> String { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `to_tag_name` is never used [INFO] [stdout] --> src/counter/counter_commands.rs:37:8 [INFO] [stdout] | [INFO] [stdout] 16 | impl CommandType { [INFO] [stdout] | ---------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 37 | fn to_tag_name(&self) -> String { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/counter/counter_commands.rs:20:26 [INFO] [stdout] | [INFO] [stdout] 20 | sub_string = &string[2..]; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/counter/counter_commands.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | if string.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] 19 ~ if let Some() = string.strip_prefix("<<") { [INFO] [stdout] 20 ~ sub_string = ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/counter/counter_commands.rs:20:26 [INFO] [stdout] | [INFO] [stdout] 20 | sub_string = &string[2..]; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/counter/counter_commands.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | if string.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] 19 ~ if let Some() = string.strip_prefix("<<") { [INFO] [stdout] 20 ~ sub_string = ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/counter/counter_commands.rs:146:33 [INFO] [stdout] | [INFO] [stdout] 146 | string.push_str(&mat.as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `mat.as_str()` [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/counter/counter_commands.rs:146:33 [INFO] [stdout] | [INFO] [stdout] 146 | string.push_str(&mat.as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `mat.as_str()` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> src/counter/counter_commands.rs:175:9 [INFO] [stdout] | [INFO] [stdout] 173 | let json_str = self.replace_counters(&mut json, true); [INFO] [stdout] | ------------------------------------------------------ unnecessary `let` binding [INFO] [stdout] 174 | [INFO] [stdout] 175 | json_str [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] 173 ~ [INFO] [stdout] 174 | [INFO] [stdout] 175 ~ self.replace_counters(&mut json, true) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/counter/counter_commands.rs:175:9 [INFO] [stdout] | [INFO] [stdout] 173 | let json_str = self.replace_counters(&mut json, true); [INFO] [stdout] | ------------------------------------------------------ unnecessary `let` binding [INFO] [stdout] 174 | [INFO] [stdout] 175 | json_str [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] 173 ~ [INFO] [stdout] 174 | [INFO] [stdout] 175 ~ self.replace_counters(&mut json, true) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/counter/counter_commands.rs:183:17 [INFO] [stdout] | [INFO] [stdout] 183 | / if (block.has_counter_commands && !handle_insert_command) [INFO] [stdout] 184 | | || (block.has_handle_insert && handle_insert_command) [INFO] [stdout] 185 | | { [INFO] [stdout] 186 | | block.children.iter_mut().for_each(|child| { [INFO] [stdout] 187 | | self.handle_block_child(child, &cloned_cell, handle_insert_command) [INFO] [stdout] 188 | | }); [INFO] [stdout] 189 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 182 ~ CellType::Block(block) [INFO] [stdout] 183 ~ if ((block.has_counter_commands && !handle_insert_command) [INFO] [stdout] 184 ~ || (block.has_handle_insert && handle_insert_command)) [INFO] [stdout] 185 ~ => { [INFO] [stdout] 186 | block.children.iter_mut().for_each(|child| { [INFO] [stdout] 187 | self.handle_block_child(child, &cloned_cell, handle_insert_command) [INFO] [stdout] 188 | }); [INFO] [stdout] 189 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/counter/counter_commands.rs:183:17 [INFO] [stdout] | [INFO] [stdout] 183 | / if (block.has_counter_commands && !handle_insert_command) [INFO] [stdout] 184 | | || (block.has_handle_insert && handle_insert_command) [INFO] [stdout] 185 | | { [INFO] [stdout] 186 | | block.children.iter_mut().for_each(|child| { [INFO] [stdout] 187 | | self.handle_block_child(child, &cloned_cell, handle_insert_command) [INFO] [stdout] 188 | | }); [INFO] [stdout] 189 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 182 ~ CellType::Block(block) [INFO] [stdout] 183 ~ if ((block.has_counter_commands && !handle_insert_command) [INFO] [stdout] 184 ~ || (block.has_handle_insert && handle_insert_command)) [INFO] [stdout] 185 ~ => { [INFO] [stdout] 186 | block.children.iter_mut().for_each(|child| { [INFO] [stdout] 187 | self.handle_block_child(child, &cloned_cell, handle_insert_command) [INFO] [stdout] 188 | }); [INFO] [stdout] 189 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `execution` after checking its variant with `is_some` [INFO] [stdout] --> src/counter/counter_commands.rs:250:39 [INFO] [stdout] | [INFO] [stdout] 246 | if execution.is_some() { [INFO] [stdout] | ---------------------- help: try: `if let Some() = execution` [INFO] [stdout] ... [INFO] [stdout] 250 | res.push_str(&execution.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/counter/counter_commands.rs:228:38 [INFO] [stdout] | [INFO] [stdout] 228 | let splits = self.split_line(&text, false); [INFO] [stdout] | ^^^^^ help: change this to: `text` [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/counter/counter_commands.rs:235:21 [INFO] [stdout] | [INFO] [stdout] 235 | &cell, [INFO] [stdout] | ^^^^^ help: change this to: `cell` [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 `unwrap` on `execution` after checking its variant with `is_some` [INFO] [stdout] --> src/counter/counter_commands.rs:250:39 [INFO] [stdout] | [INFO] [stdout] 246 | if execution.is_some() { [INFO] [stdout] | ---------------------- help: try: `if let Some() = execution` [INFO] [stdout] ... [INFO] [stdout] 250 | res.push_str(&execution.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/counter/counter_commands.rs:228:38 [INFO] [stdout] | [INFO] [stdout] 228 | let splits = self.split_line(&text, false); [INFO] [stdout] | ^^^^^ help: change this to: `text` [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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/counter/counter_commands.rs:248:29 [INFO] [stdout] | [INFO] [stdout] 248 | ... res.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `res.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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/counter/counter_commands.rs:235:21 [INFO] [stdout] | [INFO] [stdout] 235 | &cell, [INFO] [stdout] | ^^^^^ help: change this to: `cell` [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 `unwrap` on `handle` after checking its variant with `is_some` [INFO] [stdout] --> src/counter/counter_commands.rs:273:35 [INFO] [stdout] | [INFO] [stdout] 272 | if handle.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = handle` [INFO] [stdout] 273 | res.push_str(&handle.unwrap().value); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/counter/counter_commands.rs:262:38 [INFO] [stdout] | [INFO] [stdout] 262 | let splits = self.split_line(&text, true); [INFO] [stdout] | ^^^^^ help: change this to: `text` [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: taken reference of right operand [INFO] [stdout] --> src/counter/counter_commands.rs:271:31 [INFO] [stdout] | [INFO] [stdout] 271 | .find(|h| h.name == &split.content[2..]); [INFO] [stdout] | ^^^^^^^^^^------------------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `split.content[2..]` [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] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/counter/counter_commands.rs:248:29 [INFO] [stdout] | [INFO] [stdout] 248 | ... res.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `res.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: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/counter/counter_instance.rs:35:42 [INFO] [stdout] | [INFO] [stdout] 35 | ... Roman::parse(&roman).expect("unvalid roman chars").value(); [INFO] [stdout] | ^^^^^^ help: change this to: `roman` [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/counter/counter_instance.rs:58:61 [INFO] [stdout] | [INFO] [stdout] 58 | if let Some(paresed) = Roman::parse(&roman) { [INFO] [stdout] | ^^^^^^ help: change this to: `roman` [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 `unwrap` on `handle` after checking its variant with `is_some` [INFO] [stdout] --> src/counter/counter_commands.rs:273:35 [INFO] [stdout] | [INFO] [stdout] 272 | if handle.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = handle` [INFO] [stdout] 273 | res.push_str(&handle.unwrap().value); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str` [INFO] [stdout] --> src/counter/counter_types.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | / pub fn from_str(string: &str) -> Option { [INFO] [stdout] 23 | | match string { [INFO] [stdout] 24 | | "counter" => Some(Self::ARABIC), [INFO] [stdout] 25 | | "roman_counter" => Some(Self::ROMAN), [INFO] [stdout] ... | [INFO] [stdout] 29 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::str::FromStr` 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: implementation of inherent method `to_string(&self) -> String` for type `counter::counter_types::CounterValueType` [INFO] [stdout] --> src/counter/counter_types.rs:108:5 [INFO] [stdout] | [INFO] [stdout] 108 | / pub fn to_string(&self) -> String { [INFO] [stdout] 109 | | match self { [INFO] [stdout] 110 | | CounterValueType::ARABIC(number) => { [INFO] [stdout] 111 | | if *number < 0 { [INFO] [stdout] ... | [INFO] [stdout] 120 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `counter::counter_types::CounterValueType` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] = note: `#[warn(clippy::inherent_to_string)]` 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/counter/counter_commands.rs:262:38 [INFO] [stdout] | [INFO] [stdout] 262 | let splits = self.split_line(&text, true); [INFO] [stdout] | ^^^^^ help: change this to: `text` [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 should consider adding a `Default` implementation for `Counters` [INFO] [stdout] --> src/counter/counters.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | / pub fn new() -> Counters { [INFO] [stdout] 19 | | Counters { [INFO] [stdout] 20 | | counters_list: Vec::new(), [INFO] [stdout] 21 | | handles_list: Vec::new(), [INFO] [stdout] 22 | | } [INFO] [stdout] 23 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 17 + impl Default for Counters { [INFO] [stdout] 18 + fn default() -> Self { [INFO] [stdout] 19 + Self::new() [INFO] [stdout] 20 + } [INFO] [stdout] 21 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/counter/counter_commands.rs:271:31 [INFO] [stdout] | [INFO] [stdout] 271 | .find(|h| h.name == &split.content[2..]); [INFO] [stdout] | ^^^^^^^^^^------------------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `split.content[2..]` [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] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/counter/counters.rs:25:54 [INFO] [stdout] | [INFO] [stdout] 25 | fn iter_props(&mut self, json: &DataCell, props: &Vec) { [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] 25 - fn iter_props(&mut self, json: &DataCell, props: &Vec) { [INFO] [stdout] 25 + fn iter_props(&mut self, json: &DataCell, props: &[Prop]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/counter/counters.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | !counter.is_none(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `counter.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/counter/counter_instance.rs:35:42 [INFO] [stdout] | [INFO] [stdout] 35 | ... Roman::parse(&roman).expect("unvalid roman chars").value(); [INFO] [stdout] | ^^^^^^ help: change this to: `roman` [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/counter/counter_instance.rs:58:61 [INFO] [stdout] | [INFO] [stdout] 58 | if let Some(paresed) = Roman::parse(&roman) { [INFO] [stdout] | ^^^^^^ help: change this to: `roman` [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: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str` [INFO] [stdout] --> src/counter/counter_types.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | / pub fn from_str(string: &str) -> Option { [INFO] [stdout] 23 | | match string { [INFO] [stdout] 24 | | "counter" => Some(Self::ARABIC), [INFO] [stdout] 25 | | "roman_counter" => Some(Self::ROMAN), [INFO] [stdout] ... | [INFO] [stdout] 29 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::str::FromStr` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/counter/counters.rs:122:13 [INFO] [stdout] | [INFO] [stdout] 122 | !counter.is_none(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `counter.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/counter/counters.rs:154:17 [INFO] [stdout] | [INFO] [stdout] 154 | return false; [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] 154 - return false; [INFO] [stdout] 154 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/counter/counters.rs:166:17 [INFO] [stdout] | [INFO] [stdout] 166 | return false; [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] 166 - return false; [INFO] [stdout] 166 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/counter/counters.rs:145:35 [INFO] [stdout] | [INFO] [stdout] 145 | parents_list.push(json_tree.id.try_into().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: useless conversion to the same type: `usize` [INFO] [stdout] --> src/counter/counters.rs:157:35 [INFO] [stdout] | [INFO] [stdout] 157 | parents_list.push(json_tree.id.try_into().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `counter::counter_types::CounterValueType` [INFO] [stdout] --> src/counter/counter_types.rs:108:5 [INFO] [stdout] | [INFO] [stdout] 108 | / pub fn to_string(&self) -> String { [INFO] [stdout] 109 | | match self { [INFO] [stdout] 110 | | CounterValueType::ARABIC(number) => { [INFO] [stdout] 111 | | if *number < 0 { [INFO] [stdout] ... | [INFO] [stdout] 120 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `counter::counter_types::CounterValueType` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] = note: `#[warn(clippy::inherent_to_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Counters` [INFO] [stdout] --> src/counter/counters.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | / pub fn new() -> Counters { [INFO] [stdout] 19 | | Counters { [INFO] [stdout] 20 | | counters_list: Vec::new(), [INFO] [stdout] 21 | | handles_list: Vec::new(), [INFO] [stdout] 22 | | } [INFO] [stdout] 23 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 17 + impl Default for Counters { [INFO] [stdout] 18 + fn default() -> Self { [INFO] [stdout] 19 + Self::new() [INFO] [stdout] 20 + } [INFO] [stdout] 21 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/counter/counters.rs:25:54 [INFO] [stdout] | [INFO] [stdout] 25 | fn iter_props(&mut self, json: &DataCell, props: &Vec) { [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] 25 - fn iter_props(&mut self, json: &DataCell, props: &Vec) { [INFO] [stdout] 25 + fn iter_props(&mut self, json: &DataCell, props: &[Prop]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/counter/counters.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | !counter.is_none(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `counter.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/datacell/BlockCell.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | / match parent.cell_type { [INFO] [stdout] 33 | | CellType::Element(ref mut el) => { [INFO] [stdout] 34 | | el.children.insert(0, Self::init_cell(id, parent.id, block)) [INFO] [stdout] ... | [INFO] [stdout] 37 | | } [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] 32 ~ if let CellType::Element(ref mut el) = parent.cell_type { [INFO] [stdout] 33 + el.children.insert(0, Self::init_cell(id, parent.id, block)) [INFO] [stdout] 34 + } [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/datacell/BlockCell.rs:75:9 [INFO] [stdout] | [INFO] [stdout] 75 | / match parent.cell_type { [INFO] [stdout] 76 | | CellType::Element(ref mut el) => { [INFO] [stdout] 77 | | el.children.push(Self::init_cell(id, parent.id, block)) [INFO] [stdout] ... | [INFO] [stdout] 80 | | } [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] 75 ~ if let CellType::Element(ref mut el) = parent.cell_type { [INFO] [stdout] 76 + el.children.push(Self::init_cell(id, parent.id, block)) [INFO] [stdout] 77 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/counter/counters.rs:122:13 [INFO] [stdout] | [INFO] [stdout] 122 | !counter.is_none(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `counter.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/counter/counters.rs:154:17 [INFO] [stdout] | [INFO] [stdout] 154 | return false; [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] 154 - return false; [INFO] [stdout] 154 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/counter/counters.rs:166:17 [INFO] [stdout] | [INFO] [stdout] 166 | return false; [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] 166 - return false; [INFO] [stdout] 166 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/counter/counters.rs:145:35 [INFO] [stdout] | [INFO] [stdout] 145 | parents_list.push(json_tree.id.try_into().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: useless conversion to the same type: `usize` [INFO] [stdout] --> src/counter/counters.rs:157:35 [INFO] [stdout] | [INFO] [stdout] 157 | parents_list.push(json_tree.id.try_into().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [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/datacell/BlockCell.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | / match parent.cell_type { [INFO] [stdout] 33 | | CellType::Element(ref mut el) => { [INFO] [stdout] 34 | | el.children.insert(0, Self::init_cell(id, parent.id, block)) [INFO] [stdout] ... | [INFO] [stdout] 37 | | } [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] 32 ~ if let CellType::Element(ref mut el) = parent.cell_type { [INFO] [stdout] 33 + el.children.insert(0, Self::init_cell(id, parent.id, block)) [INFO] [stdout] 34 + } [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/datacell/BlockCell.rs:75:9 [INFO] [stdout] | [INFO] [stdout] 75 | / match parent.cell_type { [INFO] [stdout] 76 | | CellType::Element(ref mut el) => { [INFO] [stdout] 77 | | el.children.push(Self::init_cell(id, parent.id, block)) [INFO] [stdout] ... | [INFO] [stdout] 80 | | } [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] 75 ~ if let CellType::Element(ref mut el) = parent.cell_type { [INFO] [stdout] 76 + el.children.push(Self::init_cell(id, parent.id, block)) [INFO] [stdout] 77 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/datacell/Datacell.rs:98:17 [INFO] [stdout] | [INFO] [stdout] 98 | / if let Some(child) = Self::get_cell_by_id(x, id) { [INFO] [stdout] 99 | | Some(child) [INFO] [stdout] 100 | | } else { [INFO] [stdout] 101 | | None [INFO] [stdout] 102 | | } [INFO] [stdout] | |_________________^ help: try: `Self::get_cell_by_id(x, id).map(|child| child)` [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: manual implementation of `Option::map` [INFO] [stdout] --> src/datacell/Datacell.rs:107:21 [INFO] [stdout] | [INFO] [stdout] 107 | / if let Some(child) = Self::get_cell_by_id(x, id) { [INFO] [stdout] 108 | | Some(child) [INFO] [stdout] 109 | | } else { [INFO] [stdout] 110 | | None [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________________^ help: try: `Self::get_cell_by_id(x, id).map(|child| child)` [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: this if-let expression is unnecessary [INFO] [stdout] --> src/datacell/Datacell.rs:107:21 [INFO] [stdout] | [INFO] [stdout] 107 | / if let Some(child) = Self::get_cell_by_id(x, id) { [INFO] [stdout] 108 | | Some(child) [INFO] [stdout] 109 | | } else { [INFO] [stdout] 110 | | None [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________________^ help: replace it with: `Self::get_cell_by_id(x, id)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_match [INFO] [stdout] = note: `#[warn(clippy::needless_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/datacell/Datacell.rs:126:17 [INFO] [stdout] | [INFO] [stdout] 126 | / if let Some(child) = Self::get_cell_by_id_immut(x, id) { [INFO] [stdout] 127 | | Some(child) [INFO] [stdout] 128 | | } else { [INFO] [stdout] 129 | | None [INFO] [stdout] 130 | | } [INFO] [stdout] | |_________________^ help: try: `Self::get_cell_by_id_immut(x, id).map(|child| child)` [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: manual implementation of `Option::map` [INFO] [stdout] --> src/datacell/Datacell.rs:135:21 [INFO] [stdout] | [INFO] [stdout] 135 | / if let Some(child) = Self::get_cell_by_id_immut(x, id) { [INFO] [stdout] 136 | | Some(child) [INFO] [stdout] 137 | | } else { [INFO] [stdout] 138 | | None [INFO] [stdout] 139 | | } [INFO] [stdout] | |_____________________^ help: try: `Self::get_cell_by_id_immut(x, id).map(|child| child)` [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: this if-let expression is unnecessary [INFO] [stdout] --> src/datacell/Datacell.rs:135:21 [INFO] [stdout] | [INFO] [stdout] 135 | / if let Some(child) = Self::get_cell_by_id_immut(x, id) { [INFO] [stdout] 136 | | Some(child) [INFO] [stdout] 137 | | } else { [INFO] [stdout] 138 | | None [INFO] [stdout] 139 | | } [INFO] [stdout] | |_____________________^ help: replace it with: `Self::get_cell_by_id_immut(x, id)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/datacell/Datacell.rs:158:24 [INFO] [stdout] | [INFO] [stdout] 158 | return parent.children.iter().nth(index - 1).cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] = note: `#[warn(clippy::iter_nth)]` on by default [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 158 - return parent.children.iter().nth(index - 1).cloned(); [INFO] [stdout] 158 + return parent.children.get(index - 1).cloned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/datacell/Datacell.rs:168:20 [INFO] [stdout] | [INFO] [stdout] 168 | return parent.children.iter().nth(index + 1).cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 168 - return parent.children.iter().nth(index + 1).cloned(); [INFO] [stdout] 168 + return parent.children.get(index + 1).cloned(); [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/datacell/ElementCell.rs:41:13 [INFO] [stdout] | [INFO] [stdout] 41 | / match &mut tree.cell_type { [INFO] [stdout] 42 | | CellType::Element(ref mut el) => el.push_attribute(prop_line), [INFO] [stdout] 43 | | _ => (), [INFO] [stdout] 44 | | } [INFO] [stdout] | |_____________^ help: try: `if let CellType::Element(ref mut el) = &mut tree.cell_type { el.push_attribute(prop_line) }` [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/desugarer.rs:114:25 [INFO] [stdout] | [INFO] [stdout] 114 | &article_types, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `article_types` [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/desugarer.rs:119:83 [INFO] [stdout] | [INFO] [stdout] 119 | self.find_cell_and_mark_article(child, tag_names, cells, article, &article_types) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `article_types` [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: manual implementation of `Option::map` [INFO] [stdout] --> src/datacell/Datacell.rs:98:17 [INFO] [stdout] | [INFO] [stdout] 98 | / if let Some(child) = Self::get_cell_by_id(x, id) { [INFO] [stdout] 99 | | Some(child) [INFO] [stdout] 100 | | } else { [INFO] [stdout] 101 | | None [INFO] [stdout] 102 | | } [INFO] [stdout] | |_________________^ help: try: `Self::get_cell_by_id(x, id).map(|child| child)` [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: manual implementation of `Option::map` [INFO] [stdout] --> src/datacell/Datacell.rs:107:21 [INFO] [stdout] | [INFO] [stdout] 107 | / if let Some(child) = Self::get_cell_by_id(x, id) { [INFO] [stdout] 108 | | Some(child) [INFO] [stdout] 109 | | } else { [INFO] [stdout] 110 | | None [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________________^ help: try: `Self::get_cell_by_id(x, id).map(|child| child)` [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: this if-let expression is unnecessary [INFO] [stdout] --> src/datacell/Datacell.rs:107:21 [INFO] [stdout] | [INFO] [stdout] 107 | / if let Some(child) = Self::get_cell_by_id(x, id) { [INFO] [stdout] 108 | | Some(child) [INFO] [stdout] 109 | | } else { [INFO] [stdout] 110 | | None [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________________^ help: replace it with: `Self::get_cell_by_id(x, id)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_match [INFO] [stdout] = note: `#[warn(clippy::needless_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/datacell/Datacell.rs:126:17 [INFO] [stdout] | [INFO] [stdout] 126 | / if let Some(child) = Self::get_cell_by_id_immut(x, id) { [INFO] [stdout] 127 | | Some(child) [INFO] [stdout] 128 | | } else { [INFO] [stdout] 129 | | None [INFO] [stdout] 130 | | } [INFO] [stdout] | |_________________^ help: try: `Self::get_cell_by_id_immut(x, id).map(|child| child)` [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: called `unwrap` on `handle` after checking its variant with `is_some` [INFO] [stdout] --> src/desugarer.rs:228:25 [INFO] [stdout] | [INFO] [stdout] 227 | if handle.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = handle` [INFO] [stdout] 228 | handle.unwrap().value.to_owned() + "<<" [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/datacell/Datacell.rs:135:21 [INFO] [stdout] | [INFO] [stdout] 135 | / if let Some(child) = Self::get_cell_by_id_immut(x, id) { [INFO] [stdout] 136 | | Some(child) [INFO] [stdout] 137 | | } else { [INFO] [stdout] 138 | | None [INFO] [stdout] 139 | | } [INFO] [stdout] | |_____________________^ help: try: `Self::get_cell_by_id_immut(x, id).map(|child| child)` [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: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/desugarer.rs:212:70 [INFO] [stdout] | [INFO] [stdout] 212 | for (_, (article_id, element)) in elements.clone().iter_mut().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 212 - for (_, (article_id, element)) in elements.clone().iter_mut().enumerate() { [INFO] [stdout] 212 + for (article_id, element) in elements.clone().iter_mut() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this if-let expression is unnecessary [INFO] [stdout] --> src/datacell/Datacell.rs:135:21 [INFO] [stdout] | [INFO] [stdout] 135 | / if let Some(child) = Self::get_cell_by_id_immut(x, id) { [INFO] [stdout] 136 | | Some(child) [INFO] [stdout] 137 | | } else { [INFO] [stdout] 138 | | None [INFO] [stdout] 139 | | } [INFO] [stdout] | |_____________________^ help: replace it with: `Self::get_cell_by_id_immut(x, id)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/datacell/Datacell.rs:158:24 [INFO] [stdout] | [INFO] [stdout] 158 | return parent.children.iter().nth(index - 1).cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] = note: `#[warn(clippy::iter_nth)]` on by default [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 158 - return parent.children.iter().nth(index - 1).cloned(); [INFO] [stdout] 158 + return parent.children.get(index - 1).cloned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/desugarer.rs:265:26 [INFO] [stdout] | [INFO] [stdout] 265 | pub fn wrap_children<'a>( [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: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/datacell/Datacell.rs:168:20 [INFO] [stdout] | [INFO] [stdout] 168 | return parent.children.iter().nth(index + 1).cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 168 - return parent.children.iter().nth(index + 1).cloned(); [INFO] [stdout] 168 + return parent.children.get(index + 1).cloned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/desugarer.rs:305:104 [INFO] [stdout] | [INFO] [stdout] 305 | fn wrap_element_children(&mut self, root: &mut DataCell, el: &T, ignore_elements: &Vec, wrap_wi... [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] 305 - fn wrap_element_children(&mut self, root: &mut DataCell, el: &T, ignore_elements: &Vec, wrap_with: &str) { [INFO] [stdout] 305 + fn wrap_element_children(&mut self, root: &mut DataCell, el: &T, ignore_elements: &[IgnoreOptions], wrap_with: &str) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/desugarer.rs:411:27 [INFO] [stdout] | [INFO] [stdout] 411 | pub fn wrap_recursive<'a>(&self, root: &'a mut DataCell, wrap_with: &str) -> Desugarer { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 411 - pub fn wrap_recursive<'a>(&self, root: &'a mut DataCell, wrap_with: &str) -> Desugarer { [INFO] [stdout] 411 + pub fn wrap_recursive(&self, root: &mut DataCell, wrap_with: &str) -> Desugarer { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/desugarer.rs:457:52 [INFO] [stdout] | [INFO] [stdout] 457 | if Self::paragraph_first_child_is_text(&element) [INFO] [stdout] | ^^^^^^^^ help: change this to: `element` [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/desugarer.rs:524:36 [INFO] [stdout] | [INFO] [stdout] 524 | prev_el = Some(&child) [INFO] [stdout] | ^^^^^^ help: change this to: `child` [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 use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/desugarer.rs:560:45 [INFO] [stdout] | [INFO] [stdout] 560 | for (_, element) in _elements.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 560 - for (_, element) in _elements.iter().enumerate() { [INFO] [stdout] 560 + for element in _elements.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/element_text.rs:22:1 [INFO] [stdout] | [INFO] [stdout] 22 | / impl Default for DelimeterRules { [INFO] [stdout] 23 | | fn default() -> Self { [INFO] [stdout] 24 | | Self { [INFO] [stdout] 25 | | symbol: "", [INFO] [stdout] ... | [INFO] [stdout] 37 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 9 + #[derive(Default)] [INFO] [stdout] 10 | struct DelimeterRules { [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/datacell/ElementCell.rs:41:13 [INFO] [stdout] | [INFO] [stdout] 41 | / match &mut tree.cell_type { [INFO] [stdout] 42 | | CellType::Element(ref mut el) => el.push_attribute(prop_line), [INFO] [stdout] 43 | | _ => (), [INFO] [stdout] 44 | | } [INFO] [stdout] | |_____________^ help: try: `if let CellType::Element(ref mut el) = &mut tree.cell_type { el.push_attribute(prop_line) }` [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/element_text.rs:118:53 [INFO] [stdout] | [INFO] [stdout] 118 | &self.find_closing_delimeter(i, &del.unwrap(), false); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `del.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/element_text.rs:123:37 [INFO] [stdout] | [INFO] [stdout] 123 | output.push_str(&del.unwrap().symbol); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `del.unwrap().symbol` [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/element_text.rs:124:59 [INFO] [stdout] | [INFO] [stdout] 124 | let nested_content = ElementText::new(&del_content).handle_delimeters(); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `del_content` [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/element_text.rs:132:38 [INFO] [stdout] | [INFO] [stdout] 132 | ElementText::new(&del_content).handle_delimeters() [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `del_content` [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/element_text.rs:141:50 [INFO] [stdout] | [INFO] [stdout] 141 | char_after_closing_del = &self.get_slice(i, i + 1).unwrap_or(""); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.get_slice(i, i + 1).unwrap_or("")` [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: comparison to empty slice [INFO] [stdout] --> src/element_text.rs:145:28 [INFO] [stdout] | [INFO] [stdout] 145 | && char_after_closing_del != "" [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!char_after_closing_del.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/element_text.rs:150:31 [INFO] [stdout] | [INFO] [stdout] 150 | while output.len() > 0 && output.chars().last().unwrap() != ' ' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!output.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: you should use the `ends_with` method [INFO] [stdout] --> src/element_text.rs:150:51 [INFO] [stdout] | [INFO] [stdout] 150 | while output.len() > 0 && output.chars().last().unwrap() != ' ' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!output.ends_with(' ')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] = note: `#[warn(clippy::chars_last_cmp)]` 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/element_text.rs:164:41 [INFO] [stdout] | [INFO] [stdout] 164 | output.push_str(&del.unwrap().symbol); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `del.unwrap().symbol` [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/element_text.rs:170:41 [INFO] [stdout] | [INFO] [stdout] 170 | output.push_str(&del.unwrap().end_symbol); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `del.unwrap().end_symbol` [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: comparison to empty slice [INFO] [stdout] --> src/element_text.rs:176:28 [INFO] [stdout] | [INFO] [stdout] 176 | && char_after_closing_del != "" [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!char_after_closing_del.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/element_text.rs:182:32 [INFO] [stdout] | [INFO] [stdout] 182 | ... && self.get_char(i) != "" [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.get_char(i).is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/element_text.rs:219:53 [INFO] [stdout] | [INFO] [stdout] 219 | &self.find_closing_delimeter(i, &del.unwrap(), true); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `del.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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/element_text.rs:225:21 [INFO] [stdout] | [INFO] [stdout] 225 | / match last_child { [INFO] [stdout] 226 | | BlockChildType::Text(mut t) => { [INFO] [stdout] 227 | | t.content [INFO] [stdout] 228 | | .push_str(&format!("{}{}", &del.unwrap().symbol, del_content)); [INFO] [stdout] ... | [INFO] [stdout] 231 | | _ => (), [INFO] [stdout] 232 | | } [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] 225 ~ if let BlockChildType::Text(mut t) = last_child { [INFO] [stdout] 226 + t.content [INFO] [stdout] 227 + .push_str(&format!("{}{}", &del.unwrap().symbol, del_content)); [INFO] [stdout] 228 + output.push(BlockChildType::Text(t)) [INFO] [stdout] 229 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/desugarer.rs:114:25 [INFO] [stdout] | [INFO] [stdout] 114 | &article_types, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `article_types` [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 `unwrap` on `_del` after checking its variant with `is_some` [INFO] [stdout] --> src/element_text.rs:330:35 [INFO] [stdout] | [INFO] [stdout] 323 | if _del.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = _del` [INFO] [stdout] ... [INFO] [stdout] 330 | .skip(i - _del.unwrap().symbol.len()) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `_del` after checking its variant with `is_some` [INFO] [stdout] --> src/element_text.rs:339:32 [INFO] [stdout] | [INFO] [stdout] 323 | if _del.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = _del` [INFO] [stdout] ... [INFO] [stdout] 339 | found_symbol = _del.unwrap().symbol; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/element_text.rs:307:21 [INFO] [stdout] | [INFO] [stdout] 307 | / d.symbol [INFO] [stdout] 308 | | == &self [INFO] [stdout] 309 | | .text [INFO] [stdout] 310 | | .chars() [INFO] [stdout] 311 | | .take(i) [INFO] [stdout] 312 | | .skip(i - d.symbol.len()) [INFO] [stdout] 313 | | .collect::() [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] help: use the right value directly [INFO] [stdout] | [INFO] [stdout] 308 ~ == self [INFO] [stdout] 309 + .text [INFO] [stdout] 310 + .chars() [INFO] [stdout] 311 + .take(i) [INFO] [stdout] 312 + .skip(i - d.symbol.len()) [INFO] [stdout] 313 + .collect::() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/desugarer.rs:119:83 [INFO] [stdout] | [INFO] [stdout] 119 | self.find_cell_and_mark_article(child, tag_names, cells, article, &article_types) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `article_types` [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` branch is empty [INFO] [stdout] --> src/element_text.rs:340:17 [INFO] [stdout] | [INFO] [stdout] 340 | if !has_multi_char {} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: you can remove it [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_ifs [INFO] [stdout] = note: `#[warn(clippy::needless_ifs)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/element_text.rs:382:28 [INFO] [stdout] | [INFO] [stdout] 382 | let is_found = end_symbol [INFO] [stdout] | ____________________________^ [INFO] [stdout] 383 | | == &self [INFO] [stdout] 384 | | .text [INFO] [stdout] 385 | | .chars() [INFO] [stdout] 386 | | .take(i + end_symbol.len()) [INFO] [stdout] 387 | | .skip(i) [INFO] [stdout] 388 | | .collect::() [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] help: use the right value directly [INFO] [stdout] | [INFO] [stdout] 383 ~ == self [INFO] [stdout] 384 + .text [INFO] [stdout] 385 + .chars() [INFO] [stdout] 386 + .take(i + end_symbol.len()) [INFO] [stdout] 387 + .skip(i) [INFO] [stdout] 388 + .collect::() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/element_text.rs:394:21 [INFO] [stdout] | [INFO] [stdout] 394 | if (end_symbol [INFO] [stdout] | _____________________^ [INFO] [stdout] 395 | | != &self [INFO] [stdout] 396 | | .text [INFO] [stdout] 397 | | .chars() [INFO] [stdout] 398 | | .take(i + end_symbol.len()) [INFO] [stdout] 399 | | .skip(i) [INFO] [stdout] 400 | | .collect::() [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] help: use the right value directly [INFO] [stdout] | [INFO] [stdout] 395 ~ != self [INFO] [stdout] 396 + .text [INFO] [stdout] 397 + .chars() [INFO] [stdout] 398 + .take(i + end_symbol.len()) [INFO] [stdout] 399 + .skip(i) [INFO] [stdout] 400 + .collect::() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/element_text.rs:401:54 [INFO] [stdout] | [INFO] [stdout] 401 | && !self.escape_before_symbol(i, &end_symbol)) [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `end_symbol` [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 `unwrap` on `handle` after checking its variant with `is_some` [INFO] [stdout] --> src/desugarer.rs:228:25 [INFO] [stdout] | [INFO] [stdout] 227 | if handle.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = handle` [INFO] [stdout] 228 | handle.unwrap().value.to_owned() + "<<" [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/element_text.rs:417:18 [INFO] [stdout] | [INFO] [stdout] 417 | ) && next_char != &end_symbol [INFO] [stdout] | ^^^^^^^^^^^^^----------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `end_symbol` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/element_text.rs:427:21 [INFO] [stdout] | [INFO] [stdout] 427 | del_content.push_str("\\"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `del_content.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] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/desugarer.rs:212:70 [INFO] [stdout] | [INFO] [stdout] 212 | for (_, (article_id, element)) in elements.clone().iter_mut().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 212 - for (_, (article_id, element)) in elements.clone().iter_mut().enumerate() { [INFO] [stdout] 212 + for (article_id, element) in elements.clone().iter_mut() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/desugarer.rs:265:26 [INFO] [stdout] | [INFO] [stdout] 265 | pub fn wrap_children<'a>( [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/desugarer.rs:305:104 [INFO] [stdout] | [INFO] [stdout] 305 | fn wrap_element_children(&mut self, root: &mut DataCell, el: &T, ignore_elements: &Vec, wrap_wi... [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] 305 - fn wrap_element_children(&mut self, root: &mut DataCell, el: &T, ignore_elements: &Vec, wrap_with: &str) { [INFO] [stdout] 305 + fn wrap_element_children(&mut self, root: &mut DataCell, el: &T, ignore_elements: &[IgnoreOptions], wrap_with: &str) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/desugarer.rs:411:27 [INFO] [stdout] | [INFO] [stdout] 411 | pub fn wrap_recursive<'a>(&self, root: &'a mut DataCell, wrap_with: &str) -> Desugarer { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 411 - pub fn wrap_recursive<'a>(&self, root: &'a mut DataCell, wrap_with: &str) -> Desugarer { [INFO] [stdout] 411 + pub fn wrap_recursive(&self, root: &mut DataCell, wrap_with: &str) -> Desugarer { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/emitter.rs:67:21 [INFO] [stdout] | [INFO] [stdout] 67 | .enumerate() [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 67 ~ [INFO] [stdout] 68 ~ .for_each(|child| match child { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/emitter.rs:73:36 [INFO] [stdout] | [INFO] [stdout] 73 | ... if let Some(_) = &dl.wrapped_with { [INFO] [stdout] | -------^^^^^^^------------------- help: try: `if dl.wrapped_with.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` 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/emitter.rs:78:57 [INFO] [stdout] | [INFO] [stdout] 78 | ... text_block.push_str(&&text_el.handle_delimeters()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `(&text_el.handle_delimeters())` [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/desugarer.rs:457:52 [INFO] [stdout] | [INFO] [stdout] 457 | if Self::paragraph_first_child_is_text(&element) [INFO] [stdout] | ^^^^^^^^ help: change this to: `element` [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/desugarer.rs:524:36 [INFO] [stdout] | [INFO] [stdout] 524 | prev_el = Some(&child) [INFO] [stdout] | ^^^^^^ help: change this to: `child` [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/emitter.rs:131:37 [INFO] [stdout] | [INFO] [stdout] 131 | if el.name.contains(&split_children_of) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `split_children_of` [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: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/desugarer.rs:560:45 [INFO] [stdout] | [INFO] [stdout] 560 | for (_, element) in _elements.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 560 - for (_, element) in _elements.iter().enumerate() { [INFO] [stdout] 560 + for element in _elements.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/element_text.rs:22:1 [INFO] [stdout] | [INFO] [stdout] 22 | / impl Default for DelimeterRules { [INFO] [stdout] 23 | | fn default() -> Self { [INFO] [stdout] 24 | | Self { [INFO] [stdout] 25 | | symbol: "", [INFO] [stdout] ... | [INFO] [stdout] 37 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 9 + #[derive(Default)] [INFO] [stdout] 10 | struct DelimeterRules { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `parser::ParserError` [INFO] [stdout] --> src/parser.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | / pub fn to_string(&self) -> String { [INFO] [stdout] 25 | | match self { [INFO] [stdout] 26 | | ParserError::ExtraSpacesError(line) => format!("Extra spaces found on line {}", line), [INFO] [stdout] 27 | | ParserError::None4xSpacesError(line) => { [INFO] [stdout] ... | [INFO] [stdout] 31 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `parser::ParserError` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser.rs:35:49 [INFO] [stdout] | [INFO] [stdout] 35 | ParserError::ExtraSpacesError(_) => format!("Extra spaces found"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Extra spaces found".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: useless use of `format!` [INFO] [stdout] --> src/parser.rs:37:17 [INFO] [stdout] | [INFO] [stdout] 37 | format!("None 4x spaces found") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"None 4x spaces found".to_string()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/element_text.rs:118:53 [INFO] [stdout] | [INFO] [stdout] 118 | &self.find_closing_delimeter(i, &del.unwrap(), false); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `del.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: you should consider adding a `Default` implementation for `Parser` [INFO] [stdout] --> src/parser.rs:44:5 [INFO] [stdout] | [INFO] [stdout] 44 | / pub fn new() -> Parser { [INFO] [stdout] 45 | | Self { [INFO] [stdout] 46 | | result: DataCell { [INFO] [stdout] 47 | | parent_id: 0, [INFO] [stdout] ... | [INFO] [stdout] 53 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 43 + impl Default for Parser { [INFO] [stdout] 44 + fn default() -> Self { [INFO] [stdout] 45 + Self::new() [INFO] [stdout] 46 + } [INFO] [stdout] 47 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/parser.rs:55:30 [INFO] [stdout] | [INFO] [stdout] 55 | pub fn import_json(json: &String) -> 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] 55 ~ pub fn import_json(json: &str) -> String { [INFO] [stdout] 56 ~ json.to_owned() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/element_text.rs:123:37 [INFO] [stdout] | [INFO] [stdout] 123 | output.push_str(&del.unwrap().symbol); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `del.unwrap().symbol` [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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/parser.rs:91:60 [INFO] [stdout] | [INFO] [stdout] 91 | fn props_end(&mut self, trimmed_line: &str, tag_stack: &Vec) -> bool { [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] 91 - fn props_end(&mut self, trimmed_line: &str, tag_stack: &Vec) -> bool { [INFO] [stdout] 91 + fn props_end(&mut self, trimmed_line: &str, tag_stack: &[TagInfo]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/parser.rs:93:12 [INFO] [stdout] | [INFO] [stdout] 93 | && tag_stack [INFO] [stdout] | ____________^ [INFO] [stdout] 94 | | .last() [INFO] [stdout] 95 | | .map_or(false, |tag| tag.in_props && !tag.is_self_closing) [INFO] [stdout] | |______________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 95 - .map_or(false, |tag| tag.in_props && !tag.is_self_closing) [INFO] [stdout] 95 + .is_some_and(|tag| tag.in_props && !tag.is_self_closing) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/element_text.rs:124:59 [INFO] [stdout] | [INFO] [stdout] 124 | let nested_content = ElementText::new(&del_content).handle_delimeters(); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `del_content` [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/element_text.rs:132:38 [INFO] [stdout] | [INFO] [stdout] 132 | ElementText::new(&del_content).handle_delimeters() [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `del_content` [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: manual implementation of an assign operation [INFO] [stdout] --> src/parser.rs:111:17 [INFO] [stdout] | [INFO] [stdout] 111 | lines_to_skip = lines_to_skip - 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `lines_to_skip -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` 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/element_text.rs:141:50 [INFO] [stdout] | [INFO] [stdout] 141 | char_after_closing_del = &self.get_slice(i, i + 1).unwrap_or(""); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.get_slice(i, i + 1).unwrap_or("")` [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: comparison to empty slice [INFO] [stdout] --> src/element_text.rs:145:28 [INFO] [stdout] | [INFO] [stdout] 145 | && char_after_closing_del != "" [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!char_after_closing_del.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/element_text.rs:150:31 [INFO] [stdout] | [INFO] [stdout] 150 | while output.len() > 0 && output.chars().last().unwrap() != ' ' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!output.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: you should use the `ends_with` method [INFO] [stdout] --> src/element_text.rs:150:51 [INFO] [stdout] | [INFO] [stdout] 150 | while output.len() > 0 && output.chars().last().unwrap() != ' ' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!output.ends_with(' ')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] = note: `#[warn(clippy::chars_last_cmp)]` 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/element_text.rs:164:41 [INFO] [stdout] | [INFO] [stdout] 164 | output.push_str(&del.unwrap().symbol); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `del.unwrap().symbol` [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/element_text.rs:170:41 [INFO] [stdout] | [INFO] [stdout] 170 | output.push_str(&del.unwrap().end_symbol); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `del.unwrap().end_symbol` [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: comparison to empty slice [INFO] [stdout] --> src/element_text.rs:176:28 [INFO] [stdout] | [INFO] [stdout] 176 | && char_after_closing_del != "" [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!char_after_closing_del.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/element_text.rs:182:32 [INFO] [stdout] | [INFO] [stdout] 182 | ... && self.get_char(i) != "" [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.get_char(i).is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/parser.rs:151:22 [INFO] [stdout] | [INFO] [stdout] 151 | .expect(&format!("There is no parent tag . at line \n {:?}", index)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("There is no parent tag . at line \n {:?}", index))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/parser.rs:163:40 [INFO] [stdout] | [INFO] [stdout] 163 | let next_line_indent = if let Some(next_line) = next_line { [INFO] [stdout] | ________________________________________^ [INFO] [stdout] 164 | | Some(get_line_indent(next_line)) [INFO] [stdout] 165 | | } else { [INFO] [stdout] 166 | | None [INFO] [stdout] 167 | | }; [INFO] [stdout] | |_________________^ help: try: `next_line.map(|next_line| get_line_indent(next_line))` [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: comparison to empty slice [INFO] [stdout] --> src/parser.rs:181:28 [INFO] [stdout] | [INFO] [stdout] 181 | if text_node == "" { "" } else { " " }, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `text_node.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/parser.rs:206:32 [INFO] [stdout] | [INFO] [stdout] 206 | ... if text.content != "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!text.content.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/parser.rs:236:24 [INFO] [stdout] | [INFO] [stdout] 236 | if text_node == "" { "" } else { " " }, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `text_node.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/element_text.rs:219:53 [INFO] [stdout] | [INFO] [stdout] 219 | &self.find_closing_delimeter(i, &del.unwrap(), true); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `del.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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/parser.rs:244:21 [INFO] [stdout] | [INFO] [stdout] 244 | text_node.push_str("\n") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `text_node.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/element_text.rs:225:21 [INFO] [stdout] | [INFO] [stdout] 225 | / match last_child { [INFO] [stdout] 226 | | BlockChildType::Text(mut t) => { [INFO] [stdout] 227 | | t.content [INFO] [stdout] 228 | | .push_str(&format!("{}{}", &del.unwrap().symbol, del_content)); [INFO] [stdout] ... | [INFO] [stdout] 231 | | _ => (), [INFO] [stdout] 232 | | } [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] 225 ~ if let BlockChildType::Text(mut t) = last_child { [INFO] [stdout] 226 + t.content [INFO] [stdout] 227 + .push_str(&format!("{}{}", &del.unwrap().symbol, del_content)); [INFO] [stdout] 228 + output.push(BlockChildType::Text(t)) [INFO] [stdout] 229 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/parser.rs:252:40 [INFO] [stdout] | [INFO] [stdout] 252 | fn get_parent_id(&self, tag_stack: &Vec) -> Option { [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] 252 - fn get_parent_id(&self, tag_stack: &Vec) -> Option { [INFO] [stdout] 252 + fn get_parent_id(&self, tag_stack: &[TagInfo]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/parser.rs:254:9 [INFO] [stdout] | [INFO] [stdout] 254 | / if before_last_index.is_none() { [INFO] [stdout] 255 | | return None; [INFO] [stdout] 256 | | } [INFO] [stdout] | |_________^ help: replace it with: `before_last_index?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/parser.rs:258:9 [INFO] [stdout] | [INFO] [stdout] 258 | / if let Some(before_last) = tag_stack.get(before_last_index) { [INFO] [stdout] 259 | | Some(before_last.id) [INFO] [stdout] 260 | | } else { [INFO] [stdout] 261 | | None [INFO] [stdout] 262 | | } [INFO] [stdout] | |_________^ help: try: `tag_stack.get(before_last_index).map(|before_last| before_last.id)` [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: module `BlockCell` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:1:9 [INFO] [stdout] | [INFO] [stdout] 1 | pub mod BlockCell; [INFO] [stdout] | ^^^^^^^^^ help: convert the identifier to snake case: `block_cell` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module `BlockChildType` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | pub mod BlockChildType; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: convert the identifier to snake case: `block_child_type` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module `CellTrait` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:3:9 [INFO] [stdout] | [INFO] [stdout] 3 | pub mod CellTrait; [INFO] [stdout] | ^^^^^^^^^ help: convert the identifier to snake case: `cell_trait` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module `Datacell` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:4:9 [INFO] [stdout] | [INFO] [stdout] 4 | pub mod Datacell; [INFO] [stdout] | ^^^^^^^^ help: convert the identifier to snake case: `datacell` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module `ElementCell` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:5:9 [INFO] [stdout] | [INFO] [stdout] 5 | pub mod ElementCell; [INFO] [stdout] | ^^^^^^^^^^^ help: convert the identifier to snake case: `element_cell` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `_del` after checking its variant with `is_some` [INFO] [stdout] --> src/element_text.rs:330:35 [INFO] [stdout] | [INFO] [stdout] 323 | if _del.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = _del` [INFO] [stdout] ... [INFO] [stdout] 330 | .skip(i - _del.unwrap().symbol.len()) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `_del` after checking its variant with `is_some` [INFO] [stdout] --> src/element_text.rs:339:32 [INFO] [stdout] | [INFO] [stdout] 323 | if _del.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = _del` [INFO] [stdout] ... [INFO] [stdout] 339 | found_symbol = _del.unwrap().symbol; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/element_text.rs:307:21 [INFO] [stdout] | [INFO] [stdout] 307 | / d.symbol [INFO] [stdout] 308 | | == &self [INFO] [stdout] 309 | | .text [INFO] [stdout] 310 | | .chars() [INFO] [stdout] 311 | | .take(i) [INFO] [stdout] 312 | | .skip(i - d.symbol.len()) [INFO] [stdout] 313 | | .collect::() [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] help: use the right value directly [INFO] [stdout] | [INFO] [stdout] 308 ~ == self [INFO] [stdout] 309 + .text [INFO] [stdout] 310 + .chars() [INFO] [stdout] 311 + .take(i) [INFO] [stdout] 312 + .skip(i - d.symbol.len()) [INFO] [stdout] 313 + .collect::() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` branch is empty [INFO] [stdout] --> src/element_text.rs:340:17 [INFO] [stdout] | [INFO] [stdout] 340 | if !has_multi_char {} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: you can remove it [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_ifs [INFO] [stdout] = note: `#[warn(clippy::needless_ifs)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/element_text.rs:382:28 [INFO] [stdout] | [INFO] [stdout] 382 | let is_found = end_symbol [INFO] [stdout] | ____________________________^ [INFO] [stdout] 383 | | == &self [INFO] [stdout] 384 | | .text [INFO] [stdout] 385 | | .chars() [INFO] [stdout] 386 | | .take(i + end_symbol.len()) [INFO] [stdout] 387 | | .skip(i) [INFO] [stdout] 388 | | .collect::() [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] help: use the right value directly [INFO] [stdout] | [INFO] [stdout] 383 ~ == self [INFO] [stdout] 384 + .text [INFO] [stdout] 385 + .chars() [INFO] [stdout] 386 + .take(i + end_symbol.len()) [INFO] [stdout] 387 + .skip(i) [INFO] [stdout] 388 + .collect::() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/element_text.rs:394:21 [INFO] [stdout] | [INFO] [stdout] 394 | if (end_symbol [INFO] [stdout] | _____________________^ [INFO] [stdout] 395 | | != &self [INFO] [stdout] 396 | | .text [INFO] [stdout] 397 | | .chars() [INFO] [stdout] 398 | | .take(i + end_symbol.len()) [INFO] [stdout] 399 | | .skip(i) [INFO] [stdout] 400 | | .collect::() [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] help: use the right value directly [INFO] [stdout] | [INFO] [stdout] 395 ~ != self [INFO] [stdout] 396 + .text [INFO] [stdout] 397 + .chars() [INFO] [stdout] 398 + .take(i + end_symbol.len()) [INFO] [stdout] 399 + .skip(i) [INFO] [stdout] 400 + .collect::() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/element_text.rs:401:54 [INFO] [stdout] | [INFO] [stdout] 401 | && !self.escape_before_symbol(i, &end_symbol)) [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `end_symbol` [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: taken reference of right operand [INFO] [stdout] --> src/element_text.rs:417:18 [INFO] [stdout] | [INFO] [stdout] 417 | ) && next_char != &end_symbol [INFO] [stdout] | ^^^^^^^^^^^^^----------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `end_symbol` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/element_text.rs:427:21 [INFO] [stdout] | [INFO] [stdout] 427 | del_content.push_str("\\"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `del_content.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] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/emitter.rs:67:21 [INFO] [stdout] | [INFO] [stdout] 67 | .enumerate() [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 67 ~ [INFO] [stdout] 68 ~ .for_each(|child| match child { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/emitter.rs:73:36 [INFO] [stdout] | [INFO] [stdout] 73 | ... if let Some(_) = &dl.wrapped_with { [INFO] [stdout] | -------^^^^^^^------------------- help: try: `if dl.wrapped_with.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` 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/emitter.rs:78:57 [INFO] [stdout] | [INFO] [stdout] 78 | ... text_block.push_str(&&text_el.handle_delimeters()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `(&text_el.handle_delimeters())` [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/emitter.rs:131:37 [INFO] [stdout] | [INFO] [stdout] 131 | if el.name.contains(&split_children_of) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `split_children_of` [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: implementation of inherent method `to_string(&self) -> String` for type `parser::ParserError` [INFO] [stdout] --> src/parser.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | / pub fn to_string(&self) -> String { [INFO] [stdout] 25 | | match self { [INFO] [stdout] 26 | | ParserError::ExtraSpacesError(line) => format!("Extra spaces found on line {}", line), [INFO] [stdout] 27 | | ParserError::None4xSpacesError(line) => { [INFO] [stdout] ... | [INFO] [stdout] 31 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `parser::ParserError` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser.rs:35:49 [INFO] [stdout] | [INFO] [stdout] 35 | ParserError::ExtraSpacesError(_) => format!("Extra spaces found"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Extra spaces found".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: useless use of `format!` [INFO] [stdout] --> src/parser.rs:37:17 [INFO] [stdout] | [INFO] [stdout] 37 | format!("None 4x spaces found") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"None 4x spaces found".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: you should consider adding a `Default` implementation for `Parser` [INFO] [stdout] --> src/parser.rs:44:5 [INFO] [stdout] | [INFO] [stdout] 44 | / pub fn new() -> Parser { [INFO] [stdout] 45 | | Self { [INFO] [stdout] 46 | | result: DataCell { [INFO] [stdout] 47 | | parent_id: 0, [INFO] [stdout] ... | [INFO] [stdout] 53 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 43 + impl Default for Parser { [INFO] [stdout] 44 + fn default() -> Self { [INFO] [stdout] 45 + Self::new() [INFO] [stdout] 46 + } [INFO] [stdout] 47 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/parser.rs:55:30 [INFO] [stdout] | [INFO] [stdout] 55 | pub fn import_json(json: &String) -> 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] 55 ~ pub fn import_json(json: &str) -> String { [INFO] [stdout] 56 ~ json.to_owned() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/parser.rs:91:60 [INFO] [stdout] | [INFO] [stdout] 91 | fn props_end(&mut self, trimmed_line: &str, tag_stack: &Vec) -> bool { [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] 91 - fn props_end(&mut self, trimmed_line: &str, tag_stack: &Vec) -> bool { [INFO] [stdout] 91 + fn props_end(&mut self, trimmed_line: &str, tag_stack: &[TagInfo]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/parser.rs:93:12 [INFO] [stdout] | [INFO] [stdout] 93 | && tag_stack [INFO] [stdout] | ____________^ [INFO] [stdout] 94 | | .last() [INFO] [stdout] 95 | | .map_or(false, |tag| tag.in_props && !tag.is_self_closing) [INFO] [stdout] | |______________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 95 - .map_or(false, |tag| tag.in_props && !tag.is_self_closing) [INFO] [stdout] 95 + .is_some_and(|tag| tag.in_props && !tag.is_self_closing) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/parser.rs:111:17 [INFO] [stdout] | [INFO] [stdout] 111 | lines_to_skip = lines_to_skip - 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `lines_to_skip -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/parser.rs:151:22 [INFO] [stdout] | [INFO] [stdout] 151 | .expect(&format!("There is no parent tag . at line \n {:?}", index)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("There is no parent tag . at line \n {:?}", index))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/parser.rs:163:40 [INFO] [stdout] | [INFO] [stdout] 163 | let next_line_indent = if let Some(next_line) = next_line { [INFO] [stdout] | ________________________________________^ [INFO] [stdout] 164 | | Some(get_line_indent(next_line)) [INFO] [stdout] 165 | | } else { [INFO] [stdout] 166 | | None [INFO] [stdout] 167 | | }; [INFO] [stdout] | |_________________^ help: try: `next_line.map(|next_line| get_line_indent(next_line))` [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: comparison to empty slice [INFO] [stdout] --> src/parser.rs:181:28 [INFO] [stdout] | [INFO] [stdout] 181 | if text_node == "" { "" } else { " " }, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `text_node.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/parser.rs:206:32 [INFO] [stdout] | [INFO] [stdout] 206 | ... if text.content != "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!text.content.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/parser.rs:236:24 [INFO] [stdout] | [INFO] [stdout] 236 | if text_node == "" { "" } else { " " }, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `text_node.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/parser.rs:244:21 [INFO] [stdout] | [INFO] [stdout] 244 | text_node.push_str("\n") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `text_node.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/parser.rs:252:40 [INFO] [stdout] | [INFO] [stdout] 252 | fn get_parent_id(&self, tag_stack: &Vec) -> Option { [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] 252 - fn get_parent_id(&self, tag_stack: &Vec) -> Option { [INFO] [stdout] 252 + fn get_parent_id(&self, tag_stack: &[TagInfo]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/parser.rs:254:9 [INFO] [stdout] | [INFO] [stdout] 254 | / if before_last_index.is_none() { [INFO] [stdout] 255 | | return None; [INFO] [stdout] 256 | | } [INFO] [stdout] | |_________^ help: replace it with: `before_last_index?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/parser.rs:258:9 [INFO] [stdout] | [INFO] [stdout] 258 | / if let Some(before_last) = tag_stack.get(before_last_index) { [INFO] [stdout] 259 | | Some(before_last.id) [INFO] [stdout] 260 | | } else { [INFO] [stdout] 261 | | None [INFO] [stdout] 262 | | } [INFO] [stdout] | |_________^ help: try: `tag_stack.get(before_last_index).map(|before_last| before_last.id)` [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: module `BlockCell` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:1:9 [INFO] [stdout] | [INFO] [stdout] 1 | pub mod BlockCell; [INFO] [stdout] | ^^^^^^^^^ help: convert the identifier to snake case: `block_cell` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module `BlockChildType` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | pub mod BlockChildType; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: convert the identifier to snake case: `block_child_type` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module `CellTrait` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:3:9 [INFO] [stdout] | [INFO] [stdout] 3 | pub mod CellTrait; [INFO] [stdout] | ^^^^^^^^^ help: convert the identifier to snake case: `cell_trait` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module `Datacell` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:4:9 [INFO] [stdout] | [INFO] [stdout] 4 | pub mod Datacell; [INFO] [stdout] | ^^^^^^^^ help: convert the identifier to snake case: `datacell` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module `ElementCell` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:5:9 [INFO] [stdout] | [INFO] [stdout] 5 | pub mod ElementCell; [INFO] [stdout] | ^^^^^^^^^^^ help: convert the identifier to snake case: `element_cell` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `nom::bytes::complete::tag` [INFO] [stdout] --> src/desugarer.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use nom::bytes::complete::tag; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `syn::ext` [INFO] [stdout] --> src/desugarer.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use syn::ext; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `nom::bytes::complete::tag` [INFO] [stdout] --> src/desugarer.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use nom::bytes::complete::tag; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `CellTrait::Cell`, `Datacell::*`, and `ElementCell::*` [INFO] [stdout] --> src/element_text.rs:1:42 [INFO] [stdout] | [INFO] [stdout] 1 | use crate::datacell::{BlockChildType::*, CellTrait::Cell, Datacell::*, ElementCell::*}; [INFO] [stdout] | ^^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `syn::ext` [INFO] [stdout] --> src/desugarer.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use syn::ext; [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `CellTrait::Cell`, `Datacell::*`, and `ElementCell::*` [INFO] [stdout] --> src/element_text.rs:1:42 [INFO] [stdout] | [INFO] [stdout] 1 | use crate::datacell::{BlockChildType::*, CellTrait::Cell, Datacell::*, ElementCell::*}; [INFO] [stdout] | ^^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Emitter` [INFO] [stdout] --> src/helpers.rs:2:15 [INFO] [stdout] | [INFO] [stdout] 2 | emitter::{Emitter, TagInfo}, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `Emitter` [INFO] [stdout] --> src/helpers.rs:2:15 [INFO] [stdout] | [INFO] [stdout] 2 | emitter::{Emitter, TagInfo}, [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ParagraphIndentOptions` [INFO] [stdout] --> src/main.rs:13:57 [INFO] [stdout] | [INFO] [stdout] 13 | use desugarer::{AttachToEnum, Desugarer, IgnoreOptions, ParagraphIndentOptions}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `ParagraphIndentOptions` [INFO] [stdout] --> src/main.rs:13:57 [INFO] [stdout] | [INFO] [stdout] 13 | use desugarer::{AttachToEnum, Desugarer, IgnoreOptions, ParagraphIndentOptions}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/desugarer.rs:309:21 [INFO] [stdout] | [INFO] [stdout] 309 | let mut no_wrap = false; [INFO] [stdout] | ----^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `no_wrap` [INFO] [stdout] --> src/desugarer.rs:309:21 [INFO] [stdout] | [INFO] [stdout] 309 | let mut no_wrap = false; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_no_wrap` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/desugarer.rs:309:21 [INFO] [stdout] | [INFO] [stdout] 309 | let mut no_wrap = false; [INFO] [stdout] | ----^^^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `no_wrap` [INFO] [stdout] --> src/desugarer.rs:309:21 [INFO] [stdout] | [INFO] [stdout] 309 | let mut no_wrap = false; [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_no_wrap` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `found_symbol` is never read [INFO] [stdout] --> src/element_text.rs:298:32 [INFO] [stdout] | [INFO] [stdout] 298 | let mut found_symbol = ""; [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `found_symbol` is never read [INFO] [stdout] --> src/element_text.rs:298:32 [INFO] [stdout] | [INFO] [stdout] 298 | let mut found_symbol = ""; [INFO] [stdout] | ^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `is_nested` is never read [INFO] [stdout] --> src/parser.rs:73:13 [INFO] [stdout] | [INFO] [stdout] 73 | is_nested = &false; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding [INFO] [stdout] | [INFO] [stdout] 63 ~ is_nested: &mut bool, [INFO] [stdout] 64 | tag_stack: &mut Vec, [INFO] [stdout] ... [INFO] [stdout] 72 | } else if *is_nested { [INFO] [stdout] 73 ~ *is_nested = false; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `is_nested` is never read [INFO] [stdout] --> src/parser.rs:73:13 [INFO] [stdout] | [INFO] [stdout] 73 | is_nested = &false; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: you might have meant to mutate the pointed at value being passed in, instead of changing the reference in the local binding [INFO] [stdout] | [INFO] [stdout] 63 ~ is_nested: &mut bool, [INFO] [stdout] 64 | tag_stack: &mut Vec, [INFO] [stdout] ... [INFO] [stdout] 72 | } else if *is_nested { [INFO] [stdout] 73 ~ *is_nested = false; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `to_tag_name` is never used [INFO] [stdout] --> src/counter/counter_commands.rs:37:8 [INFO] [stdout] | [INFO] [stdout] 16 | impl CommandType { [INFO] [stdout] | ---------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 37 | fn to_tag_name(&self) -> String { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `to_tag_name` is never used [INFO] [stdout] --> src/counter/counter_commands.rs:37:8 [INFO] [stdout] | [INFO] [stdout] 16 | impl CommandType { [INFO] [stdout] | ---------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 37 | fn to_tag_name(&self) -> String { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/counter/counter_commands.rs:20:26 [INFO] [stdout] | [INFO] [stdout] 20 | sub_string = &string[2..]; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/counter/counter_commands.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | if string.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] 19 ~ if let Some() = string.strip_prefix("<<") { [INFO] [stdout] 20 ~ sub_string = ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/counter/counter_commands.rs:20:26 [INFO] [stdout] | [INFO] [stdout] 20 | sub_string = &string[2..]; [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/counter/counter_commands.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | if string.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] 19 ~ if let Some() = string.strip_prefix("<<") { [INFO] [stdout] 20 ~ sub_string = ; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/counter/counter_commands.rs:146:33 [INFO] [stdout] | [INFO] [stdout] 146 | string.push_str(&mat.as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `mat.as_str()` [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/counter/counter_commands.rs:146:33 [INFO] [stdout] | [INFO] [stdout] 146 | string.push_str(&mat.as_str()); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `mat.as_str()` [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: returning the result of a `let` binding from a block [INFO] [stdout] --> src/counter/counter_commands.rs:175:9 [INFO] [stdout] | [INFO] [stdout] 173 | let json_str = self.replace_counters(&mut json, true); [INFO] [stdout] | ------------------------------------------------------ unnecessary `let` binding [INFO] [stdout] 174 | [INFO] [stdout] 175 | json_str [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] 173 ~ [INFO] [stdout] 174 | [INFO] [stdout] 175 ~ self.replace_counters(&mut json, true) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/counter/counter_commands.rs:175:9 [INFO] [stdout] | [INFO] [stdout] 173 | let json_str = self.replace_counters(&mut json, true); [INFO] [stdout] | ------------------------------------------------------ unnecessary `let` binding [INFO] [stdout] 174 | [INFO] [stdout] 175 | json_str [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] 173 ~ [INFO] [stdout] 174 | [INFO] [stdout] 175 ~ self.replace_counters(&mut json, true) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/counter/counter_commands.rs:183:17 [INFO] [stdout] | [INFO] [stdout] 183 | / if (block.has_counter_commands && !handle_insert_command) [INFO] [stdout] 184 | | || (block.has_handle_insert && handle_insert_command) [INFO] [stdout] 185 | | { [INFO] [stdout] 186 | | block.children.iter_mut().for_each(|child| { [INFO] [stdout] 187 | | self.handle_block_child(child, &cloned_cell, handle_insert_command) [INFO] [stdout] 188 | | }); [INFO] [stdout] 189 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 182 ~ CellType::Block(block) [INFO] [stdout] 183 ~ if ((block.has_counter_commands && !handle_insert_command) [INFO] [stdout] 184 ~ || (block.has_handle_insert && handle_insert_command)) [INFO] [stdout] 185 ~ => { [INFO] [stdout] 186 | block.children.iter_mut().for_each(|child| { [INFO] [stdout] 187 | self.handle_block_child(child, &cloned_cell, handle_insert_command) [INFO] [stdout] 188 | }); [INFO] [stdout] 189 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/counter/counter_commands.rs:183:17 [INFO] [stdout] | [INFO] [stdout] 183 | / if (block.has_counter_commands && !handle_insert_command) [INFO] [stdout] 184 | | || (block.has_handle_insert && handle_insert_command) [INFO] [stdout] 185 | | { [INFO] [stdout] 186 | | block.children.iter_mut().for_each(|child| { [INFO] [stdout] 187 | | self.handle_block_child(child, &cloned_cell, handle_insert_command) [INFO] [stdout] 188 | | }); [INFO] [stdout] 189 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 182 ~ CellType::Block(block) [INFO] [stdout] 183 ~ if ((block.has_counter_commands && !handle_insert_command) [INFO] [stdout] 184 ~ || (block.has_handle_insert && handle_insert_command)) [INFO] [stdout] 185 ~ => { [INFO] [stdout] 186 | block.children.iter_mut().for_each(|child| { [INFO] [stdout] 187 | self.handle_block_child(child, &cloned_cell, handle_insert_command) [INFO] [stdout] 188 | }); [INFO] [stdout] 189 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `execution` after checking its variant with `is_some` [INFO] [stdout] --> src/counter/counter_commands.rs:250:39 [INFO] [stdout] | [INFO] [stdout] 246 | if execution.is_some() { [INFO] [stdout] | ---------------------- help: try: `if let Some() = execution` [INFO] [stdout] ... [INFO] [stdout] 250 | res.push_str(&execution.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/counter/counter_commands.rs:228:38 [INFO] [stdout] | [INFO] [stdout] 228 | let splits = self.split_line(&text, false); [INFO] [stdout] | ^^^^^ help: change this to: `text` [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/counter/counter_commands.rs:235:21 [INFO] [stdout] | [INFO] [stdout] 235 | &cell, [INFO] [stdout] | ^^^^^ help: change this to: `cell` [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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/counter/counter_commands.rs:248:29 [INFO] [stdout] | [INFO] [stdout] 248 | ... res.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `res.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: called `unwrap` on `handle` after checking its variant with `is_some` [INFO] [stdout] --> src/counter/counter_commands.rs:273:35 [INFO] [stdout] | [INFO] [stdout] 272 | if handle.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = handle` [INFO] [stdout] 273 | res.push_str(&handle.unwrap().value); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/counter/counter_commands.rs:262:38 [INFO] [stdout] | [INFO] [stdout] 262 | let splits = self.split_line(&text, true); [INFO] [stdout] | ^^^^^ help: change this to: `text` [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 `unwrap` on `execution` after checking its variant with `is_some` [INFO] [stdout] --> src/counter/counter_commands.rs:250:39 [INFO] [stdout] | [INFO] [stdout] 246 | if execution.is_some() { [INFO] [stdout] | ---------------------- help: try: `if let Some() = execution` [INFO] [stdout] ... [INFO] [stdout] 250 | res.push_str(&execution.unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/counter/counter_commands.rs:228:38 [INFO] [stdout] | [INFO] [stdout] 228 | let splits = self.split_line(&text, false); [INFO] [stdout] | ^^^^^ help: change this to: `text` [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/counter/counter_commands.rs:235:21 [INFO] [stdout] | [INFO] [stdout] 235 | &cell, [INFO] [stdout] | ^^^^^ help: change this to: `cell` [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: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/counter/counter_commands.rs:248:29 [INFO] [stdout] | [INFO] [stdout] 248 | ... res.push_str(" "); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `res.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: called `unwrap` on `handle` after checking its variant with `is_some` [INFO] [stdout] --> src/counter/counter_commands.rs:273:35 [INFO] [stdout] | [INFO] [stdout] 272 | if handle.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = handle` [INFO] [stdout] 273 | res.push_str(&handle.unwrap().value); [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/counter/counter_commands.rs:262:38 [INFO] [stdout] | [INFO] [stdout] 262 | let splits = self.split_line(&text, true); [INFO] [stdout] | ^^^^^ help: change this to: `text` [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: taken reference of right operand [INFO] [stdout] --> src/counter/counter_commands.rs:271:31 [INFO] [stdout] | [INFO] [stdout] 271 | .find(|h| h.name == &split.content[2..]); [INFO] [stdout] | ^^^^^^^^^^------------------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `split.content[2..]` [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] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/counter/counter_commands.rs:271:31 [INFO] [stdout] | [INFO] [stdout] 271 | .find(|h| h.name == &split.content[2..]); [INFO] [stdout] | ^^^^^^^^^^------------------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `split.content[2..]` [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] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/counter/counter_instance.rs:35:42 [INFO] [stdout] | [INFO] [stdout] 35 | ... Roman::parse(&roman).expect("unvalid roman chars").value(); [INFO] [stdout] | ^^^^^^ help: change this to: `roman` [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/counter/counter_instance.rs:58:61 [INFO] [stdout] | [INFO] [stdout] 58 | if let Some(paresed) = Roman::parse(&roman) { [INFO] [stdout] | ^^^^^^ help: change this to: `roman` [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/counter/counter_instance.rs:35:42 [INFO] [stdout] | [INFO] [stdout] 35 | ... Roman::parse(&roman).expect("unvalid roman chars").value(); [INFO] [stdout] | ^^^^^^ help: change this to: `roman` [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/counter/counter_instance.rs:58:61 [INFO] [stdout] | [INFO] [stdout] 58 | if let Some(paresed) = Roman::parse(&roman) { [INFO] [stdout] | ^^^^^^ help: change this to: `roman` [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: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str` [INFO] [stdout] --> src/counter/counter_types.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | / pub fn from_str(string: &str) -> Option { [INFO] [stdout] 23 | | match string { [INFO] [stdout] 24 | | "counter" => Some(Self::ARABIC), [INFO] [stdout] 25 | | "roman_counter" => Some(Self::ROMAN), [INFO] [stdout] ... | [INFO] [stdout] 29 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::str::FromStr` 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: method `from_str` can be confused for the standard trait method `std::str::FromStr::from_str` [INFO] [stdout] --> src/counter/counter_types.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | / pub fn from_str(string: &str) -> Option { [INFO] [stdout] 23 | | match string { [INFO] [stdout] 24 | | "counter" => Some(Self::ARABIC), [INFO] [stdout] 25 | | "roman_counter" => Some(Self::ROMAN), [INFO] [stdout] ... | [INFO] [stdout] 29 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::str::FromStr` 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: implementation of inherent method `to_string(&self) -> String` for type `counter::counter_types::CounterValueType` [INFO] [stdout] --> src/counter/counter_types.rs:108:5 [INFO] [stdout] | [INFO] [stdout] 108 | / pub fn to_string(&self) -> String { [INFO] [stdout] 109 | | match self { [INFO] [stdout] 110 | | CounterValueType::ARABIC(number) => { [INFO] [stdout] 111 | | if *number < 0 { [INFO] [stdout] ... | [INFO] [stdout] 120 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `counter::counter_types::CounterValueType` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] = note: `#[warn(clippy::inherent_to_string)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Counters` [INFO] [stdout] --> src/counter/counters.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | / pub fn new() -> Counters { [INFO] [stdout] 19 | | Counters { [INFO] [stdout] 20 | | counters_list: Vec::new(), [INFO] [stdout] 21 | | handles_list: Vec::new(), [INFO] [stdout] 22 | | } [INFO] [stdout] 23 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 17 + impl Default for Counters { [INFO] [stdout] 18 + fn default() -> Self { [INFO] [stdout] 19 + Self::new() [INFO] [stdout] 20 + } [INFO] [stdout] 21 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `counter::counter_types::CounterValueType` [INFO] [stdout] --> src/counter/counter_types.rs:108:5 [INFO] [stdout] | [INFO] [stdout] 108 | / pub fn to_string(&self) -> String { [INFO] [stdout] 109 | | match self { [INFO] [stdout] 110 | | CounterValueType::ARABIC(number) => { [INFO] [stdout] 111 | | if *number < 0 { [INFO] [stdout] ... | [INFO] [stdout] 120 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `counter::counter_types::CounterValueType` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] = note: `#[warn(clippy::inherent_to_string)]` 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/counter/counters.rs:25:54 [INFO] [stdout] | [INFO] [stdout] 25 | fn iter_props(&mut self, json: &DataCell, props: &Vec) { [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] 25 - fn iter_props(&mut self, json: &DataCell, props: &Vec) { [INFO] [stdout] 25 + fn iter_props(&mut self, json: &DataCell, props: &[Prop]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Counters` [INFO] [stdout] --> src/counter/counters.rs:18:5 [INFO] [stdout] | [INFO] [stdout] 18 | / pub fn new() -> Counters { [INFO] [stdout] 19 | | Counters { [INFO] [stdout] 20 | | counters_list: Vec::new(), [INFO] [stdout] 21 | | handles_list: Vec::new(), [INFO] [stdout] 22 | | } [INFO] [stdout] 23 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 17 + impl Default for Counters { [INFO] [stdout] 18 + fn default() -> Self { [INFO] [stdout] 19 + Self::new() [INFO] [stdout] 20 + } [INFO] [stdout] 21 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/counter/counters.rs:25:54 [INFO] [stdout] | [INFO] [stdout] 25 | fn iter_props(&mut self, json: &DataCell, props: &Vec) { [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] 25 - fn iter_props(&mut self, json: &DataCell, props: &Vec) { [INFO] [stdout] 25 + fn iter_props(&mut self, json: &DataCell, props: &[Prop]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/counter/counters.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | !counter.is_none(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `counter.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/counter/counters.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | !counter.is_none(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `counter.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/counter/counters.rs:122:13 [INFO] [stdout] | [INFO] [stdout] 122 | !counter.is_none(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `counter.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/counter/counters.rs:154:17 [INFO] [stdout] | [INFO] [stdout] 154 | return false; [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] 154 - return false; [INFO] [stdout] 154 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/counter/counters.rs:166:17 [INFO] [stdout] | [INFO] [stdout] 166 | return false; [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] 166 - return false; [INFO] [stdout] 166 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/counter/counters.rs:145:35 [INFO] [stdout] | [INFO] [stdout] 145 | parents_list.push(json_tree.id.try_into().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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/counter/counters.rs:122:13 [INFO] [stdout] | [INFO] [stdout] 122 | !counter.is_none(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `counter.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/counter/counters.rs:157:35 [INFO] [stdout] | [INFO] [stdout] 157 | parents_list.push(json_tree.id.try_into().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/counter/counters.rs:154:17 [INFO] [stdout] | [INFO] [stdout] 154 | return false; [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] 154 - return false; [INFO] [stdout] 154 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/counter/counters.rs:166:17 [INFO] [stdout] | [INFO] [stdout] 166 | return false; [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] 166 - return false; [INFO] [stdout] 166 + false [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `usize` [INFO] [stdout] --> src/counter/counters.rs:145:35 [INFO] [stdout] | [INFO] [stdout] 145 | parents_list.push(json_tree.id.try_into().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [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: useless conversion to the same type: `usize` [INFO] [stdout] --> src/counter/counters.rs:157:35 [INFO] [stdout] | [INFO] [stdout] 157 | parents_list.push(json_tree.id.try_into().unwrap()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: consider removing `.try_into()` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [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/datacell/BlockCell.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | / match parent.cell_type { [INFO] [stdout] 33 | | CellType::Element(ref mut el) => { [INFO] [stdout] 34 | | el.children.insert(0, Self::init_cell(id, parent.id, block)) [INFO] [stdout] ... | [INFO] [stdout] 37 | | } [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] 32 ~ if let CellType::Element(ref mut el) = parent.cell_type { [INFO] [stdout] 33 + el.children.insert(0, Self::init_cell(id, parent.id, block)) [INFO] [stdout] 34 + } [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/datacell/BlockCell.rs:75:9 [INFO] [stdout] | [INFO] [stdout] 75 | / match parent.cell_type { [INFO] [stdout] 76 | | CellType::Element(ref mut el) => { [INFO] [stdout] 77 | | el.children.push(Self::init_cell(id, parent.id, block)) [INFO] [stdout] ... | [INFO] [stdout] 80 | | } [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] 75 ~ if let CellType::Element(ref mut el) = parent.cell_type { [INFO] [stdout] 76 + el.children.push(Self::init_cell(id, parent.id, block)) [INFO] [stdout] 77 + } [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/datacell/BlockCell.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | / match parent.cell_type { [INFO] [stdout] 33 | | CellType::Element(ref mut el) => { [INFO] [stdout] 34 | | el.children.insert(0, Self::init_cell(id, parent.id, block)) [INFO] [stdout] ... | [INFO] [stdout] 37 | | } [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] 32 ~ if let CellType::Element(ref mut el) = parent.cell_type { [INFO] [stdout] 33 + el.children.insert(0, Self::init_cell(id, parent.id, block)) [INFO] [stdout] 34 + } [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/datacell/BlockCell.rs:75:9 [INFO] [stdout] | [INFO] [stdout] 75 | / match parent.cell_type { [INFO] [stdout] 76 | | CellType::Element(ref mut el) => { [INFO] [stdout] 77 | | el.children.push(Self::init_cell(id, parent.id, block)) [INFO] [stdout] ... | [INFO] [stdout] 80 | | } [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] 75 ~ if let CellType::Element(ref mut el) = parent.cell_type { [INFO] [stdout] 76 + el.children.push(Self::init_cell(id, parent.id, block)) [INFO] [stdout] 77 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/datacell/Datacell.rs:98:17 [INFO] [stdout] | [INFO] [stdout] 98 | / if let Some(child) = Self::get_cell_by_id(x, id) { [INFO] [stdout] 99 | | Some(child) [INFO] [stdout] 100 | | } else { [INFO] [stdout] 101 | | None [INFO] [stdout] 102 | | } [INFO] [stdout] | |_________________^ help: try: `Self::get_cell_by_id(x, id).map(|child| child)` [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: manual implementation of `Option::map` [INFO] [stdout] --> src/datacell/Datacell.rs:107:21 [INFO] [stdout] | [INFO] [stdout] 107 | / if let Some(child) = Self::get_cell_by_id(x, id) { [INFO] [stdout] 108 | | Some(child) [INFO] [stdout] 109 | | } else { [INFO] [stdout] 110 | | None [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________________^ help: try: `Self::get_cell_by_id(x, id).map(|child| child)` [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: this if-let expression is unnecessary [INFO] [stdout] --> src/datacell/Datacell.rs:107:21 [INFO] [stdout] | [INFO] [stdout] 107 | / if let Some(child) = Self::get_cell_by_id(x, id) { [INFO] [stdout] 108 | | Some(child) [INFO] [stdout] 109 | | } else { [INFO] [stdout] 110 | | None [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________________^ help: replace it with: `Self::get_cell_by_id(x, id)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_match [INFO] [stdout] = note: `#[warn(clippy::needless_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/datacell/Datacell.rs:126:17 [INFO] [stdout] | [INFO] [stdout] 126 | / if let Some(child) = Self::get_cell_by_id_immut(x, id) { [INFO] [stdout] 127 | | Some(child) [INFO] [stdout] 128 | | } else { [INFO] [stdout] 129 | | None [INFO] [stdout] 130 | | } [INFO] [stdout] | |_________________^ help: try: `Self::get_cell_by_id_immut(x, id).map(|child| child)` [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: manual implementation of `Option::map` [INFO] [stdout] --> src/datacell/Datacell.rs:135:21 [INFO] [stdout] | [INFO] [stdout] 135 | / if let Some(child) = Self::get_cell_by_id_immut(x, id) { [INFO] [stdout] 136 | | Some(child) [INFO] [stdout] 137 | | } else { [INFO] [stdout] 138 | | None [INFO] [stdout] 139 | | } [INFO] [stdout] | |_____________________^ help: try: `Self::get_cell_by_id_immut(x, id).map(|child| child)` [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: manual implementation of `Option::map` [INFO] [stdout] --> src/datacell/Datacell.rs:98:17 [INFO] [stdout] | [INFO] [stdout] 98 | / if let Some(child) = Self::get_cell_by_id(x, id) { [INFO] [stdout] 99 | | Some(child) [INFO] [stdout] 100 | | } else { [INFO] [stdout] 101 | | None [INFO] [stdout] 102 | | } [INFO] [stdout] | |_________________^ help: try: `Self::get_cell_by_id(x, id).map(|child| child)` [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: this if-let expression is unnecessary [INFO] [stdout] --> src/datacell/Datacell.rs:135:21 [INFO] [stdout] | [INFO] [stdout] 135 | / if let Some(child) = Self::get_cell_by_id_immut(x, id) { [INFO] [stdout] 136 | | Some(child) [INFO] [stdout] 137 | | } else { [INFO] [stdout] 138 | | None [INFO] [stdout] 139 | | } [INFO] [stdout] | |_____________________^ help: replace it with: `Self::get_cell_by_id_immut(x, id)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/datacell/Datacell.rs:107:21 [INFO] [stdout] | [INFO] [stdout] 107 | / if let Some(child) = Self::get_cell_by_id(x, id) { [INFO] [stdout] 108 | | Some(child) [INFO] [stdout] 109 | | } else { [INFO] [stdout] 110 | | None [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________________^ help: try: `Self::get_cell_by_id(x, id).map(|child| child)` [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: this if-let expression is unnecessary [INFO] [stdout] --> src/datacell/Datacell.rs:107:21 [INFO] [stdout] | [INFO] [stdout] 107 | / if let Some(child) = Self::get_cell_by_id(x, id) { [INFO] [stdout] 108 | | Some(child) [INFO] [stdout] 109 | | } else { [INFO] [stdout] 110 | | None [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________________^ help: replace it with: `Self::get_cell_by_id(x, id)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_match [INFO] [stdout] = note: `#[warn(clippy::needless_match)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/datacell/Datacell.rs:158:24 [INFO] [stdout] | [INFO] [stdout] 158 | return parent.children.iter().nth(index - 1).cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] = note: `#[warn(clippy::iter_nth)]` on by default [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 158 - return parent.children.iter().nth(index - 1).cloned(); [INFO] [stdout] 158 + return parent.children.get(index - 1).cloned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/datacell/Datacell.rs:126:17 [INFO] [stdout] | [INFO] [stdout] 126 | / if let Some(child) = Self::get_cell_by_id_immut(x, id) { [INFO] [stdout] 127 | | Some(child) [INFO] [stdout] 128 | | } else { [INFO] [stdout] 129 | | None [INFO] [stdout] 130 | | } [INFO] [stdout] | |_________________^ help: try: `Self::get_cell_by_id_immut(x, id).map(|child| child)` [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: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/datacell/Datacell.rs:168:20 [INFO] [stdout] | [INFO] [stdout] 168 | return parent.children.iter().nth(index + 1).cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 168 - return parent.children.iter().nth(index + 1).cloned(); [INFO] [stdout] 168 + return parent.children.get(index + 1).cloned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/datacell/Datacell.rs:135:21 [INFO] [stdout] | [INFO] [stdout] 135 | / if let Some(child) = Self::get_cell_by_id_immut(x, id) { [INFO] [stdout] 136 | | Some(child) [INFO] [stdout] 137 | | } else { [INFO] [stdout] 138 | | None [INFO] [stdout] 139 | | } [INFO] [stdout] | |_____________________^ help: try: `Self::get_cell_by_id_immut(x, id).map(|child| child)` [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: this if-let expression is unnecessary [INFO] [stdout] --> src/datacell/Datacell.rs:135:21 [INFO] [stdout] | [INFO] [stdout] 135 | / if let Some(child) = Self::get_cell_by_id_immut(x, id) { [INFO] [stdout] 136 | | Some(child) [INFO] [stdout] 137 | | } else { [INFO] [stdout] 138 | | None [INFO] [stdout] 139 | | } [INFO] [stdout] | |_____________________^ help: replace it with: `Self::get_cell_by_id_immut(x, id)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_match [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/datacell/Datacell.rs:158:24 [INFO] [stdout] | [INFO] [stdout] 158 | return parent.children.iter().nth(index - 1).cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] = note: `#[warn(clippy::iter_nth)]` on by default [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 158 - return parent.children.iter().nth(index - 1).cloned(); [INFO] [stdout] 158 + return parent.children.get(index - 1).cloned(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.iter().nth()` on a `Vec` [INFO] [stdout] --> src/datacell/Datacell.rs:168:20 [INFO] [stdout] | [INFO] [stdout] 168 | return parent.children.iter().nth(index + 1).cloned(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth [INFO] [stdout] help: `get` is equivalent but more concise [INFO] [stdout] | [INFO] [stdout] 168 - return parent.children.iter().nth(index + 1).cloned(); [INFO] [stdout] 168 + return parent.children.get(index + 1).cloned(); [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/datacell/ElementCell.rs:41:13 [INFO] [stdout] | [INFO] [stdout] 41 | / match &mut tree.cell_type { [INFO] [stdout] 42 | | CellType::Element(ref mut el) => el.push_attribute(prop_line), [INFO] [stdout] 43 | | _ => (), [INFO] [stdout] 44 | | } [INFO] [stdout] | |_____________^ help: try: `if let CellType::Element(ref mut el) = &mut tree.cell_type { el.push_attribute(prop_line) }` [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/datacell/ElementCell.rs:41:13 [INFO] [stdout] | [INFO] [stdout] 41 | / match &mut tree.cell_type { [INFO] [stdout] 42 | | CellType::Element(ref mut el) => el.push_attribute(prop_line), [INFO] [stdout] 43 | | _ => (), [INFO] [stdout] 44 | | } [INFO] [stdout] | |_____________^ help: try: `if let CellType::Element(ref mut el) = &mut tree.cell_type { el.push_attribute(prop_line) }` [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/desugarer.rs:114:25 [INFO] [stdout] | [INFO] [stdout] 114 | &article_types, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `article_types` [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/desugarer.rs:119:83 [INFO] [stdout] | [INFO] [stdout] 119 | self.find_cell_and_mark_article(child, tag_names, cells, article, &article_types) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `article_types` [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/desugarer.rs:114:25 [INFO] [stdout] | [INFO] [stdout] 114 | &article_types, [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `article_types` [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/desugarer.rs:119:83 [INFO] [stdout] | [INFO] [stdout] 119 | self.find_cell_and_mark_article(child, tag_names, cells, article, &article_types) [INFO] [stdout] | ^^^^^^^^^^^^^^ help: change this to: `article_types` [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 `unwrap` on `handle` after checking its variant with `is_some` [INFO] [stdout] --> src/desugarer.rs:228:25 [INFO] [stdout] | [INFO] [stdout] 227 | if handle.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = handle` [INFO] [stdout] 228 | handle.unwrap().value.to_owned() + "<<" [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/desugarer.rs:212:70 [INFO] [stdout] | [INFO] [stdout] 212 | for (_, (article_id, element)) in elements.clone().iter_mut().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 212 - for (_, (article_id, element)) in elements.clone().iter_mut().enumerate() { [INFO] [stdout] 212 + for (article_id, element) in elements.clone().iter_mut() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/desugarer.rs:265:26 [INFO] [stdout] | [INFO] [stdout] 265 | pub fn wrap_children<'a>( [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: called `unwrap` on `handle` after checking its variant with `is_some` [INFO] [stdout] --> src/desugarer.rs:228:25 [INFO] [stdout] | [INFO] [stdout] 227 | if handle.is_some() { [INFO] [stdout] | ------------------- help: try: `if let Some() = handle` [INFO] [stdout] 228 | handle.unwrap().value.to_owned() + "<<" [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/desugarer.rs:212:70 [INFO] [stdout] | [INFO] [stdout] 212 | for (_, (article_id, element)) in elements.clone().iter_mut().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 212 - for (_, (article_id, element)) in elements.clone().iter_mut().enumerate() { [INFO] [stdout] 212 + for (article_id, element) in elements.clone().iter_mut() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/desugarer.rs:305:104 [INFO] [stdout] | [INFO] [stdout] 305 | fn wrap_element_children(&mut self, root: &mut DataCell, el: &T, ignore_elements: &Vec, wrap_wi... [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] 305 - fn wrap_element_children(&mut self, root: &mut DataCell, el: &T, ignore_elements: &Vec, wrap_with: &str) { [INFO] [stdout] 305 + fn wrap_element_children(&mut self, root: &mut DataCell, el: &T, ignore_elements: &[IgnoreOptions], wrap_with: &str) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this lifetime isn't used in the function definition [INFO] [stdout] --> src/desugarer.rs:265:26 [INFO] [stdout] | [INFO] [stdout] 265 | pub fn wrap_children<'a>( [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: the following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/desugarer.rs:411:27 [INFO] [stdout] | [INFO] [stdout] 411 | pub fn wrap_recursive<'a>(&self, root: &'a mut DataCell, wrap_with: &str) -> Desugarer { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 411 - pub fn wrap_recursive<'a>(&self, root: &'a mut DataCell, wrap_with: &str) -> Desugarer { [INFO] [stdout] 411 + pub fn wrap_recursive(&self, root: &mut DataCell, wrap_with: &str) -> Desugarer { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/desugarer.rs:305:104 [INFO] [stdout] | [INFO] [stdout] 305 | fn wrap_element_children(&mut self, root: &mut DataCell, el: &T, ignore_elements: &Vec, wrap_wi... [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] 305 - fn wrap_element_children(&mut self, root: &mut DataCell, el: &T, ignore_elements: &Vec, wrap_with: &str) { [INFO] [stdout] 305 + fn wrap_element_children(&mut self, root: &mut DataCell, el: &T, ignore_elements: &[IgnoreOptions], wrap_with: &str) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/desugarer.rs:457:52 [INFO] [stdout] | [INFO] [stdout] 457 | if Self::paragraph_first_child_is_text(&element) [INFO] [stdout] | ^^^^^^^^ help: change this to: `element` [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/desugarer.rs:524:36 [INFO] [stdout] | [INFO] [stdout] 524 | prev_el = Some(&child) [INFO] [stdout] | ^^^^^^ help: change this to: `child` [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 following explicit lifetimes could be elided: 'a [INFO] [stdout] --> src/desugarer.rs:411:27 [INFO] [stdout] | [INFO] [stdout] 411 | pub fn wrap_recursive<'a>(&self, root: &'a mut DataCell, wrap_with: &str) -> Desugarer { [INFO] [stdout] | ^^ ^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes [INFO] [stdout] = note: `#[warn(clippy::needless_lifetimes)]` on by default [INFO] [stdout] help: elide the lifetimes [INFO] [stdout] | [INFO] [stdout] 411 - pub fn wrap_recursive<'a>(&self, root: &'a mut DataCell, wrap_with: &str) -> Desugarer { [INFO] [stdout] 411 + pub fn wrap_recursive(&self, root: &mut DataCell, wrap_with: &str) -> Desugarer { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/desugarer.rs:560:45 [INFO] [stdout] | [INFO] [stdout] 560 | for (_, element) in _elements.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 560 - for (_, element) in _elements.iter().enumerate() { [INFO] [stdout] 560 + for element in _elements.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/desugarer.rs:457:52 [INFO] [stdout] | [INFO] [stdout] 457 | if Self::paragraph_first_child_is_text(&element) [INFO] [stdout] | ^^^^^^^^ help: change this to: `element` [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 `impl` can be derived [INFO] [stdout] --> src/element_text.rs:22:1 [INFO] [stdout] | [INFO] [stdout] 22 | / impl Default for DelimeterRules { [INFO] [stdout] 23 | | fn default() -> Self { [INFO] [stdout] 24 | | Self { [INFO] [stdout] 25 | | symbol: "", [INFO] [stdout] ... | [INFO] [stdout] 37 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 9 + #[derive(Default)] [INFO] [stdout] 10 | struct DelimeterRules { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/desugarer.rs:524:36 [INFO] [stdout] | [INFO] [stdout] 524 | prev_el = Some(&child) [INFO] [stdout] | ^^^^^^ help: change this to: `child` [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 use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/desugarer.rs:560:45 [INFO] [stdout] | [INFO] [stdout] 560 | for (_, element) in _elements.iter().enumerate() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 560 - for (_, element) in _elements.iter().enumerate() { [INFO] [stdout] 560 + for element in _elements.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/element_text.rs:118:53 [INFO] [stdout] | [INFO] [stdout] 118 | &self.find_closing_delimeter(i, &del.unwrap(), false); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `del.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/element_text.rs:123:37 [INFO] [stdout] | [INFO] [stdout] 123 | output.push_str(&del.unwrap().symbol); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `del.unwrap().symbol` [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/element_text.rs:124:59 [INFO] [stdout] | [INFO] [stdout] 124 | let nested_content = ElementText::new(&del_content).handle_delimeters(); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `del_content` [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/element_text.rs:132:38 [INFO] [stdout] | [INFO] [stdout] 132 | ElementText::new(&del_content).handle_delimeters() [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `del_content` [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/element_text.rs:141:50 [INFO] [stdout] | [INFO] [stdout] 141 | char_after_closing_del = &self.get_slice(i, i + 1).unwrap_or(""); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.get_slice(i, i + 1).unwrap_or("")` [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: comparison to empty slice [INFO] [stdout] --> src/element_text.rs:145:28 [INFO] [stdout] | [INFO] [stdout] 145 | && char_after_closing_del != "" [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!char_after_closing_del.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/element_text.rs:150:31 [INFO] [stdout] | [INFO] [stdout] 150 | while output.len() > 0 && output.chars().last().unwrap() != ' ' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!output.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: you should use the `ends_with` method [INFO] [stdout] --> src/element_text.rs:150:51 [INFO] [stdout] | [INFO] [stdout] 150 | while output.len() > 0 && output.chars().last().unwrap() != ' ' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!output.ends_with(' ')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] = note: `#[warn(clippy::chars_last_cmp)]` 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/element_text.rs:164:41 [INFO] [stdout] | [INFO] [stdout] 164 | output.push_str(&del.unwrap().symbol); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `del.unwrap().symbol` [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 `impl` can be derived [INFO] [stdout] --> src/element_text.rs:22:1 [INFO] [stdout] | [INFO] [stdout] 22 | / impl Default for DelimeterRules { [INFO] [stdout] 23 | | fn default() -> Self { [INFO] [stdout] 24 | | Self { [INFO] [stdout] 25 | | symbol: "", [INFO] [stdout] ... | [INFO] [stdout] 37 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute [INFO] [stdout] | [INFO] [stdout] 9 + #[derive(Default)] [INFO] [stdout] 10 | struct DelimeterRules { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/element_text.rs:170:41 [INFO] [stdout] | [INFO] [stdout] 170 | output.push_str(&del.unwrap().end_symbol); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `del.unwrap().end_symbol` [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: comparison to empty slice [INFO] [stdout] --> src/element_text.rs:176:28 [INFO] [stdout] | [INFO] [stdout] 176 | && char_after_closing_del != "" [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!char_after_closing_del.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/element_text.rs:182:32 [INFO] [stdout] | [INFO] [stdout] 182 | ... && self.get_char(i) != "" [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.get_char(i).is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/element_text.rs:219:53 [INFO] [stdout] | [INFO] [stdout] 219 | &self.find_closing_delimeter(i, &del.unwrap(), true); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `del.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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/element_text.rs:225:21 [INFO] [stdout] | [INFO] [stdout] 225 | / match last_child { [INFO] [stdout] 226 | | BlockChildType::Text(mut t) => { [INFO] [stdout] 227 | | t.content [INFO] [stdout] 228 | | .push_str(&format!("{}{}", &del.unwrap().symbol, del_content)); [INFO] [stdout] ... | [INFO] [stdout] 231 | | _ => (), [INFO] [stdout] 232 | | } [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] 225 ~ if let BlockChildType::Text(mut t) = last_child { [INFO] [stdout] 226 + t.content [INFO] [stdout] 227 + .push_str(&format!("{}{}", &del.unwrap().symbol, del_content)); [INFO] [stdout] 228 + output.push(BlockChildType::Text(t)) [INFO] [stdout] 229 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/element_text.rs:118:53 [INFO] [stdout] | [INFO] [stdout] 118 | &self.find_closing_delimeter(i, &del.unwrap(), false); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `del.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/element_text.rs:123:37 [INFO] [stdout] | [INFO] [stdout] 123 | output.push_str(&del.unwrap().symbol); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `del.unwrap().symbol` [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/element_text.rs:124:59 [INFO] [stdout] | [INFO] [stdout] 124 | let nested_content = ElementText::new(&del_content).handle_delimeters(); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `del_content` [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/element_text.rs:132:38 [INFO] [stdout] | [INFO] [stdout] 132 | ElementText::new(&del_content).handle_delimeters() [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `del_content` [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/element_text.rs:141:50 [INFO] [stdout] | [INFO] [stdout] 141 | char_after_closing_del = &self.get_slice(i, i + 1).unwrap_or(""); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `self.get_slice(i, i + 1).unwrap_or("")` [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: comparison to empty slice [INFO] [stdout] --> src/element_text.rs:145:28 [INFO] [stdout] | [INFO] [stdout] 145 | && char_after_closing_del != "" [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!char_after_closing_del.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/element_text.rs:150:31 [INFO] [stdout] | [INFO] [stdout] 150 | while output.len() > 0 && output.chars().last().unwrap() != ' ' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!output.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: you should use the `ends_with` method [INFO] [stdout] --> src/element_text.rs:150:51 [INFO] [stdout] | [INFO] [stdout] 150 | while output.len() > 0 && output.chars().last().unwrap() != ' ' { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: like this: `!output.ends_with(' ')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#chars_last_cmp [INFO] [stdout] = note: `#[warn(clippy::chars_last_cmp)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `_del` after checking its variant with `is_some` [INFO] [stdout] --> src/element_text.rs:330:35 [INFO] [stdout] | [INFO] [stdout] 323 | if _del.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = _del` [INFO] [stdout] ... [INFO] [stdout] 330 | .skip(i - _del.unwrap().symbol.len()) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/element_text.rs:164:41 [INFO] [stdout] | [INFO] [stdout] 164 | output.push_str(&del.unwrap().symbol); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: change this to: `del.unwrap().symbol` [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/element_text.rs:170:41 [INFO] [stdout] | [INFO] [stdout] 170 | output.push_str(&del.unwrap().end_symbol); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `del.unwrap().end_symbol` [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: comparison to empty slice [INFO] [stdout] --> src/element_text.rs:176:28 [INFO] [stdout] | [INFO] [stdout] 176 | && char_after_closing_del != "" [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!char_after_closing_del.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/element_text.rs:182:32 [INFO] [stdout] | [INFO] [stdout] 182 | ... && self.get_char(i) != "" [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.get_char(i).is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `_del` after checking its variant with `is_some` [INFO] [stdout] --> src/element_text.rs:339:32 [INFO] [stdout] | [INFO] [stdout] 323 | if _del.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = _del` [INFO] [stdout] ... [INFO] [stdout] 339 | found_symbol = _del.unwrap().symbol; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/element_text.rs:307:21 [INFO] [stdout] | [INFO] [stdout] 307 | / d.symbol [INFO] [stdout] 308 | | == &self [INFO] [stdout] 309 | | .text [INFO] [stdout] 310 | | .chars() [INFO] [stdout] 311 | | .take(i) [INFO] [stdout] 312 | | .skip(i - d.symbol.len()) [INFO] [stdout] 313 | | .collect::() [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] help: use the right value directly [INFO] [stdout] | [INFO] [stdout] 308 ~ == self [INFO] [stdout] 309 + .text [INFO] [stdout] 310 + .chars() [INFO] [stdout] 311 + .take(i) [INFO] [stdout] 312 + .skip(i - d.symbol.len()) [INFO] [stdout] 313 + .collect::() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` branch is empty [INFO] [stdout] --> src/element_text.rs:340:17 [INFO] [stdout] | [INFO] [stdout] 340 | if !has_multi_char {} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: you can remove it [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_ifs [INFO] [stdout] = note: `#[warn(clippy::needless_ifs)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/element_text.rs:382:28 [INFO] [stdout] | [INFO] [stdout] 382 | let is_found = end_symbol [INFO] [stdout] | ____________________________^ [INFO] [stdout] 383 | | == &self [INFO] [stdout] 384 | | .text [INFO] [stdout] 385 | | .chars() [INFO] [stdout] 386 | | .take(i + end_symbol.len()) [INFO] [stdout] 387 | | .skip(i) [INFO] [stdout] 388 | | .collect::() [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] help: use the right value directly [INFO] [stdout] | [INFO] [stdout] 383 ~ == self [INFO] [stdout] 384 + .text [INFO] [stdout] 385 + .chars() [INFO] [stdout] 386 + .take(i + end_symbol.len()) [INFO] [stdout] 387 + .skip(i) [INFO] [stdout] 388 + .collect::() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/element_text.rs:219:53 [INFO] [stdout] | [INFO] [stdout] 219 | &self.find_closing_delimeter(i, &del.unwrap(), true); [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `del.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: taken reference of right operand [INFO] [stdout] --> src/element_text.rs:394:21 [INFO] [stdout] | [INFO] [stdout] 394 | if (end_symbol [INFO] [stdout] | _____________________^ [INFO] [stdout] 395 | | != &self [INFO] [stdout] 396 | | .text [INFO] [stdout] 397 | | .chars() [INFO] [stdout] 398 | | .take(i + end_symbol.len()) [INFO] [stdout] 399 | | .skip(i) [INFO] [stdout] 400 | | .collect::() [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] help: use the right value directly [INFO] [stdout] | [INFO] [stdout] 395 ~ != self [INFO] [stdout] 396 + .text [INFO] [stdout] 397 + .chars() [INFO] [stdout] 398 + .take(i + end_symbol.len()) [INFO] [stdout] 399 + .skip(i) [INFO] [stdout] 400 + .collect::() [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/element_text.rs:225:21 [INFO] [stdout] | [INFO] [stdout] 225 | / match last_child { [INFO] [stdout] 226 | | BlockChildType::Text(mut t) => { [INFO] [stdout] 227 | | t.content [INFO] [stdout] 228 | | .push_str(&format!("{}{}", &del.unwrap().symbol, del_content)); [INFO] [stdout] ... | [INFO] [stdout] 231 | | _ => (), [INFO] [stdout] 232 | | } [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] 225 ~ if let BlockChildType::Text(mut t) = last_child { [INFO] [stdout] 226 + t.content [INFO] [stdout] 227 + .push_str(&format!("{}{}", &del.unwrap().symbol, del_content)); [INFO] [stdout] 228 + output.push(BlockChildType::Text(t)) [INFO] [stdout] 229 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/element_text.rs:401:54 [INFO] [stdout] | [INFO] [stdout] 401 | && !self.escape_before_symbol(i, &end_symbol)) [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `end_symbol` [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: taken reference of right operand [INFO] [stdout] --> src/element_text.rs:417:18 [INFO] [stdout] | [INFO] [stdout] 417 | ) && next_char != &end_symbol [INFO] [stdout] | ^^^^^^^^^^^^^----------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `end_symbol` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/element_text.rs:427:21 [INFO] [stdout] | [INFO] [stdout] 427 | del_content.push_str("\\"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `del_content.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] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `_del` after checking its variant with `is_some` [INFO] [stdout] --> src/element_text.rs:330:35 [INFO] [stdout] | [INFO] [stdout] 323 | if _del.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = _del` [INFO] [stdout] ... [INFO] [stdout] 330 | .skip(i - _del.unwrap().symbol.len()) [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `_del` after checking its variant with `is_some` [INFO] [stdout] --> src/element_text.rs:339:32 [INFO] [stdout] | [INFO] [stdout] 323 | if _del.is_some() { [INFO] [stdout] | ----------------- help: try: `if let Some() = _del` [INFO] [stdout] ... [INFO] [stdout] 339 | found_symbol = _del.unwrap().symbol; [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/element_text.rs:307:21 [INFO] [stdout] | [INFO] [stdout] 307 | / d.symbol [INFO] [stdout] 308 | | == &self [INFO] [stdout] 309 | | .text [INFO] [stdout] 310 | | .chars() [INFO] [stdout] 311 | | .take(i) [INFO] [stdout] 312 | | .skip(i - d.symbol.len()) [INFO] [stdout] 313 | | .collect::() [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] help: use the right value directly [INFO] [stdout] | [INFO] [stdout] 308 ~ == self [INFO] [stdout] 309 + .text [INFO] [stdout] 310 + .chars() [INFO] [stdout] 311 + .take(i) [INFO] [stdout] 312 + .skip(i - d.symbol.len()) [INFO] [stdout] 313 + .collect::() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` branch is empty [INFO] [stdout] --> src/element_text.rs:340:17 [INFO] [stdout] | [INFO] [stdout] 340 | if !has_multi_char {} [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ help: you can remove it [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_ifs [INFO] [stdout] = note: `#[warn(clippy::needless_ifs)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/element_text.rs:382:28 [INFO] [stdout] | [INFO] [stdout] 382 | let is_found = end_symbol [INFO] [stdout] | ____________________________^ [INFO] [stdout] 383 | | == &self [INFO] [stdout] 384 | | .text [INFO] [stdout] 385 | | .chars() [INFO] [stdout] 386 | | .take(i + end_symbol.len()) [INFO] [stdout] 387 | | .skip(i) [INFO] [stdout] 388 | | .collect::() [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] help: use the right value directly [INFO] [stdout] | [INFO] [stdout] 383 ~ == self [INFO] [stdout] 384 + .text [INFO] [stdout] 385 + .chars() [INFO] [stdout] 386 + .take(i + end_symbol.len()) [INFO] [stdout] 387 + .skip(i) [INFO] [stdout] 388 + .collect::() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/emitter.rs:67:21 [INFO] [stdout] | [INFO] [stdout] 67 | .enumerate() [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 67 ~ [INFO] [stdout] 68 ~ .for_each(|child| match child { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: taken reference of right operand [INFO] [stdout] --> src/element_text.rs:394:21 [INFO] [stdout] | [INFO] [stdout] 394 | if (end_symbol [INFO] [stdout] | _____________________^ [INFO] [stdout] 395 | | != &self [INFO] [stdout] 396 | | .text [INFO] [stdout] 397 | | .chars() [INFO] [stdout] 398 | | .take(i + end_symbol.len()) [INFO] [stdout] 399 | | .skip(i) [INFO] [stdout] 400 | | .collect::() [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] help: use the right value directly [INFO] [stdout] | [INFO] [stdout] 395 ~ != self [INFO] [stdout] 396 + .text [INFO] [stdout] 397 + .chars() [INFO] [stdout] 398 + .take(i + end_symbol.len()) [INFO] [stdout] 399 + .skip(i) [INFO] [stdout] 400 + .collect::() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/emitter.rs:73:36 [INFO] [stdout] | [INFO] [stdout] 73 | ... if let Some(_) = &dl.wrapped_with { [INFO] [stdout] | -------^^^^^^^------------------- help: try: `if dl.wrapped_with.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` 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/element_text.rs:401:54 [INFO] [stdout] | [INFO] [stdout] 401 | && !self.escape_before_symbol(i, &end_symbol)) [INFO] [stdout] | ^^^^^^^^^^^ help: change this to: `end_symbol` [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/emitter.rs:78:57 [INFO] [stdout] | [INFO] [stdout] 78 | ... text_block.push_str(&&text_el.handle_delimeters()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `(&text_el.handle_delimeters())` [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: taken reference of right operand [INFO] [stdout] --> src/element_text.rs:417:18 [INFO] [stdout] | [INFO] [stdout] 417 | ) && next_char != &end_symbol [INFO] [stdout] | ^^^^^^^^^^^^^----------- [INFO] [stdout] | | [INFO] [stdout] | help: use the right value directly: `end_symbol` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#op_ref [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/element_text.rs:427:21 [INFO] [stdout] | [INFO] [stdout] 427 | del_content.push_str("\\"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `del_content.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] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/emitter.rs:131:37 [INFO] [stdout] | [INFO] [stdout] 131 | if el.name.contains(&split_children_of) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `split_children_of` [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: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/emitter.rs:67:21 [INFO] [stdout] | [INFO] [stdout] 67 | .enumerate() [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unused_enumerate_index [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 67 ~ [INFO] [stdout] 68 ~ .for_each(|child| match child { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/emitter.rs:73:36 [INFO] [stdout] | [INFO] [stdout] 73 | ... if let Some(_) = &dl.wrapped_with { [INFO] [stdout] | -------^^^^^^^------------------- help: try: `if dl.wrapped_with.is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` 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/emitter.rs:78:57 [INFO] [stdout] | [INFO] [stdout] 78 | ... text_block.push_str(&&text_el.handle_delimeters()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `(&text_el.handle_delimeters())` [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: implementation of inherent method `to_string(&self) -> String` for type `parser::ParserError` [INFO] [stdout] --> src/parser.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | / pub fn to_string(&self) -> String { [INFO] [stdout] 25 | | match self { [INFO] [stdout] 26 | | ParserError::ExtraSpacesError(line) => format!("Extra spaces found on line {}", line), [INFO] [stdout] 27 | | ParserError::None4xSpacesError(line) => { [INFO] [stdout] ... | [INFO] [stdout] 31 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `parser::ParserError` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser.rs:35:49 [INFO] [stdout] | [INFO] [stdout] 35 | ParserError::ExtraSpacesError(_) => format!("Extra spaces found"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Extra spaces found".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: useless use of `format!` [INFO] [stdout] --> src/parser.rs:37:17 [INFO] [stdout] | [INFO] [stdout] 37 | format!("None 4x spaces found") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"None 4x spaces found".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: you should consider adding a `Default` implementation for `Parser` [INFO] [stdout] --> src/parser.rs:44:5 [INFO] [stdout] | [INFO] [stdout] 44 | / pub fn new() -> Parser { [INFO] [stdout] 45 | | Self { [INFO] [stdout] 46 | | result: DataCell { [INFO] [stdout] 47 | | parent_id: 0, [INFO] [stdout] ... | [INFO] [stdout] 53 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 43 + impl Default for Parser { [INFO] [stdout] 44 + fn default() -> Self { [INFO] [stdout] 45 + Self::new() [INFO] [stdout] 46 + } [INFO] [stdout] 47 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/emitter.rs:131:37 [INFO] [stdout] | [INFO] [stdout] 131 | if el.name.contains(&split_children_of) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: change this to: `split_children_of` [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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/parser.rs:55:30 [INFO] [stdout] | [INFO] [stdout] 55 | pub fn import_json(json: &String) -> 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] 55 ~ pub fn import_json(json: &str) -> String { [INFO] [stdout] 56 ~ json.to_owned() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/parser.rs:91:60 [INFO] [stdout] | [INFO] [stdout] 91 | fn props_end(&mut self, trimmed_line: &str, tag_stack: &Vec) -> bool { [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] 91 - fn props_end(&mut self, trimmed_line: &str, tag_stack: &Vec) -> bool { [INFO] [stdout] 91 + fn props_end(&mut self, trimmed_line: &str, tag_stack: &[TagInfo]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/parser.rs:93:12 [INFO] [stdout] | [INFO] [stdout] 93 | && tag_stack [INFO] [stdout] | ____________^ [INFO] [stdout] 94 | | .last() [INFO] [stdout] 95 | | .map_or(false, |tag| tag.in_props && !tag.is_self_closing) [INFO] [stdout] | |______________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 95 - .map_or(false, |tag| tag.in_props && !tag.is_self_closing) [INFO] [stdout] 95 + .is_some_and(|tag| tag.in_props && !tag.is_self_closing) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/parser.rs:111:17 [INFO] [stdout] | [INFO] [stdout] 111 | lines_to_skip = lines_to_skip - 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `lines_to_skip -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function call inside of `expect` [INFO] [stdout] --> src/parser.rs:151:22 [INFO] [stdout] | [INFO] [stdout] 151 | .expect(&format!("There is no parent tag . at line \n {:?}", index)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("There is no parent tag . at line \n {:?}", index))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/parser.rs:163:40 [INFO] [stdout] | [INFO] [stdout] 163 | let next_line_indent = if let Some(next_line) = next_line { [INFO] [stdout] | ________________________________________^ [INFO] [stdout] 164 | | Some(get_line_indent(next_line)) [INFO] [stdout] 165 | | } else { [INFO] [stdout] 166 | | None [INFO] [stdout] 167 | | }; [INFO] [stdout] | |_________________^ help: try: `next_line.map(|next_line| get_line_indent(next_line))` [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: comparison to empty slice [INFO] [stdout] --> src/parser.rs:181:28 [INFO] [stdout] | [INFO] [stdout] 181 | if text_node == "" { "" } else { " " }, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `text_node.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/parser.rs:206:32 [INFO] [stdout] | [INFO] [stdout] 206 | ... if text.content != "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!text.content.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: implementation of inherent method `to_string(&self) -> String` for type `parser::ParserError` [INFO] [stdout] --> src/parser.rs:24:5 [INFO] [stdout] | [INFO] [stdout] 24 | / pub fn to_string(&self) -> String { [INFO] [stdout] 25 | | match self { [INFO] [stdout] 26 | | ParserError::ExtraSpacesError(line) => format!("Extra spaces found on line {}", line), [INFO] [stdout] 27 | | ParserError::None4xSpacesError(line) => { [INFO] [stdout] ... | [INFO] [stdout] 31 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: implement trait `Display` for type `parser::ParserError` instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#inherent_to_string [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/parser.rs:236:24 [INFO] [stdout] | [INFO] [stdout] 236 | if text_node == "" { "" } else { " " }, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `text_node.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/parser.rs:244:21 [INFO] [stdout] | [INFO] [stdout] 244 | text_node.push_str("\n") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `text_node.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless use of `format!` [INFO] [stdout] --> src/parser.rs:35:49 [INFO] [stdout] | [INFO] [stdout] 35 | ParserError::ExtraSpacesError(_) => format!("Extra spaces found"), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"Extra spaces found".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: useless use of `format!` [INFO] [stdout] --> src/parser.rs:37:17 [INFO] [stdout] | [INFO] [stdout] 37 | format!("None 4x spaces found") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.to_string()`: `"None 4x spaces found".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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/parser.rs:252:40 [INFO] [stdout] | [INFO] [stdout] 252 | fn get_parent_id(&self, tag_stack: &Vec) -> Option { [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] 252 - fn get_parent_id(&self, tag_stack: &Vec) -> Option { [INFO] [stdout] 252 + fn get_parent_id(&self, tag_stack: &[TagInfo]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/parser.rs:254:9 [INFO] [stdout] | [INFO] [stdout] 254 | / if before_last_index.is_none() { [INFO] [stdout] 255 | | return None; [INFO] [stdout] 256 | | } [INFO] [stdout] | |_________^ help: replace it with: `before_last_index?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `Parser` [INFO] [stdout] --> src/parser.rs:44:5 [INFO] [stdout] | [INFO] [stdout] 44 | / pub fn new() -> Parser { [INFO] [stdout] 45 | | Self { [INFO] [stdout] 46 | | result: DataCell { [INFO] [stdout] 47 | | parent_id: 0, [INFO] [stdout] ... | [INFO] [stdout] 53 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 43 + impl Default for Parser { [INFO] [stdout] 44 + fn default() -> Self { [INFO] [stdout] 45 + Self::new() [INFO] [stdout] 46 + } [INFO] [stdout] 47 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/parser.rs:258:9 [INFO] [stdout] | [INFO] [stdout] 258 | / if let Some(before_last) = tag_stack.get(before_last_index) { [INFO] [stdout] 259 | | Some(before_last.id) [INFO] [stdout] 260 | | } else { [INFO] [stdout] 261 | | None [INFO] [stdout] 262 | | } [INFO] [stdout] | |_________^ help: try: `tag_stack.get(before_last_index).map(|before_last| before_last.id)` [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: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/parser.rs:55:30 [INFO] [stdout] | [INFO] [stdout] 55 | pub fn import_json(json: &String) -> 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] 55 ~ pub fn import_json(json: &str) -> String { [INFO] [stdout] 56 ~ json.to_owned() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/parser.rs:91:60 [INFO] [stdout] | [INFO] [stdout] 91 | fn props_end(&mut self, trimmed_line: &str, tag_stack: &Vec) -> bool { [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] 91 - fn props_end(&mut self, trimmed_line: &str, tag_stack: &Vec) -> bool { [INFO] [stdout] 91 + fn props_end(&mut self, trimmed_line: &str, tag_stack: &[TagInfo]) -> bool { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/parser.rs:93:12 [INFO] [stdout] | [INFO] [stdout] 93 | && tag_stack [INFO] [stdout] | ____________^ [INFO] [stdout] 94 | | .last() [INFO] [stdout] 95 | | .map_or(false, |tag| tag.in_props && !tag.is_self_closing) [INFO] [stdout] | |______________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 95 - .map_or(false, |tag| tag.in_props && !tag.is_self_closing) [INFO] [stdout] 95 + .is_some_and(|tag| tag.in_props && !tag.is_self_closing) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:48:37 [INFO] [stdout] | [INFO] [stdout] 48 | let mut file = match File::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: manual implementation of an assign operation [INFO] [stdout] --> src/parser.rs:111:17 [INFO] [stdout] | [INFO] [stdout] 111 | lines_to_skip = lines_to_skip - 1; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `lines_to_skip -= 1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/main.rs:57:5 [INFO] [stdout] | [INFO] [stdout] 57 | / match file.read_to_string(&mut contents) { [INFO] [stdout] 58 | | Err(why) => panic!("Could not read {}: {}", path.display(), why), [INFO] [stdout] 59 | | Ok(_) => (), [INFO] [stdout] 60 | | } [INFO] [stdout] | |_____^ help: try: `if let Err(why) = file.read_to_string(&mut contents) { panic!("Could not read {}: {}", path.display(), why) }` [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: function call inside of `expect` [INFO] [stdout] --> src/parser.rs:151:22 [INFO] [stdout] | [INFO] [stdout] 151 | .expect(&format!("There is no parent tag . at line \n {:?}", index)); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| panic!("There is no parent tag . at line \n {:?}", index))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#expect_fun_call [INFO] [stdout] = note: `#[warn(clippy::expect_fun_call)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/parser.rs:163:40 [INFO] [stdout] | [INFO] [stdout] 163 | let next_line_indent = if let Some(next_line) = next_line { [INFO] [stdout] | ________________________________________^ [INFO] [stdout] 164 | | Some(get_line_indent(next_line)) [INFO] [stdout] 165 | | } else { [INFO] [stdout] 166 | | None [INFO] [stdout] 167 | | }; [INFO] [stdout] | |_________________^ help: try: `next_line.map(|next_line| get_line_indent(next_line))` [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: comparison to empty slice [INFO] [stdout] --> src/parser.rs:181:28 [INFO] [stdout] | [INFO] [stdout] 181 | if text_node == "" { "" } else { " " }, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `text_node.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/parser.rs:206:32 [INFO] [stdout] | [INFO] [stdout] 206 | ... if text.content != "" { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!text.content.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: comparison to empty slice [INFO] [stdout] --> src/parser.rs:236:24 [INFO] [stdout] | [INFO] [stdout] 236 | if text_node == "" { "" } else { " " }, [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `text_node.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: calling `push_str()` using a single-character string literal [INFO] [stdout] --> src/parser.rs:244:21 [INFO] [stdout] | [INFO] [stdout] 244 | text_node.push_str("\n") [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `push` with a character literal: `text_node.push('\n')` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_char_add_str [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/parser.rs:252:40 [INFO] [stdout] | [INFO] [stdout] 252 | fn get_parent_id(&self, tag_stack: &Vec) -> Option { [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] 252 - fn get_parent_id(&self, tag_stack: &Vec) -> Option { [INFO] [stdout] 252 + fn get_parent_id(&self, tag_stack: &[TagInfo]) -> Option { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this block may be rewritten with the `?` operator [INFO] [stdout] --> src/parser.rs:254:9 [INFO] [stdout] | [INFO] [stdout] 254 | / if before_last_index.is_none() { [INFO] [stdout] 255 | | return None; [INFO] [stdout] 256 | | } [INFO] [stdout] | |_________^ help: replace it with: `before_last_index?;` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module `BlockCell` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:1:9 [INFO] [stdout] | [INFO] [stdout] 1 | pub mod BlockCell; [INFO] [stdout] | ^^^^^^^^^ help: convert the identifier to snake case: `block_cell` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module `BlockChildType` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | pub mod BlockChildType; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: convert the identifier to snake case: `block_child_type` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module `CellTrait` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:3:9 [INFO] [stdout] | [INFO] [stdout] 3 | pub mod CellTrait; [INFO] [stdout] | ^^^^^^^^^ help: convert the identifier to snake case: `cell_trait` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module `Datacell` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:4:9 [INFO] [stdout] | [INFO] [stdout] 4 | pub mod Datacell; [INFO] [stdout] | ^^^^^^^^ help: convert the identifier to snake case: `datacell` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module `ElementCell` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:5:9 [INFO] [stdout] | [INFO] [stdout] 5 | pub mod ElementCell; [INFO] [stdout] | ^^^^^^^^^^^ help: convert the identifier to snake case: `element_cell` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/parser.rs:258:9 [INFO] [stdout] | [INFO] [stdout] 258 | / if let Some(before_last) = tag_stack.get(before_last_index) { [INFO] [stdout] 259 | | Some(before_last.id) [INFO] [stdout] 260 | | } else { [INFO] [stdout] 261 | | None [INFO] [stdout] 262 | | } [INFO] [stdout] | |_________^ help: try: `tag_stack.get(before_last_index).map(|before_last| before_last.id)` [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: the borrowed expression implements the required traits [INFO] [stdout] --> src/main.rs:48:37 [INFO] [stdout] | [INFO] [stdout] 48 | let mut file = match File::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: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/main.rs:57:5 [INFO] [stdout] | [INFO] [stdout] 57 | / match file.read_to_string(&mut contents) { [INFO] [stdout] 58 | | Err(why) => panic!("Could not read {}: {}", path.display(), why), [INFO] [stdout] 59 | | Ok(_) => (), [INFO] [stdout] 60 | | } [INFO] [stdout] | |_____^ help: try: `if let Err(why) = file.read_to_string(&mut contents) { panic!("Could not read {}: {}", path.display(), why) }` [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: module `BlockCell` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:1:9 [INFO] [stdout] | [INFO] [stdout] 1 | pub mod BlockCell; [INFO] [stdout] | ^^^^^^^^^ help: convert the identifier to snake case: `block_cell` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` (part of `#[warn(nonstandard_style)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module `BlockChildType` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | pub mod BlockChildType; [INFO] [stdout] | ^^^^^^^^^^^^^^ help: convert the identifier to snake case: `block_child_type` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module `CellTrait` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:3:9 [INFO] [stdout] | [INFO] [stdout] 3 | pub mod CellTrait; [INFO] [stdout] | ^^^^^^^^^ help: convert the identifier to snake case: `cell_trait` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module `Datacell` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:4:9 [INFO] [stdout] | [INFO] [stdout] 4 | pub mod Datacell; [INFO] [stdout] | ^^^^^^^^ help: convert the identifier to snake case: `datacell` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: module `ElementCell` should have a snake case name [INFO] [stdout] --> src/datacell/mod.rs:5:9 [INFO] [stdout] | [INFO] [stdout] 5 | pub mod ElementCell; [INFO] [stdout] | ^^^^^^^^^^^ help: convert the identifier to snake case: `element_cell` [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 02s [INFO] running `Command { std: "docker" "inspect" "dcf4e484216974171e6d464fa14468c3a253ab2dc0010db85604bd047610f265", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "dcf4e484216974171e6d464fa14468c3a253ab2dc0010db85604bd047610f265", kill_on_drop: false }` [INFO] [stdout] dcf4e484216974171e6d464fa14468c3a253ab2dc0010db85604bd047610f265