[INFO] cloning repository https://github.com/mzerrey0hp/revw [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mzerrey0hp/revw" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmzerrey0hp%2Frevw", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmzerrey0hp%2Frevw'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 64006cfd024617040f2efd774e59d64959fb7ecf [INFO] linting mzerrey0hp/revw against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmzerrey0hp%2Frevw" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/mzerrey0hp/revw [INFO] finished tweaking git repo https://github.com/mzerrey0hp/revw [INFO] tweaked toml for git repo https://github.com/mzerrey0hp/revw written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/mzerrey0hp/revw on toolchain nightly [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/mzerrey0hp/revw 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] Blocking waiting for file lock on package cache [INFO] [stderr] Updating crates.io index [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded unicode-truncate v2.0.0 [INFO] [stderr] Downloaded plist v1.8.0 [INFO] [stderr] Downloaded thin-slice v0.1.1 [INFO] [stderr] Downloaded vtparse v0.6.2 [INFO] [stderr] Downloaded filedescriptor v0.8.3 [INFO] [stderr] Downloaded pathfinder_geometry v0.5.1 [INFO] [stderr] Downloaded wezterm-dynamic-derive v0.1.1 [INFO] [stderr] Downloaded unicode-canonical-combining-class v0.5.0 [INFO] [stderr] Downloaded phf_macros v0.8.0 [INFO] [stderr] Downloaded servo_arc v0.1.1 [INFO] [stderr] Downloaded atomic v0.6.1 [INFO] [stderr] Downloaded error-code v3.3.2 [INFO] [stderr] Downloaded unicode-joining-type v0.7.0 [INFO] [stderr] Downloaded clipboard-win v5.4.1 [INFO] [stderr] Downloaded pathfinder_simd v0.5.5 [INFO] [stderr] Downloaded arboard v3.6.1 [INFO] [stderr] Downloaded unicode-general-category v0.6.0 [INFO] [stderr] Downloaded objc2-core-graphics v0.3.2 [INFO] [stderr] Downloaded azul-css v0.0.5 [INFO] [stderr] Downloaded zune-jpeg v0.5.7 [INFO] [stderr] Downloaded ttf-parser v0.15.2 [INFO] [stderr] Downloaded pest v2.8.4 [INFO] [stderr] Downloaded ratatui-core v0.1.0 [INFO] [stderr] Downloaded brotli-decompressor v4.0.3 [INFO] [stderr] Downloaded azul-core v0.0.5 [INFO] [stderr] Downloaded ratatui-widgets v0.3.0 [INFO] [stderr] Downloaded wezterm-bidi v0.2.3 [INFO] [stderr] Downloaded write-fonts v0.43.0 [INFO] [stderr] Downloaded azul-layout v0.0.5 [INFO] [stderr] Downloaded rangemap v1.7.0 [INFO] [stderr] Downloaded resvg v0.45.1 [INFO] [stderr] Downloaded svg2pdf v0.13.0 [INFO] [stderr] Downloaded fancy-regex v0.11.0 [INFO] [stderr] Downloaded allsorts-subset-browser v0.16.0 [INFO] [stderr] Downloaded finl_unicode v1.4.0 [INFO] [stderr] Downloaded termwiz v0.23.3 [INFO] [stderr] Downloaded allsorts v0.16.1 [INFO] [stderr] Downloaded compact_str v0.9.0 [INFO] [stderr] Downloaded fancy-regex v0.16.2 [INFO] [stderr] Downloaded cssparser v0.27.2 [INFO] [stderr] Downloaded nom_locate v4.2.0 [INFO] [stderr] Downloaded objc2-app-kit v0.3.2 [INFO] [stderr] Downloaded glyph-names v0.2.0 [INFO] [stderr] Downloaded rust-fontconfig v1.2.1 [INFO] [stderr] Downloaded subsetter v0.2.3 [INFO] [stderr] Downloaded pest_meta v2.8.4 [INFO] [stderr] Downloaded pest_derive v2.8.4 [INFO] [stderr] Downloaded terminfo v0.9.0 [INFO] [stderr] Downloaded fancy-regex v0.13.0 [INFO] [stderr] Downloaded gl-context-loader v0.1.10 [INFO] [stderr] Downloaded roxmltree v0.14.1 [INFO] [stderr] Downloaded selectors v0.22.0 [INFO] [stderr] Downloaded unicode-general-category v1.1.0 [INFO] [stderr] Downloaded gif v0.14.1 [INFO] [stderr] Downloaded zune-core v0.5.0 [INFO] [stderr] Downloaded syntect v5.3.0 [INFO] [stderr] Downloaded unicode-joining-type v1.0.0 [INFO] [stderr] Downloaded highway v0.8.1 [INFO] [stderr] Downloaded kuchiki v0.8.1 [INFO] [stderr] Downloaded ratatui-crossterm v0.1.0 [INFO] [stderr] Downloaded lab v0.11.0 [INFO] [stderr] Downloaded pxfm v0.1.27 [INFO] [stderr] Downloaded csscolorparser v0.6.2 [INFO] [stderr] Downloaded wezterm-input-types v0.1.0 [INFO] [stderr] Downloaded kasuari v0.4.11 [INFO] [stderr] Downloaded cbc v0.1.2 [INFO] [stderr] Downloaded mmapio v0.9.1 [INFO] [stderr] Downloaded ratatui-macros v0.7.0 [INFO] [stderr] Downloaded wezterm-dynamic v0.2.1 [INFO] [stderr] Downloaded ratatui-termwiz v0.1.0 [INFO] [stderr] Downloaded lru v0.16.2 [INFO] [stderr] Downloaded objc2-io-surface v0.3.2 [INFO] [stderr] Downloaded azul-simplecss v0.1.2 [INFO] [stderr] Downloaded bitreader v0.3.11 [INFO] [stderr] Downloaded unicode-canonical-combining-class v1.0.0 [INFO] [stderr] Downloaded wezterm-blob-leases v0.1.1 [INFO] [stderr] Downloaded memmem v0.1.1 [INFO] [stderr] Downloaded mac_address v1.1.8 [INFO] [stderr] Downloaded wezterm-color-types v0.3.0 [INFO] [stderr] Downloaded line-clipping v0.3.5 [INFO] [stderr] Downloaded pest_generator v2.8.4 [INFO] [stderr] Downloaded ratatui v0.30.0 [INFO] [stderr] Downloaded deltae v0.3.2 [INFO] [stderr] Downloaded pdf-writer v0.12.1 [INFO] [stderr] Downloaded tiktoken-rs v0.9.1 [INFO] [stderr] Downloaded printpdf v0.8.2 [INFO] [stderr] Downloaded lopdf v0.35.0 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] d060dea2d29613ed07713e2a8988380e94d1f067a44e2c28c5969a8d93e7721c [INFO] running `Command { std: "docker" "start" "-a" "d060dea2d29613ed07713e2a8988380e94d1f067a44e2c28c5969a8d93e7721c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "d060dea2d29613ed07713e2a8988380e94d1f067a44e2c28c5969a8d93e7721c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d060dea2d29613ed07713e2a8988380e94d1f067a44e2c28c5969a8d93e7721c", kill_on_drop: false }` [INFO] [stdout] d060dea2d29613ed07713e2a8988380e94d1f067a44e2c28c5969a8d93e7721c [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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] 85db5d768c9928032f8ab20606cec01f695ff531cf62f9e71a33a8da1c8a9a07 [INFO] running `Command { std: "docker" "start" "-a" "85db5d768c9928032f8ab20606cec01f695ff531cf62f9e71a33a8da1c8a9a07", kill_on_drop: false }` [INFO] [stderr] Compiling syn v1.0.109 [INFO] [stderr] Compiling getrandom v0.1.16 [INFO] [stderr] Compiling libc v0.2.178 [INFO] [stderr] Compiling bytemuck_derive v1.10.2 [INFO] [stderr] Compiling zerocopy v0.8.31 [INFO] [stderr] Checking foldhash v0.2.0 [INFO] [stderr] Checking memchr v2.7.6 [INFO] [stderr] Checking flate2 v1.1.5 [INFO] [stderr] Compiling serde v1.0.228 [INFO] [stderr] Checking hashbrown v0.16.1 [INFO] [stderr] Compiling phf_shared v0.8.0 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Checking tinyvec v1.10.0 [INFO] [stderr] Checking generic-array v0.14.7 [INFO] [stderr] Compiling proc-macro-error-attr v1.0.4 [INFO] [stderr] Compiling semver v1.0.27 [INFO] [stderr] Compiling rustc_version v0.4.1 [INFO] [stderr] Compiling thiserror-impl v2.0.17 [INFO] [stderr] Compiling rand_core v0.5.1 [INFO] [stderr] Compiling proc-macro-error v1.0.4 [INFO] [stderr] Compiling proc-macro-hack v0.5.20+deprecated [INFO] [stderr] Checking siphasher v1.0.1 [INFO] [stderr] Compiling rand_pcg v0.2.1 [INFO] [stderr] Compiling pathfinder_simd v0.5.5 [INFO] [stderr] Checking weezl v0.1.12 [INFO] [stderr] Checking bytemuck v1.24.0 [INFO] [stderr] Compiling phf_shared v0.11.3 [INFO] [stderr] Checking deranged v0.5.5 [INFO] [stderr] Checking indexmap v2.12.1 [INFO] [stderr] Compiling rustix v1.1.2 [INFO] [stderr] Compiling ppv-lite86 v0.2.21 [INFO] [stderr] Checking num_threads v0.1.7 [INFO] [stderr] Checking thiserror v2.0.17 [INFO] [stderr] Compiling phf_generator v0.11.3 [INFO] [stderr] Checking crypto-common v0.1.7 [INFO] [stderr] Compiling rand_chacha v0.2.2 [INFO] [stderr] Checking core_maths v0.1.1 [INFO] [stderr] Checking aho-corasick v1.1.4 [INFO] [stderr] Compiling slotmap v1.1.1 [INFO] [stderr] Compiling unicode-joining-type v1.0.0 [INFO] [stderr] Compiling rand v0.7.3 [INFO] [stderr] Compiling unicode-general-category v1.1.0 [INFO] [stderr] Checking aliasable v0.1.3 [INFO] [stderr] Checking linux-raw-sys v0.11.0 [INFO] [stderr] Checking float-cmp v0.9.0 [INFO] [stderr] Compiling unicode-canonical-combining-class v1.0.0 [INFO] [stderr] Compiling phf_generator v0.8.0 [INFO] [stderr] Compiling phf_codegen v0.8.0 [INFO] [stderr] Checking strict-num v0.1.1 [INFO] [stderr] Checking regex-automata v0.4.13 [INFO] [stderr] Checking pathfinder_geometry v0.5.1 [INFO] [stderr] Checking ttf-parser v0.25.1 [INFO] [stderr] Compiling string_cache_codegen v0.5.4 [INFO] [stderr] Checking time v0.3.44 [INFO] [stderr] Checking font-types v0.10.1 [INFO] [stderr] Compiling strum_macros v0.27.2 [INFO] [stderr] Checking block-padding v0.3.3 [INFO] [stderr] Checking pxfm v0.1.27 [INFO] [stderr] Checking itertools v0.13.0 [INFO] [stderr] Checking itertools v0.10.5 [INFO] [stderr] Checking bitreader v0.3.11 [INFO] [stderr] Checking glyph-names v0.2.0 [INFO] [stderr] Compiling phf_macros v0.8.0 [INFO] [stderr] Compiling ouroboros_macro v0.17.2 [INFO] [stderr] Checking roxmltree v0.20.0 [INFO] [stderr] Checking mac v0.1.1 [INFO] [stderr] Checking zune-core v0.5.0 [INFO] [stderr] Checking precomputed-hash v0.1.1 [INFO] [stderr] Checking ucd-trie v0.1.7 [INFO] [stderr] Checking phf v0.8.0 [INFO] [stderr] Compiling convert_case v0.10.0 [INFO] [stderr] Checking fontconfig-parser v0.5.8 [INFO] [stderr] Checking unicode-truncate v2.0.0 [INFO] [stderr] Checking zune-jpeg v0.5.7 [INFO] [stderr] Checking futf v0.1.5 [INFO] [stderr] Checking strum v0.27.2 [INFO] [stderr] Checking tiny-skia-path v0.11.4 [INFO] [stderr] Checking moxcms v0.7.11 [INFO] [stderr] Compiling cssparser v0.27.2 [INFO] [stderr] Checking inout v0.1.4 [INFO] [stderr] Compiling markup5ever v0.10.1 [INFO] [stderr] Checking read-fonts v0.35.0 [INFO] [stderr] Checking compact_str v0.9.0 [INFO] [stderr] Checking kasuari v0.4.11 [INFO] [stderr] Checking ouroboros v0.17.2 [INFO] [stderr] Checking gif v0.14.1 [INFO] [stderr] Checking brotli-decompressor v5.0.0 [INFO] [stderr] Checking png v0.18.0 [INFO] [stderr] Checking kurbo v0.11.3 [INFO] [stderr] Checking lru v0.16.2 [INFO] [stderr] Checking itertools v0.14.0 [INFO] [stderr] Checking signal-hook-registry v1.4.7 [INFO] [stderr] Checking memmap2 v0.9.9 [INFO] [stderr] Compiling unicode-general-category v0.6.0 [INFO] [stderr] Checking unicode-ccc v0.4.0 [INFO] [stderr] Checking unicode-properties v0.1.4 [INFO] [stderr] Compiling unicode-joining-type v0.7.0 [INFO] [stderr] Compiling unicode-canonical-combining-class v0.5.0 [INFO] [stderr] Checking unicode-bidi-mirroring v0.4.0 [INFO] [stderr] Checking unicode-script v0.5.8 [INFO] [stderr] Checking dtoa v1.0.10 [INFO] [stderr] Checking xmlwriter v0.1.0 [INFO] [stderr] Checking xmlparser v0.13.6 [INFO] [stderr] Checking tendril v0.4.3 [INFO] [stderr] Checking dtoa-short v0.3.5 [INFO] [stderr] Checking svgtypes v0.15.3 [INFO] [stderr] Checking allsorts v0.16.1 [INFO] [stderr] Checking rustybuzz v0.20.1 [INFO] [stderr] Checking fontdb v0.23.0 [INFO] [stderr] Checking ratatui-core v0.1.0 [INFO] [stderr] Checking signal-hook v0.3.18 [INFO] [stderr] Checking string_cache v0.8.9 [INFO] [stderr] Compiling instability v0.3.10 [INFO] [stderr] Checking cipher v0.4.4 [INFO] [stderr] Compiling derive_more-impl v2.1.0 [INFO] [stderr] Compiling html5ever v0.25.2 [INFO] [stderr] Compiling selectors v0.22.0 [INFO] [stderr] Checking png v0.17.16 [INFO] [stderr] Checking kurbo v0.12.0 [INFO] [stderr] Checking image v0.25.9 [INFO] [stderr] Checking block-buffer v0.10.4 [INFO] [stderr] Compiling cssparser-macros v0.6.1 [INFO] [stderr] Checking mmapio v0.9.1 [INFO] [stderr] Checking simplecss v0.2.2 [INFO] [stderr] Compiling convert_case v0.4.0 [INFO] [stderr] Checking imagesize v0.13.0 [INFO] [stderr] Compiling serde_json v1.0.145 [INFO] [stderr] Checking itoa v0.4.8 [INFO] [stderr] Checking stable_deref_trait v1.2.1 [INFO] [stderr] Checking data-url v0.3.2 [INFO] [stderr] Checking unicode-vo v0.1.0 [INFO] [stderr] Checking nodrop v0.1.14 [INFO] [stderr] Checking azul-simplecss v0.1.2 [INFO] [stderr] Checking pico-args v0.5.0 [INFO] [stderr] Checking servo_arc v0.1.1 [INFO] [stderr] Checking nom v7.1.3 [INFO] [stderr] Checking azul-css v0.0.5 [INFO] [stderr] Checking usvg v0.45.1 [INFO] [stderr] Compiling derive_more v0.99.20 [INFO] [stderr] Checking tiny-skia v0.11.4 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Checking derive_more v2.1.0 [INFO] [stderr] Checking signal-hook-mio v0.2.5 [INFO] [stderr] Checking getrandom v0.3.4 [INFO] [stderr] Checking gif v0.13.3 [INFO] [stderr] Checking rgb v0.8.52 [INFO] [stderr] Checking brotli-decompressor v4.0.3 [INFO] [stderr] Checking fxhash v0.2.1 [INFO] [stderr] Checking line-clipping v0.3.5 [INFO] [stderr] Checking bytecount v0.6.9 [INFO] [stderr] Checking rustc-hash v2.1.1 [INFO] [stderr] Checking highway v0.8.1 [INFO] [stderr] Checking thin-slice v0.1.1 [INFO] [stderr] Checking bit-vec v0.6.3 [INFO] [stderr] Checking bit-vec v0.8.0 [INFO] [stderr] Checking gl-context-loader v0.1.10 [INFO] [stderr] Checking bit-set v0.5.3 [INFO] [stderr] Checking bit-set v0.8.0 [INFO] [stderr] Checking aes v0.8.4 [INFO] [stderr] Checking resvg v0.45.1 [INFO] [stderr] Checking nom_locate v4.2.0 [INFO] [stderr] Checking allsorts-subset-browser v0.16.0 [INFO] [stderr] Checking ratatui-widgets v0.3.0 [INFO] [stderr] Checking rand_core v0.9.3 [INFO] [stderr] Checking write-fonts v0.43.0 [INFO] [stderr] Checking skrifa v0.37.0 [INFO] [stderr] Checking crossterm v0.29.0 [INFO] [stderr] Checking md-5 v0.10.6 [INFO] [stderr] Checking cbc v0.1.2 [INFO] [stderr] Checking roxmltree v0.14.1 [INFO] [stderr] Checking gethostname v1.1.0 [INFO] [stderr] Checking pdf-writer v0.12.1 [INFO] [stderr] Checking unicode-normalization v0.1.25 [INFO] [stderr] Checking quick-xml v0.38.4 [INFO] [stderr] Checking rust-fontconfig v1.2.1 [INFO] [stderr] Checking ttf-parser v0.15.2 [INFO] [stderr] Checking azul-core v0.0.5 [INFO] [stderr] Checking rangemap v1.7.0 [INFO] [stderr] Checking linked-hash-map v0.5.6 [INFO] [stderr] Checking x11rb-protocol v0.13.2 [INFO] [stderr] Checking dirs-sys v0.5.0 [INFO] [stderr] Checking yaml-rust v0.4.5 [INFO] [stderr] Checking lopdf v0.35.0 [INFO] [stderr] Checking plist v1.8.0 [INFO] [stderr] Checking inotify v0.11.0 [INFO] [stderr] Checking ratatui-crossterm v0.1.0 [INFO] [stderr] Checking kuchiki v0.8.1 [INFO] [stderr] Checking ratatui-macros v0.7.0 [INFO] [stderr] Checking rand_chacha v0.9.0 [INFO] [stderr] Checking fancy-regex v0.16.2 [INFO] [stderr] Checking fancy-regex v0.13.0 [INFO] [stderr] Checking regex v1.12.2 [INFO] [stderr] Checking bstr v1.12.1 [INFO] [stderr] Checking bincode v1.3.3 [INFO] [stderr] Compiling clap_derive v4.5.49 [INFO] [stderr] Checking notify-types v2.0.0 [INFO] [stderr] Compiling revw v0.2.9 (/opt/rustwide/workdir) [INFO] [stderr] Checking chrono v0.4.42 [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> build.rs:6:15 [INFO] [stdout] | [INFO] [stdout] 6 | .args(&["describe", "--tags", "--dirty"]) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `["describe", "--tags", "--dirty"]` [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] [stderr] Checking notify v8.2.0 [INFO] [stderr] Checking tiktoken-rs v0.9.1 [INFO] [stderr] Checking syntect v5.3.0 [INFO] [stderr] Checking rand v0.9.2 [INFO] [stderr] Checking ratatui v0.30.0 [INFO] [stderr] Checking dirs v6.0.0 [INFO] [stderr] Checking clap v4.5.53 [INFO] [stderr] Checking subsetter v0.2.3 [INFO] [stderr] Checking x11rb v0.13.2 [INFO] [stderr] Checking svg2pdf v0.13.0 [INFO] [stderr] Checking arboard v3.6.1 [INFO] [stderr] Checking azul-layout v0.0.5 [INFO] [stderr] Checking printpdf v0.8.2 [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/basic.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 9 | / if self.format_mode == FormatMode::View && !self.relf_entries.is_empty() { [INFO] [stdout] 10 | | if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 11 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 12 | | let outside_count = obj [INFO] [stdout] ... | [INFO] [stdout] 73 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 9 ~ if self.format_mode == FormatMode::View && !self.relf_entries.is_empty() [INFO] [stdout] 10 ~ && let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 11 | if let Some(obj) = json_value.as_object() { [INFO] [stdout] ... [INFO] [stdout] 71 | } [INFO] [stdout] 72 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/basic.rs:10:13 [INFO] [stdout] | [INFO] [stdout] 10 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 11 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 12 | | let outside_count = obj [INFO] [stdout] 13 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 72 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 10 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 11 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 12 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 70 | return; [INFO] [stdout] 71 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/basic.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 96 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 97 | | let outside_count = obj [INFO] [stdout] 98 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 135 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 95 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 96 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 97 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 133 | return; [INFO] [stdout] 134 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/basic.rs:177:13 [INFO] [stdout] | [INFO] [stdout] 177 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 178 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 179 | | let outside_count = obj [INFO] [stdout] 180 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 217 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 177 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 178 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 179 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 215 | return; [INFO] [stdout] 216 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:118:9 [INFO] [stdout] | [INFO] [stdout] 118 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 119 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 120 | | let outside_count = obj [INFO] [stdout] 121 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 197 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 118 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 119 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 120 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 195 | } [INFO] [stdout] 196 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:146:25 [INFO] [stdout] | [INFO] [stdout] 146 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 147 | | if original_idx < outside.len() { [INFO] [stdout] 148 | | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 149 | | } [INFO] [stdout] 150 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 146 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 147 ~ && original_idx < outside.len() { [INFO] [stdout] 148 | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 149 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:154:25 [INFO] [stdout] | [INFO] [stdout] 154 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 155 | | if inside_idx < inside.len() { [INFO] [stdout] 156 | | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 157 | | } [INFO] [stdout] 158 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 154 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 155 ~ && inside_idx < inside.len() { [INFO] [stdout] 156 | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 157 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:210:9 [INFO] [stdout] | [INFO] [stdout] 210 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 211 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 212 | | let outside_count = obj [INFO] [stdout] 213 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 288 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 210 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 211 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 212 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 286 | } [INFO] [stdout] 287 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:238:25 [INFO] [stdout] | [INFO] [stdout] 238 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 239 | | if original_idx < outside.len() { [INFO] [stdout] 240 | | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 241 | | } [INFO] [stdout] 242 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 238 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 239 ~ && original_idx < outside.len() { [INFO] [stdout] 240 | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 241 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:246:25 [INFO] [stdout] | [INFO] [stdout] 246 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 247 | | if inside_idx < inside.len() { [INFO] [stdout] 248 | | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 249 | | } [INFO] [stdout] 250 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 246 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 247 ~ && inside_idx < inside.len() { [INFO] [stdout] 248 | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:301:9 [INFO] [stdout] | [INFO] [stdout] 301 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 302 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 303 | | let outside_count = obj [INFO] [stdout] 304 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 382 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 301 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 302 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 303 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 380 | } [INFO] [stdout] 381 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:329:25 [INFO] [stdout] | [INFO] [stdout] 329 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 330 | | if original_idx < outside.len() { [INFO] [stdout] 331 | | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 332 | | } [INFO] [stdout] 333 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 329 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 330 ~ && original_idx < outside.len() { [INFO] [stdout] 331 | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 332 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:337:25 [INFO] [stdout] | [INFO] [stdout] 337 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 338 | | if inside_idx < inside.len() { [INFO] [stdout] 339 | | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 340 | | } [INFO] [stdout] 341 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 337 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 338 ~ && inside_idx < inside.len() { [INFO] [stdout] 339 | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 340 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/delete.rs:181:9 [INFO] [stdout] | [INFO] [stdout] 181 | / if let Ok(mut json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 182 | | if let Some(obj) = json_value.as_object_mut() { [INFO] [stdout] 183 | | let outside_count = obj [INFO] [stdout] 184 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 250 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 181 ~ if let Ok(mut json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 182 ~ && let Some(obj) = json_value.as_object_mut() { [INFO] [stdout] 183 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 248 | } [INFO] [stdout] 249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/duplicate.rs:13:13 [INFO] [stdout] | [INFO] [stdout] 13 | / if let Ok(mut json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 14 | | if let Some(obj) = json_value.as_object_mut() { [INFO] [stdout] 15 | | let outside_count = obj [INFO] [stdout] 16 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 73 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 13 ~ if let Ok(mut json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 14 ~ && let Some(obj) = json_value.as_object_mut() { [INFO] [stdout] 15 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 71 | } [INFO] [stdout] 72 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/duplicate.rs:24:25 [INFO] [stdout] | [INFO] [stdout] 24 | / if let Some(outside) = obj.get_mut("outside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 25 | | if target_idx < outside.len() { [INFO] [stdout] 26 | | let entry_clone = outside[target_idx].clone(); [INFO] [stdout] 27 | | outside.insert(target_idx + 1, entry_clone); [INFO] [stdout] ... | [INFO] [stdout] 45 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 24 ~ if let Some(outside) = obj.get_mut("outside").and_then(|v| v.as_array_mut()) [INFO] [stdout] 25 ~ && target_idx < outside.len() { [INFO] [stdout] 26 | let entry_clone = outside[target_idx].clone(); [INFO] [stdout] ... [INFO] [stdout] 43 | } [INFO] [stdout] 44 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/duplicate.rs:49:25 [INFO] [stdout] | [INFO] [stdout] 49 | / if let Some(inside) = obj.get_mut("inside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 50 | | if inside_index < inside.len() { [INFO] [stdout] 51 | | let entry_clone = inside[inside_index].clone(); [INFO] [stdout] 52 | | inside.insert(inside_index + 1, entry_clone); [INFO] [stdout] ... | [INFO] [stdout] 70 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 49 ~ if let Some(inside) = obj.get_mut("inside").and_then(|v| v.as_array_mut()) [INFO] [stdout] 50 ~ && inside_index < inside.len() { [INFO] [stdout] 51 | let entry_clone = inside[inside_index].clone(); [INFO] [stdout] ... [INFO] [stdout] 68 | } [INFO] [stdout] 69 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/helpers.rs:11:13 [INFO] [stdout] | [INFO] [stdout] 11 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 12 | | if !outside.is_empty() { [INFO] [stdout] 13 | | output_lines.push("## OUTSIDE".to_string()); [INFO] [stdout] 14 | | output_lines.push("".to_string()); [INFO] [stdout] ... | [INFO] [stdout] 52 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 11 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 12 ~ && !outside.is_empty() { [INFO] [stdout] 13 | output_lines.push("## OUTSIDE".to_string()); [INFO] [stdout] ... [INFO] [stdout] 50 | } [INFO] [stdout] 51 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/helpers.rs:32:29 [INFO] [stdout] | [INFO] [stdout] 32 | / ... if let Some(url_str) = url { [INFO] [stdout] 33 | | ... if !url_str.is_empty() { [INFO] [stdout] 34 | | ... output_lines.push("".to_string()); [INFO] [stdout] 35 | | ... output_lines.push(format!("**URL:** {}", url_str)); [INFO] [stdout] 36 | | ... } [INFO] [stdout] 37 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 32 ~ if let Some(url_str) = url [INFO] [stdout] 33 ~ && !url_str.is_empty() { [INFO] [stdout] 34 | output_lines.push("".to_string()); [INFO] [stdout] 35 | output_lines.push(format!("**URL:** {}", url_str)); [INFO] [stdout] 36 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/helpers.rs:55:13 [INFO] [stdout] | [INFO] [stdout] 55 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 56 | | if !inside.is_empty() { [INFO] [stdout] 57 | | output_lines.push("## INSIDE".to_string()); [INFO] [stdout] 58 | | output_lines.push("".to_string()); [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#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 55 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 56 ~ && !inside.is_empty() { [INFO] [stdout] 57 | output_lines.push("## INSIDE".to_string()); [INFO] [stdout] ... [INFO] [stdout] 78 | } [INFO] [stdout] 79 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:16:25 [INFO] [stdout] | [INFO] [stdout] 16 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 17 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 18 | | // Convert JSON to Markdown [INFO] [stdout] 19 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... | [INFO] [stdout] 24 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 16 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 17 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 18 | // Convert JSON to Markdown [INFO] [stdout] ... [INFO] [stdout] 22 | } [INFO] [stdout] 23 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:32:25 [INFO] [stdout] | [INFO] [stdout] 32 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 33 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 34 | | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] 35 | | return; [INFO] [stdout] 36 | | } [INFO] [stdout] 37 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 32 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 33 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 34 | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] 35 | return; [INFO] [stdout] 36 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:164:25 [INFO] [stdout] | [INFO] [stdout] 164 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 165 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 166 | | // Convert JSON to Markdown [INFO] [stdout] 167 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... | [INFO] [stdout] 172 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 164 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 165 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 166 | // Convert JSON to Markdown [INFO] [stdout] ... [INFO] [stdout] 170 | } [INFO] [stdout] 171 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:180:25 [INFO] [stdout] | [INFO] [stdout] 180 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 181 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 182 | | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 183 | | return; [INFO] [stdout] 184 | | } [INFO] [stdout] 185 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 180 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 181 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 182 | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 183 | return; [INFO] [stdout] 184 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:310:25 [INFO] [stdout] | [INFO] [stdout] 310 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 311 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 312 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 313 | | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] ... | [INFO] [stdout] 318 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 310 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 311 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 312 | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... [INFO] [stdout] 316 | } [INFO] [stdout] 317 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:311:29 [INFO] [stdout] | [INFO] [stdout] 311 | / ... if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 312 | | ... if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 313 | | ... self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 314 | | ... self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] ... | [INFO] [stdout] 317 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 311 ~ if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) [INFO] [stdout] 312 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 313 | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 314 | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] 315 | return; [INFO] [stdout] 316 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:326:25 [INFO] [stdout] | [INFO] [stdout] 326 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 327 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 328 | | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 329 | | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] ... | [INFO] [stdout] 332 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 326 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 327 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 328 | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 329 | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] 330 | return; [INFO] [stdout] 331 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/overwrite.rs:16:25 [INFO] [stdout] | [INFO] [stdout] 16 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 17 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 18 | | // Convert JSON to Markdown [INFO] [stdout] 19 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... | [INFO] [stdout] 24 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 16 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 17 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 18 | // Convert JSON to Markdown [INFO] [stdout] ... [INFO] [stdout] 22 | } [INFO] [stdout] 23 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/overwrite.rs:32:25 [INFO] [stdout] | [INFO] [stdout] 32 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 33 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 34 | | self.paste_markdown_section_overwrite(&md_text, "INSIDE"); [INFO] [stdout] 35 | | return; [INFO] [stdout] 36 | | } [INFO] [stdout] 37 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 32 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 33 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 34 | self.paste_markdown_section_overwrite(&md_text, "INSIDE"); [INFO] [stdout] 35 | return; [INFO] [stdout] 36 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/overwrite.rs:145:25 [INFO] [stdout] | [INFO] [stdout] 145 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 146 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 147 | | // Convert JSON to Markdown [INFO] [stdout] 148 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... | [INFO] [stdout] 153 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 145 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 146 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 147 | // Convert JSON to Markdown [INFO] [stdout] ... [INFO] [stdout] 151 | } [INFO] [stdout] 152 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/overwrite.rs:161:25 [INFO] [stdout] | [INFO] [stdout] 161 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 162 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 163 | | self.paste_markdown_section_overwrite(&md_text, "OUTSIDE"); [INFO] [stdout] 164 | | return; [INFO] [stdout] 165 | | } [INFO] [stdout] 166 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 161 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 162 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 163 | self.paste_markdown_section_overwrite(&md_text, "OUTSIDE"); [INFO] [stdout] 164 | return; [INFO] [stdout] 165 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:11:13 [INFO] [stdout] | [INFO] [stdout] 11 | / if let Ok(clipboard_json) = serde_json::from_str::(text) { [INFO] [stdout] 12 | | if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 13 | | if let Some(new_inside) = clipboard_obj.get("inside") { [INFO] [stdout] 14 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... | [INFO] [stdout] 25 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 11 ~ if let Ok(clipboard_json) = serde_json::from_str::(text) [INFO] [stdout] 12 ~ && let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 13 | if let Some(new_inside) = clipboard_obj.get("inside") { [INFO] [stdout] ... [INFO] [stdout] 23 | } [INFO] [stdout] 24 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:12:17 [INFO] [stdout] | [INFO] [stdout] 12 | / if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 13 | | if let Some(new_inside) = clipboard_obj.get("inside") { [INFO] [stdout] 14 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 15 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... | [INFO] [stdout] 24 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 12 ~ if let Some(clipboard_obj) = clipboard_json.as_object() [INFO] [stdout] 13 ~ && let Some(new_inside) = clipboard_obj.get("inside") { [INFO] [stdout] 14 | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... [INFO] [stdout] 22 | } [INFO] [stdout] 23 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:13:21 [INFO] [stdout] | [INFO] [stdout] 13 | / if let Some(new_inside) = clipboard_obj.get("inside") { [INFO] [stdout] 14 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 15 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 16 | | current_obj.insert("inside".to_string(), new_inside.clone()); [INFO] [stdout] ... | [INFO] [stdout] 23 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 13 ~ if let Some(new_inside) = clipboard_obj.get("inside") [INFO] [stdout] 14 ~ && let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 15 | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... [INFO] [stdout] 21 | } [INFO] [stdout] 22 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:14:25 [INFO] [stdout] | [INFO] [stdout] 14 | / if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 15 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 16 | | current_obj.insert("inside".to_string(), new_inside.clone()); [INFO] [stdout] 17 | | self.json_input = serde_json::to_string_pretty(¤t_json).unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 22 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 14 ~ if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 15 ~ && let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 16 | current_obj.insert("inside".to_string(), new_inside.clone()); [INFO] [stdout] ... [INFO] [stdout] 20 | self.set_status("INSIDE section overwritten"); [INFO] [stdout] 21 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:35:13 [INFO] [stdout] | [INFO] [stdout] 35 | / if let Ok(clipboard_json) = serde_json::from_str::(text) { [INFO] [stdout] 36 | | if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 37 | | if let Some(new_outside) = clipboard_obj.get("outside") { [INFO] [stdout] 38 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... | [INFO] [stdout] 49 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 35 ~ if let Ok(clipboard_json) = serde_json::from_str::(text) [INFO] [stdout] 36 ~ && let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 37 | if let Some(new_outside) = clipboard_obj.get("outside") { [INFO] [stdout] ... [INFO] [stdout] 47 | } [INFO] [stdout] 48 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:36:17 [INFO] [stdout] | [INFO] [stdout] 36 | / if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 37 | | if let Some(new_outside) = clipboard_obj.get("outside") { [INFO] [stdout] 38 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 39 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... | [INFO] [stdout] 48 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 36 ~ if let Some(clipboard_obj) = clipboard_json.as_object() [INFO] [stdout] 37 ~ && let Some(new_outside) = clipboard_obj.get("outside") { [INFO] [stdout] 38 | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... [INFO] [stdout] 46 | } [INFO] [stdout] 47 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:37:21 [INFO] [stdout] | [INFO] [stdout] 37 | / if let Some(new_outside) = clipboard_obj.get("outside") { [INFO] [stdout] 38 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 39 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 40 | | current_obj.insert("outside".to_string(), new_outside.clone()); [INFO] [stdout] ... | [INFO] [stdout] 47 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 37 ~ if let Some(new_outside) = clipboard_obj.get("outside") [INFO] [stdout] 38 ~ && let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 39 | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... [INFO] [stdout] 45 | } [INFO] [stdout] 46 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:38:25 [INFO] [stdout] | [INFO] [stdout] 38 | / if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 39 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 40 | | current_obj.insert("outside".to_string(), new_outside.clone()); [INFO] [stdout] 41 | | self.json_input = serde_json::to_string_pretty(¤t_json).unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 46 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 38 ~ if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 39 ~ && let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 40 | current_obj.insert("outside".to_string(), new_outside.clone()); [INFO] [stdout] ... [INFO] [stdout] 44 | self.set_status("OUTSIDE section overwritten"); [INFO] [stdout] 45 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:59:13 [INFO] [stdout] | [INFO] [stdout] 59 | / if let Ok(clipboard_json) = serde_json::from_str::(text) { [INFO] [stdout] 60 | | if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 61 | | if let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 62 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... | [INFO] [stdout] 79 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 59 ~ if let Ok(clipboard_json) = serde_json::from_str::(text) [INFO] [stdout] 60 ~ && let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 61 | if let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] ... [INFO] [stdout] 77 | } [INFO] [stdout] 78 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:60:17 [INFO] [stdout] | [INFO] [stdout] 60 | / if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 61 | | if let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 62 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 63 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... | [INFO] [stdout] 78 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 60 ~ if let Some(clipboard_obj) = clipboard_json.as_object() [INFO] [stdout] 61 ~ && let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 62 | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... [INFO] [stdout] 76 | } [INFO] [stdout] 77 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:61:21 [INFO] [stdout] | [INFO] [stdout] 61 | / if let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 62 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 63 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 64 | | let current_inside = current_obj [INFO] [stdout] ... | [INFO] [stdout] 77 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 61 ~ if let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 62 ~ && let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 63 | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... [INFO] [stdout] 75 | } [INFO] [stdout] 76 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:62:25 [INFO] [stdout] | [INFO] [stdout] 62 | / if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 63 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 64 | | let current_inside = current_obj [INFO] [stdout] 65 | | .entry("inside".to_string()) [INFO] [stdout] ... | [INFO] [stdout] 76 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 62 ~ if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 63 ~ && let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 64 | let current_inside = current_obj [INFO] [stdout] ... [INFO] [stdout] 74 | } [INFO] [stdout] 75 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:89:13 [INFO] [stdout] | [INFO] [stdout] 89 | / if let Ok(clipboard_json) = serde_json::from_str::(text) { [INFO] [stdout] 90 | | if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 91 | | if let Some(new_outside) = clipboard_obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 92 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... | [INFO] [stdout] 109 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 89 ~ if let Ok(clipboard_json) = serde_json::from_str::(text) [INFO] [stdout] 90 ~ && let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 91 | if let Some(new_outside) = clipboard_obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] ... [INFO] [stdout] 107 | } [INFO] [stdout] 108 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:90:17 [INFO] [stdout] | [INFO] [stdout] 90 | / if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 91 | | if let Some(new_outside) = clipboard_obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 92 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 93 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... | [INFO] [stdout] 108 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 90 ~ if let Some(clipboard_obj) = clipboard_json.as_object() [INFO] [stdout] 91 ~ && let Some(new_outside) = clipboard_obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 92 | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... [INFO] [stdout] 106 | } [INFO] [stdout] 107 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:91:21 [INFO] [stdout] | [INFO] [stdout] 91 | / if let Some(new_outside) = clipboard_obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 92 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 93 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 94 | | let current_outside = current_obj [INFO] [stdout] ... | [INFO] [stdout] 107 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 91 ~ if let Some(new_outside) = clipboard_obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 92 ~ && let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 93 | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... [INFO] [stdout] 105 | } [INFO] [stdout] 106 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:92:25 [INFO] [stdout] | [INFO] [stdout] 92 | / if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 93 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 94 | | let current_outside = current_obj [INFO] [stdout] 95 | | .entry("outside".to_string()) [INFO] [stdout] ... | [INFO] [stdout] 106 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 92 ~ if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 93 ~ && let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 94 | let current_outside = current_obj [INFO] [stdout] ... [INFO] [stdout] 104 | } [INFO] [stdout] 105 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:121:13 [INFO] [stdout] | [INFO] [stdout] 121 | / if let Ok(clipboard_json) = serde_json::from_str::(text) { [INFO] [stdout] 122 | | if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 123 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 124 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... | [INFO] [stdout] 158 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 121 ~ if let Ok(clipboard_json) = serde_json::from_str::(text) [INFO] [stdout] 122 ~ && let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 123 | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... [INFO] [stdout] 156 | } [INFO] [stdout] 157 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:122:17 [INFO] [stdout] | [INFO] [stdout] 122 | / if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 123 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 124 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 125 | | let mut appended_count = 0; [INFO] [stdout] ... | [INFO] [stdout] 157 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 122 ~ if let Some(clipboard_obj) = clipboard_json.as_object() [INFO] [stdout] 123 ~ && let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 124 | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... [INFO] [stdout] 155 | } [INFO] [stdout] 156 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:123:21 [INFO] [stdout] | [INFO] [stdout] 123 | / if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 124 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 125 | | let mut appended_count = 0; [INFO] [stdout] ... | [INFO] [stdout] 156 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 123 ~ if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 124 ~ && let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 125 | let mut appended_count = 0; [INFO] [stdout] ... [INFO] [stdout] 154 | self.set_status(&format!("Appended {} entries total", appended_count)); [INFO] [stdout] 155 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/url.rs:49:41 [INFO] [stdout] | [INFO] [stdout] 49 | / ... if let Some(name_val) = obj.get("name") { [INFO] [stdout] 50 | | ... if entry.lines.iter().any(|l| l.contains(&name_val.as_str().unwrap_or(""))) { [INFO] [stdout] 51 | | ... obj.insert("url".to_string(), Value::String(url.to_string())); [INFO] [stdout] 52 | | ... break; [INFO] [stdout] 53 | | ... } [INFO] [stdout] 54 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 49 ~ if let Some(name_val) = obj.get("name") [INFO] [stdout] 50 ~ && entry.lines.iter().any(|l| l.contains(&name_val.as_str().unwrap_or(""))) { [INFO] [stdout] 51 | obj.insert("url".to_string(), Value::String(url.to_string())); [INFO] [stdout] 52 | break; [INFO] [stdout] 53 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/app/clipboard/paste/url.rs:50:86 [INFO] [stdout] | [INFO] [stdout] 50 | ... if entry.lines.iter().any(|l| l.contains(&name_val.as_str().unwrap_or(""))) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `name_val.as_str().unwrap_or("")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/command.rs:10:9 [INFO] [stdout] | [INFO] [stdout] 10 | / if self.explorer_open && self.explorer_has_focus { [INFO] [stdout] 11 | | if self.vim_buffer == "go" { [INFO] [stdout] 12 | | // Preview file without moving focus (NERDTree-like) [INFO] [stdout] 13 | | self.explorer_preview_entry(); [INFO] [stdout] ... | [INFO] [stdout] 17 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 10 ~ if self.explorer_open && self.explorer_has_focus [INFO] [stdout] 11 ~ && self.vim_buffer == "go" { [INFO] [stdout] 12 | // Preview file without moving focus (NERDTree-like) [INFO] [stdout] ... [INFO] [stdout] 15 | return true; [INFO] [stdout] 16 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/app/command.rs:296:24 [INFO] [stdout] | [INFO] [stdout] 296 | if value >= 1 && value <= 10 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1..=10).contains(&value)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `parent` after checking its variant with `is_none` [INFO] [stdout] --> src/app/completion.rs:117:17 [INFO] [stdout] | [INFO] [stdout] 114 | let dir = if parent.is_none() || parent == Some(std::path::Path::new("")) { [INFO] [stdout] | ---------------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 117 | parent.unwrap().to_path_buf() [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/app/completion.rs:108:109 [INFO] [stdout] | [INFO] [stdout] 108 | let (dir, file_prefix) = if partial.ends_with('/') || partial.ends_with('\\') || partial.is_empty() { [INFO] [stdout] | _____________________________________________________________________________________________________________^ [INFO] [stdout] 109 | | (path_buf.clone(), String::new()) [INFO] [stdout] 110 | | } else if path_buf.is_dir() { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/app/completion.rs:110:37 [INFO] [stdout] | [INFO] [stdout] 110 | } else if path_buf.is_dir() { [INFO] [stdout] | _____________________________________^ [INFO] [stdout] 111 | | (path_buf.clone(), String::new()) [INFO] [stdout] 112 | | } else { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/app/completion.rs:131:41 [INFO] [stdout] | [INFO] [stdout] 131 | let is_current_dir = dir == PathBuf::from(".") || dir == current_dir; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `*"."` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/app/edit.rs:88:33 [INFO] [stdout] | [INFO] [stdout] 88 | ... return; [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] 87 - self.edit_cursor_pos = 0; [INFO] [stdout] 88 - return; [INFO] [stdout] 87 + self.edit_cursor_pos = 0; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:18:9 [INFO] [stdout] | [INFO] [stdout] 18 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 19 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 20 | | let mut current_idx = 0; [INFO] [stdout] ... | [INFO] [stdout] 94 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 18 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 19 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 20 | let mut current_idx = 0; [INFO] [stdout] ... [INFO] [stdout] 92 | } [INFO] [stdout] 93 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:23:17 [INFO] [stdout] | [INFO] [stdout] 23 | / if let Some(outside) = obj.get("outside") { [INFO] [stdout] 24 | | if let Some(outside_array) = outside.as_array() { [INFO] [stdout] 25 | | if target_idx < current_idx + outside_array.len() { [INFO] [stdout] 26 | | let local_idx = target_idx - current_idx; [INFO] [stdout] ... | [INFO] [stdout] 60 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 23 ~ if let Some(outside) = obj.get("outside") [INFO] [stdout] 24 ~ && let Some(outside_array) = outside.as_array() { [INFO] [stdout] 25 | if target_idx < current_idx + outside_array.len() { [INFO] [stdout] ... [INFO] [stdout] 58 | current_idx += outside_array.len(); [INFO] [stdout] 59 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:63:17 [INFO] [stdout] | [INFO] [stdout] 63 | / if let Some(inside) = obj.get("inside") { [INFO] [stdout] 64 | | if let Some(inside_array) = inside.as_array() { [INFO] [stdout] 65 | | if target_idx < current_idx + inside_array.len() { [INFO] [stdout] 66 | | let local_idx = target_idx - current_idx; [INFO] [stdout] ... | [INFO] [stdout] 92 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 63 ~ if let Some(inside) = obj.get("inside") [INFO] [stdout] 64 ~ && let Some(inside_array) = inside.as_array() { [INFO] [stdout] 65 | if target_idx < current_idx + inside_array.len() { [INFO] [stdout] ... [INFO] [stdout] 90 | } [INFO] [stdout] 91 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:64:21 [INFO] [stdout] | [INFO] [stdout] 64 | / if let Some(inside_array) = inside.as_array() { [INFO] [stdout] 65 | | if target_idx < current_idx + inside_array.len() { [INFO] [stdout] 66 | | let local_idx = target_idx - current_idx; [INFO] [stdout] 67 | | if let Some(entry_obj) = inside_array[local_idx].as_object() { [INFO] [stdout] ... | [INFO] [stdout] 91 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 64 ~ if let Some(inside_array) = inside.as_array() [INFO] [stdout] 65 ~ && target_idx < current_idx + inside_array.len() { [INFO] [stdout] 66 | let local_idx = target_idx - current_idx; [INFO] [stdout] ... [INFO] [stdout] 89 | } [INFO] [stdout] 90 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:119:21 [INFO] [stdout] | [INFO] [stdout] 119 | / if let Some(outside) = obj.get_mut("outside") { [INFO] [stdout] 120 | | if let Some(outside_array) = outside.as_array_mut() { [INFO] [stdout] 121 | | if target_idx < current_idx + outside_array.len() { [INFO] [stdout] 122 | | let local_idx = target_idx - current_idx; [INFO] [stdout] ... | [INFO] [stdout] 159 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 119 ~ if let Some(outside) = obj.get_mut("outside") [INFO] [stdout] 120 ~ && let Some(outside_array) = outside.as_array_mut() { [INFO] [stdout] 121 | if target_idx < current_idx + outside_array.len() { [INFO] [stdout] ... [INFO] [stdout] 157 | } [INFO] [stdout] 158 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/app/edit.rs:125:40 [INFO] [stdout] | [INFO] [stdout] 125 | ... if self.edit_buffer.len() >= 1 && self.edit_buffer_is_placeholder.len() >= 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.edit_buffer.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/app/edit.rs:125:71 [INFO] [stdout] | [INFO] [stdout] 125 | ... if self.edit_buffer.len() >= 1 && self.edit_buffer_is_placeholder.len() >= 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.edit_buffer_is_placeholder.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:162:21 [INFO] [stdout] | [INFO] [stdout] 162 | / if !found { [INFO] [stdout] 163 | | if let Some(inside) = obj.get_mut("inside") { [INFO] [stdout] 164 | | if let Some(inside_array) = inside.as_array_mut() { [INFO] [stdout] 165 | | let local_idx = target_idx - current_idx; [INFO] [stdout] ... | [INFO] [stdout] 186 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 162 ~ if !found [INFO] [stdout] 163 ~ && let Some(inside) = obj.get_mut("inside") { [INFO] [stdout] 164 | if let Some(inside_array) = inside.as_array_mut() { [INFO] [stdout] ... [INFO] [stdout] 184 | } [INFO] [stdout] 185 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:163:25 [INFO] [stdout] | [INFO] [stdout] 163 | / if let Some(inside) = obj.get_mut("inside") { [INFO] [stdout] 164 | | if let Some(inside_array) = inside.as_array_mut() { [INFO] [stdout] 165 | | let local_idx = target_idx - current_idx; [INFO] [stdout] 166 | | if local_idx < inside_array.len() { [INFO] [stdout] ... | [INFO] [stdout] 185 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 163 ~ if let Some(inside) = obj.get_mut("inside") [INFO] [stdout] 164 ~ && let Some(inside_array) = inside.as_array_mut() { [INFO] [stdout] 165 | let local_idx = target_idx - current_idx; [INFO] [stdout] ... [INFO] [stdout] 183 | } [INFO] [stdout] 184 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:166:33 [INFO] [stdout] | [INFO] [stdout] 166 | / ... if local_idx < inside_array.len() { [INFO] [stdout] 167 | | ... if let Some(entry_obj) = inside_array[local_idx].as_object_mut() { [INFO] [stdout] 168 | | ... // Update fields (date and context for inside) - use placeholder flags [INFO] [stdout] 169 | | ... if self.edit_buffer.len() >= 1 && self.edit_buffer_is_placeholder.len() >= 1 { [INFO] [stdout] ... | [INFO] [stdout] 183 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 166 ~ if local_idx < inside_array.len() [INFO] [stdout] 167 ~ && let Some(entry_obj) = inside_array[local_idx].as_object_mut() { [INFO] [stdout] 168 | // Update fields (date and context for inside) - use placeholder flags [INFO] [stdout] ... [INFO] [stdout] 181 | found = true; [INFO] [stdout] 182 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/app/edit.rs:169:44 [INFO] [stdout] | [INFO] [stdout] 169 | ... if self.edit_buffer.len() >= 1 && self.edit_buffer_is_placeholder.len() >= 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.edit_buffer.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/app/edit.rs:169:75 [INFO] [stdout] | [INFO] [stdout] 169 | ... if self.edit_buffer.len() >= 1 && self.edit_buffer_is_placeholder.len() >= 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.edit_buffer_is_placeholder.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:582:21 [INFO] [stdout] | [INFO] [stdout] 582 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 583 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 584 | | let outside_count = obj [INFO] [stdout] 585 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 593 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 582 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 583 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 584 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 591 | self.scroll = 0; [INFO] [stdout] 592 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:650:21 [INFO] [stdout] | [INFO] [stdout] 650 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 651 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 652 | | let outside_count = obj [INFO] [stdout] 653 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 661 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 650 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 651 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 652 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 659 | self.scroll = 0; [INFO] [stdout] 660 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:737:9 [INFO] [stdout] | [INFO] [stdout] 737 | / if self.format_mode == FormatMode::Edit { [INFO] [stdout] 738 | | if self.content_cursor_line < lines.len() { [INFO] [stdout] 739 | | let current = &lines[self.content_cursor_line]; [INFO] [stdout] 740 | | let cursor_display_col = self.prefix_display_width(current, self.content_cursor_col) as u16; [INFO] [stdout] ... | [INFO] [stdout] 757 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 737 ~ if self.format_mode == FormatMode::Edit [INFO] [stdout] 738 ~ && self.content_cursor_line < lines.len() { [INFO] [stdout] 739 | let current = &lines[self.content_cursor_line]; [INFO] [stdout] ... [INFO] [stdout] 755 | // Otherwise, keep hscroll unchanged (camera stays put) [INFO] [stdout] 756 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/app/edit.rs:974:32 [INFO] [stdout] | [INFO] [stdout] 974 | let is_context_field = (self.edit_buffer.len() == 2 && self.edit_field_index == 1) || [INFO] [stdout] | ________________________________^ [INFO] [stdout] 975 | | (self.edit_buffer.len() == 4 && self.edit_field_index == 1); [INFO] [stdout] | |__________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 974 - let is_context_field = (self.edit_buffer.len() == 2 && self.edit_field_index == 1) || [INFO] [stdout] 975 - (self.edit_buffer.len() == 4 && self.edit_field_index == 1); [INFO] [stdout] 974 + let is_context_field = !(self.edit_field_index != 1 || self.edit_buffer.len() != 2 && self.edit_buffer.len() != 4); [INFO] [stdout] | [INFO] [stdout] 974 - let is_context_field = (self.edit_buffer.len() == 2 && self.edit_field_index == 1) || [INFO] [stdout] 975 - (self.edit_buffer.len() == 4 && self.edit_field_index == 1); [INFO] [stdout] 974 + let is_context_field = (self.edit_buffer.len() == 4 || self.edit_buffer.len() == 2) && self.edit_field_index == 1; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/explorer.rs:293:13 [INFO] [stdout] | [INFO] [stdout] 293 | / if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 294 | | if filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 295 | | self.explorer_selected_index = i; [INFO] [stdout] 296 | | self.explorer_update_scroll(); [INFO] [stdout] ... | [INFO] [stdout] 299 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 293 ~ if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) [INFO] [stdout] 294 ~ && filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 295 | self.explorer_selected_index = i; [INFO] [stdout] 296 | self.explorer_update_scroll(); [INFO] [stdout] 297 | return; [INFO] [stdout] 298 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/explorer.rs:304:13 [INFO] [stdout] | [INFO] [stdout] 304 | / if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 305 | | if filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 306 | | self.explorer_selected_index = i; [INFO] [stdout] 307 | | self.explorer_update_scroll(); [INFO] [stdout] ... | [INFO] [stdout] 310 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 304 ~ if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) [INFO] [stdout] 305 ~ && filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 306 | self.explorer_selected_index = i; [INFO] [stdout] 307 | self.explorer_update_scroll(); [INFO] [stdout] 308 | return; [INFO] [stdout] 309 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/explorer.rs:334:13 [INFO] [stdout] | [INFO] [stdout] 334 | / if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 335 | | if filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 336 | | self.explorer_selected_index = i; [INFO] [stdout] 337 | | self.explorer_update_scroll(); [INFO] [stdout] ... | [INFO] [stdout] 340 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 334 ~ if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) [INFO] [stdout] 335 ~ && filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 336 | self.explorer_selected_index = i; [INFO] [stdout] 337 | self.explorer_update_scroll(); [INFO] [stdout] 338 | return; [INFO] [stdout] 339 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/explorer.rs:345:13 [INFO] [stdout] | [INFO] [stdout] 345 | / if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 346 | | if filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 347 | | self.explorer_selected_index = i; [INFO] [stdout] 348 | | self.explorer_update_scroll(); [INFO] [stdout] ... | [INFO] [stdout] 351 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 345 ~ if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) [INFO] [stdout] 346 ~ && filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 347 | self.explorer_selected_index = i; [INFO] [stdout] 348 | self.explorer_update_scroll(); [INFO] [stdout] 349 | return; [INFO] [stdout] 350 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/explorer_ops.rs:310:17 [INFO] [stdout] | [INFO] [stdout] 310 | / if is_move_operation { [INFO] [stdout] 311 | | if let Some(parent) = new_path.parent() { [INFO] [stdout] 312 | | if !parent.exists() { [INFO] [stdout] 313 | | if let Err(e) = fs::create_dir_all(parent) { [INFO] [stdout] ... | [INFO] [stdout] 321 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 310 ~ if is_move_operation [INFO] [stdout] 311 ~ && let Some(parent) = new_path.parent() { [INFO] [stdout] 312 | if !parent.exists() { [INFO] [stdout] ... [INFO] [stdout] 319 | } [INFO] [stdout] 320 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/explorer_ops.rs:311:21 [INFO] [stdout] | [INFO] [stdout] 311 | / if let Some(parent) = new_path.parent() { [INFO] [stdout] 312 | | if !parent.exists() { [INFO] [stdout] 313 | | if let Err(e) = fs::create_dir_all(parent) { [INFO] [stdout] 314 | | self.set_status(&format!("Error creating directories: {}", e)); [INFO] [stdout] ... | [INFO] [stdout] 320 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 311 ~ if let Some(parent) = new_path.parent() [INFO] [stdout] 312 ~ && !parent.exists() { [INFO] [stdout] 313 | if let Err(e) = fs::create_dir_all(parent) { [INFO] [stdout] ... [INFO] [stdout] 318 | } [INFO] [stdout] 319 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/explorer_ops.rs:312:25 [INFO] [stdout] | [INFO] [stdout] 312 | / if !parent.exists() { [INFO] [stdout] 313 | | if let Err(e) = fs::create_dir_all(parent) { [INFO] [stdout] 314 | | self.set_status(&format!("Error creating directories: {}", e)); [INFO] [stdout] 315 | | self.file_op_pending = None; [INFO] [stdout] ... | [INFO] [stdout] 319 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 312 ~ if !parent.exists() [INFO] [stdout] 313 ~ && let Err(e) = fs::create_dir_all(parent) { [INFO] [stdout] 314 | self.set_status(&format!("Error creating directories: {}", e)); [INFO] [stdout] ... [INFO] [stdout] 317 | return; [INFO] [stdout] 318 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/file.rs:467:9 [INFO] [stdout] | [INFO] [stdout] 467 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 468 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 469 | | // OUTSIDE section [INFO] [stdout] 470 | | if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] ... | [INFO] [stdout] 545 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 467 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 468 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 469 | // OUTSIDE section [INFO] [stdout] ... [INFO] [stdout] 543 | } [INFO] [stdout] 544 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/file.rs:470:17 [INFO] [stdout] | [INFO] [stdout] 470 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 471 | | if !outside.is_empty() { [INFO] [stdout] 472 | | output_lines.push("## OUTSIDE".to_string()); [INFO] [stdout] 473 | | output_lines.push("".to_string()); [INFO] [stdout] ... | [INFO] [stdout] 513 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 470 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 471 ~ && !outside.is_empty() { [INFO] [stdout] 472 | output_lines.push("## OUTSIDE".to_string()); [INFO] [stdout] ... [INFO] [stdout] 511 | } [INFO] [stdout] 512 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/basic.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 9 | / if self.format_mode == FormatMode::View && !self.relf_entries.is_empty() { [INFO] [stdout] 10 | | if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 11 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 12 | | let outside_count = obj [INFO] [stdout] ... | [INFO] [stdout] 73 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 9 ~ if self.format_mode == FormatMode::View && !self.relf_entries.is_empty() [INFO] [stdout] 10 ~ && let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 11 | if let Some(obj) = json_value.as_object() { [INFO] [stdout] ... [INFO] [stdout] 71 | } [INFO] [stdout] 72 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/file.rs:493:33 [INFO] [stdout] | [INFO] [stdout] 493 | / ... if let Some(url_str) = url { [INFO] [stdout] 494 | | ... if !url_str.is_empty() { [INFO] [stdout] 495 | | ... output_lines.push("".to_string()); [INFO] [stdout] 496 | | ... output_lines.push(format!("**URL:** {}", url_str)); [INFO] [stdout] 497 | | ... } [INFO] [stdout] 498 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 493 ~ if let Some(url_str) = url [INFO] [stdout] 494 ~ && !url_str.is_empty() { [INFO] [stdout] 495 | output_lines.push("".to_string()); [INFO] [stdout] 496 | output_lines.push(format!("**URL:** {}", url_str)); [INFO] [stdout] 497 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/basic.rs:10:13 [INFO] [stdout] | [INFO] [stdout] 10 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 11 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 12 | | let outside_count = obj [INFO] [stdout] 13 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 72 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 10 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 11 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 12 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 70 | return; [INFO] [stdout] 71 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/file.rs:516:17 [INFO] [stdout] | [INFO] [stdout] 516 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 517 | | if !inside.is_empty() { [INFO] [stdout] 518 | | output_lines.push("## INSIDE".to_string()); [INFO] [stdout] 519 | | output_lines.push("".to_string()); [INFO] [stdout] ... | [INFO] [stdout] 543 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 516 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 517 ~ && !inside.is_empty() { [INFO] [stdout] 518 | output_lines.push("## INSIDE".to_string()); [INFO] [stdout] ... [INFO] [stdout] 541 | } [INFO] [stdout] 542 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/basic.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 96 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 97 | | let outside_count = obj [INFO] [stdout] 98 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 135 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 95 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 96 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 97 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 133 | return; [INFO] [stdout] 134 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/basic.rs:177:13 [INFO] [stdout] | [INFO] [stdout] 177 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 178 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 179 | | let outside_count = obj [INFO] [stdout] 180 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 217 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 177 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 178 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 179 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 215 | return; [INFO] [stdout] 216 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/app/markdown.rs:55:31 [INFO] [stdout] | [INFO] [stdout] 55 | let trimmed = line[4..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/app/markdown.rs:54:20 [INFO] [stdout] | [INFO] [stdout] 54 | } else if line.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] 54 ~ } else if let Some() = line.strip_prefix("### ") { [INFO] [stdout] 55 ~ let trimmed = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/app/markdown.rs:60:31 [INFO] [stdout] | [INFO] [stdout] 60 | let trimmed = line[3..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/app/markdown.rs:58:20 [INFO] [stdout] | [INFO] [stdout] 58 | } else if line.starts_with("###") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 58 ~ } else if let Some() = line.strip_prefix("###") { [INFO] [stdout] 59 | // Handle "###" without space (edge case) [INFO] [stdout] 60 ~ let trimmed = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/app/markdown.rs:123:36 [INFO] [stdout] | [INFO] [stdout] 123 | url = Some(trimmed[8..].trim().to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/app/markdown.rs:122:21 [INFO] [stdout] | [INFO] [stdout] 122 | if trimmed.starts_with("**URL:**") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 122 ~ if let Some() = trimmed.strip_prefix("**URL:**") { [INFO] [stdout] 123 ~ url = Some(.trim().to_string()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/app/markdown.rs:130:39 [INFO] [stdout] | [INFO] [stdout] 130 | let pct_str = trimmed[15..].trim().trim_end_matches('%'); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/app/markdown.rs:129:21 [INFO] [stdout] | [INFO] [stdout] 129 | if trimmed.starts_with("**Percentage:**") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 129 ~ if let Some() = trimmed.strip_prefix("**Percentage:**") { [INFO] [stdout] 130 ~ let pct_str = .trim().trim_end_matches('%'); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/app/markdown.rs:147:23 [INFO] [stdout] | [INFO] [stdout] 147 | while content_lines.last().map_or(false, |l| l.trim().is_empty()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 147 - while content_lines.last().map_or(false, |l| l.trim().is_empty()) { [INFO] [stdout] 147 + while content_lines.last().is_some_and(|l| l.trim().is_empty()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:118:9 [INFO] [stdout] | [INFO] [stdout] 118 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 119 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 120 | | let outside_count = obj [INFO] [stdout] 121 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 197 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 118 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 119 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 120 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 195 | } [INFO] [stdout] 196 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:146:25 [INFO] [stdout] | [INFO] [stdout] 146 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 147 | | if original_idx < outside.len() { [INFO] [stdout] 148 | | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 149 | | } [INFO] [stdout] 150 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 146 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 147 ~ && original_idx < outside.len() { [INFO] [stdout] 148 | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 149 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:154:25 [INFO] [stdout] | [INFO] [stdout] 154 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 155 | | if inside_idx < inside.len() { [INFO] [stdout] 156 | | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 157 | | } [INFO] [stdout] 158 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 154 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 155 ~ && inside_idx < inside.len() { [INFO] [stdout] 156 | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 157 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/markdown.rs:191:9 [INFO] [stdout] | [INFO] [stdout] 191 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 192 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 193 | | // OUTSIDE section [INFO] [stdout] 194 | | if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] ... | [INFO] [stdout] 265 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 191 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 192 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 193 | // OUTSIDE section [INFO] [stdout] ... [INFO] [stdout] 263 | } [INFO] [stdout] 264 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/markdown.rs:194:17 [INFO] [stdout] | [INFO] [stdout] 194 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 195 | | if !outside.is_empty() { [INFO] [stdout] 196 | | output_lines.push("## OUTSIDE".to_string()); [INFO] [stdout] 197 | | output_lines.push("".to_string()); [INFO] [stdout] ... | [INFO] [stdout] 235 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 194 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 195 ~ && !outside.is_empty() { [INFO] [stdout] 196 | output_lines.push("## OUTSIDE".to_string()); [INFO] [stdout] ... [INFO] [stdout] 233 | } [INFO] [stdout] 234 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/markdown.rs:215:33 [INFO] [stdout] | [INFO] [stdout] 215 | / ... if let Some(url_str) = url { [INFO] [stdout] 216 | | ... if !url_str.is_empty() { [INFO] [stdout] 217 | | ... output_lines.push("".to_string()); [INFO] [stdout] 218 | | ... output_lines.push(format!("**URL:** {}", url_str)); [INFO] [stdout] 219 | | ... } [INFO] [stdout] 220 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 215 ~ if let Some(url_str) = url [INFO] [stdout] 216 ~ && !url_str.is_empty() { [INFO] [stdout] 217 | output_lines.push("".to_string()); [INFO] [stdout] 218 | output_lines.push(format!("**URL:** {}", url_str)); [INFO] [stdout] 219 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/markdown.rs:238:17 [INFO] [stdout] | [INFO] [stdout] 238 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 239 | | if !inside.is_empty() { [INFO] [stdout] 240 | | output_lines.push("## INSIDE".to_string()); [INFO] [stdout] 241 | | output_lines.push("".to_string()); [INFO] [stdout] ... | [INFO] [stdout] 263 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 238 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 239 ~ && !inside.is_empty() { [INFO] [stdout] 240 | output_lines.push("## INSIDE".to_string()); [INFO] [stdout] ... [INFO] [stdout] 261 | } [INFO] [stdout] 262 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/markdown.rs:273:9 [INFO] [stdout] | [INFO] [stdout] 273 | / if self.is_markdown_file() { [INFO] [stdout] 274 | | if let Ok(md_str) = self.convert_to_markdown() { [INFO] [stdout] 275 | | self.markdown_input = md_str; [INFO] [stdout] 276 | | return true; [INFO] [stdout] 277 | | } [INFO] [stdout] 278 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 273 ~ if self.is_markdown_file() [INFO] [stdout] 274 ~ && let Ok(md_str) = self.convert_to_markdown() { [INFO] [stdout] 275 | self.markdown_input = md_str; [INFO] [stdout] 276 | return true; [INFO] [stdout] 277 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:210:9 [INFO] [stdout] | [INFO] [stdout] 210 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 211 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 212 | | let outside_count = obj [INFO] [stdout] 213 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 288 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 210 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 211 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 212 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 286 | } [INFO] [stdout] 287 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:238:25 [INFO] [stdout] | [INFO] [stdout] 238 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 239 | | if original_idx < outside.len() { [INFO] [stdout] 240 | | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 241 | | } [INFO] [stdout] 242 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 238 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 239 ~ && original_idx < outside.len() { [INFO] [stdout] 240 | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 241 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:246:25 [INFO] [stdout] | [INFO] [stdout] 246 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 247 | | if inside_idx < inside.len() { [INFO] [stdout] 248 | | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 249 | | } [INFO] [stdout] 250 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 246 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 247 ~ && inside_idx < inside.len() { [INFO] [stdout] 248 | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:301:9 [INFO] [stdout] | [INFO] [stdout] 301 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 302 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 303 | | let outside_count = obj [INFO] [stdout] 304 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 382 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 301 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 302 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 303 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 380 | } [INFO] [stdout] 381 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:329:25 [INFO] [stdout] | [INFO] [stdout] 329 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 330 | | if original_idx < outside.len() { [INFO] [stdout] 331 | | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 332 | | } [INFO] [stdout] 333 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 329 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 330 ~ && original_idx < outside.len() { [INFO] [stdout] 331 | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 332 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:337:25 [INFO] [stdout] | [INFO] [stdout] 337 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 338 | | if inside_idx < inside.len() { [INFO] [stdout] 339 | | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 340 | | } [INFO] [stdout] 341 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 337 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 338 ~ && inside_idx < inside.len() { [INFO] [stdout] 339 | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 340 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:202:21 [INFO] [stdout] | [INFO] [stdout] 202 | / if let Some(outside) = obj.get_mut("outside") { [INFO] [stdout] 203 | | if let Some(outside_array) = outside.as_array_mut() { [INFO] [stdout] 204 | | let outside_count = outside_array.len(); [INFO] [stdout] 205 | | if target_idx < current_idx + outside_count { [INFO] [stdout] ... | [INFO] [stdout] 213 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 202 ~ if let Some(outside) = obj.get_mut("outside") [INFO] [stdout] 203 ~ && let Some(outside_array) = outside.as_array_mut() { [INFO] [stdout] 204 | let outside_count = outside_array.len(); [INFO] [stdout] ... [INFO] [stdout] 211 | } [INFO] [stdout] 212 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:216:21 [INFO] [stdout] | [INFO] [stdout] 216 | / if !found { [INFO] [stdout] 217 | | if let Some(inside) = obj.get_mut("inside") { [INFO] [stdout] 218 | | if let Some(inside_array) = inside.as_array_mut() { [INFO] [stdout] 219 | | let local_idx = target_idx - current_idx; [INFO] [stdout] ... | [INFO] [stdout] 226 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 216 ~ if !found [INFO] [stdout] 217 ~ && let Some(inside) = obj.get_mut("inside") { [INFO] [stdout] 218 | if let Some(inside_array) = inside.as_array_mut() { [INFO] [stdout] ... [INFO] [stdout] 224 | } [INFO] [stdout] 225 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:217:25 [INFO] [stdout] | [INFO] [stdout] 217 | / if let Some(inside) = obj.get_mut("inside") { [INFO] [stdout] 218 | | if let Some(inside_array) = inside.as_array_mut() { [INFO] [stdout] 219 | | let local_idx = target_idx - current_idx; [INFO] [stdout] 220 | | if local_idx < inside_array.len() { [INFO] [stdout] ... | [INFO] [stdout] 225 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 217 ~ if let Some(inside) = obj.get_mut("inside") [INFO] [stdout] 218 ~ && let Some(inside_array) = inside.as_array_mut() { [INFO] [stdout] 219 | let local_idx = target_idx - current_idx; [INFO] [stdout] ... [INFO] [stdout] 223 | } [INFO] [stdout] 224 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/delete.rs:181:9 [INFO] [stdout] | [INFO] [stdout] 181 | / if let Ok(mut json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 182 | | if let Some(obj) = json_value.as_object_mut() { [INFO] [stdout] 183 | | let outside_count = obj [INFO] [stdout] 184 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 250 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 181 ~ if let Ok(mut json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 182 ~ && let Some(obj) = json_value.as_object_mut() { [INFO] [stdout] 183 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 248 | } [INFO] [stdout] 249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:350:13 [INFO] [stdout] | [INFO] [stdout] 350 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 351 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 352 | | if let Some(outside) = obj.get("outside") { [INFO] [stdout] 353 | | if let Some(outside_array) = outside.as_array() { [INFO] [stdout] ... | [INFO] [stdout] 362 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 350 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 351 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 352 | if let Some(outside) = obj.get("outside") { [INFO] [stdout] ... [INFO] [stdout] 360 | } [INFO] [stdout] 361 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:351:17 [INFO] [stdout] | [INFO] [stdout] 351 | / if let Some(obj) = json_value.as_object() { [INFO] [stdout] 352 | | if let Some(outside) = obj.get("outside") { [INFO] [stdout] 353 | | if let Some(outside_array) = outside.as_array() { [INFO] [stdout] 354 | | if !outside_array.is_empty() { [INFO] [stdout] ... | [INFO] [stdout] 361 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 351 ~ if let Some(obj) = json_value.as_object() [INFO] [stdout] 352 ~ && let Some(outside) = obj.get("outside") { [INFO] [stdout] 353 | if let Some(outside_array) = outside.as_array() { [INFO] [stdout] ... [INFO] [stdout] 359 | } [INFO] [stdout] 360 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:352:21 [INFO] [stdout] | [INFO] [stdout] 352 | / if let Some(outside) = obj.get("outside") { [INFO] [stdout] 353 | | if let Some(outside_array) = outside.as_array() { [INFO] [stdout] 354 | | if !outside_array.is_empty() { [INFO] [stdout] 355 | | self.selected_entry_index = 0; [INFO] [stdout] ... | [INFO] [stdout] 360 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 352 ~ if let Some(outside) = obj.get("outside") [INFO] [stdout] 353 ~ && let Some(outside_array) = outside.as_array() { [INFO] [stdout] 354 | if !outside_array.is_empty() { [INFO] [stdout] ... [INFO] [stdout] 358 | } [INFO] [stdout] 359 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:353:25 [INFO] [stdout] | [INFO] [stdout] 353 | / if let Some(outside_array) = outside.as_array() { [INFO] [stdout] 354 | | if !outside_array.is_empty() { [INFO] [stdout] 355 | | self.selected_entry_index = 0; [INFO] [stdout] 356 | | self.set_status("Jumped to first OUTSIDE entry"); [INFO] [stdout] ... | [INFO] [stdout] 359 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 353 ~ if let Some(outside_array) = outside.as_array() [INFO] [stdout] 354 ~ && !outside_array.is_empty() { [INFO] [stdout] 355 | self.selected_entry_index = 0; [INFO] [stdout] 356 | self.set_status("Jumped to first OUTSIDE entry"); [INFO] [stdout] 357 | return; [INFO] [stdout] 358 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:386:13 [INFO] [stdout] | [INFO] [stdout] 386 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 387 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 388 | | let outside_count = obj [INFO] [stdout] 389 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 404 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 386 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 387 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 388 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 402 | } [INFO] [stdout] 403 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/duplicate.rs:13:13 [INFO] [stdout] | [INFO] [stdout] 13 | / if let Ok(mut json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 14 | | if let Some(obj) = json_value.as_object_mut() { [INFO] [stdout] 15 | | let outside_count = obj [INFO] [stdout] 16 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 73 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 13 ~ if let Ok(mut json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 14 ~ && let Some(obj) = json_value.as_object_mut() { [INFO] [stdout] 15 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 71 | } [INFO] [stdout] 72 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/duplicate.rs:24:25 [INFO] [stdout] | [INFO] [stdout] 24 | / if let Some(outside) = obj.get_mut("outside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 25 | | if target_idx < outside.len() { [INFO] [stdout] 26 | | let entry_clone = outside[target_idx].clone(); [INFO] [stdout] 27 | | outside.insert(target_idx + 1, entry_clone); [INFO] [stdout] ... | [INFO] [stdout] 45 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 24 ~ if let Some(outside) = obj.get_mut("outside").and_then(|v| v.as_array_mut()) [INFO] [stdout] 25 ~ && target_idx < outside.len() { [INFO] [stdout] 26 | let entry_clone = outside[target_idx].clone(); [INFO] [stdout] ... [INFO] [stdout] 43 | } [INFO] [stdout] 44 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:394:21 [INFO] [stdout] | [INFO] [stdout] 394 | / if let Some(inside) = obj.get("inside") { [INFO] [stdout] 395 | | if let Some(inside_array) = inside.as_array() { [INFO] [stdout] 396 | | if !inside_array.is_empty() && outside_count < self.relf_entries.len() { [INFO] [stdout] 397 | | self.selected_entry_index = outside_count; [INFO] [stdout] ... | [INFO] [stdout] 402 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 394 ~ if let Some(inside) = obj.get("inside") [INFO] [stdout] 395 ~ && let Some(inside_array) = inside.as_array() { [INFO] [stdout] 396 | if !inside_array.is_empty() && outside_count < self.relf_entries.len() { [INFO] [stdout] ... [INFO] [stdout] 400 | } [INFO] [stdout] 401 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:395:25 [INFO] [stdout] | [INFO] [stdout] 395 | / if let Some(inside_array) = inside.as_array() { [INFO] [stdout] 396 | | if !inside_array.is_empty() && outside_count < self.relf_entries.len() { [INFO] [stdout] 397 | | self.selected_entry_index = outside_count; [INFO] [stdout] 398 | | self.set_status("Jumped to first INSIDE entry"); [INFO] [stdout] ... | [INFO] [stdout] 401 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 395 ~ if let Some(inside_array) = inside.as_array() [INFO] [stdout] 396 ~ && !inside_array.is_empty() && outside_count < self.relf_entries.len() { [INFO] [stdout] 397 | self.selected_entry_index = outside_count; [INFO] [stdout] 398 | self.set_status("Jumped to first INSIDE entry"); [INFO] [stdout] 399 | return; [INFO] [stdout] 400 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/duplicate.rs:49:25 [INFO] [stdout] | [INFO] [stdout] 49 | / if let Some(inside) = obj.get_mut("inside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 50 | | if inside_index < inside.len() { [INFO] [stdout] 51 | | let entry_clone = inside[inside_index].clone(); [INFO] [stdout] 52 | | inside.insert(inside_index + 1, entry_clone); [INFO] [stdout] ... | [INFO] [stdout] 70 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 49 ~ if let Some(inside) = obj.get_mut("inside").and_then(|v| v.as_array_mut()) [INFO] [stdout] 50 ~ && inside_index < inside.len() { [INFO] [stdout] 51 | let entry_clone = inside[inside_index].clone(); [INFO] [stdout] ... [INFO] [stdout] 68 | } [INFO] [stdout] 69 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/helpers.rs:11:13 [INFO] [stdout] | [INFO] [stdout] 11 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 12 | | if !outside.is_empty() { [INFO] [stdout] 13 | | output_lines.push("## OUTSIDE".to_string()); [INFO] [stdout] 14 | | output_lines.push("".to_string()); [INFO] [stdout] ... | [INFO] [stdout] 52 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 11 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 12 ~ && !outside.is_empty() { [INFO] [stdout] 13 | output_lines.push("## OUTSIDE".to_string()); [INFO] [stdout] ... [INFO] [stdout] 50 | } [INFO] [stdout] 51 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/helpers.rs:32:29 [INFO] [stdout] | [INFO] [stdout] 32 | / ... if let Some(url_str) = url { [INFO] [stdout] 33 | | ... if !url_str.is_empty() { [INFO] [stdout] 34 | | ... output_lines.push("".to_string()); [INFO] [stdout] 35 | | ... output_lines.push(format!("**URL:** {}", url_str)); [INFO] [stdout] 36 | | ... } [INFO] [stdout] 37 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 32 ~ if let Some(url_str) = url [INFO] [stdout] 33 ~ && !url_str.is_empty() { [INFO] [stdout] 34 | output_lines.push("".to_string()); [INFO] [stdout] 35 | output_lines.push(format!("**URL:** {}", url_str)); [INFO] [stdout] 36 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/helpers.rs:55:13 [INFO] [stdout] | [INFO] [stdout] 55 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 56 | | if !inside.is_empty() { [INFO] [stdout] 57 | | output_lines.push("## INSIDE".to_string()); [INFO] [stdout] 58 | | output_lines.push("".to_string()); [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#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 55 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 56 ~ && !inside.is_empty() { [INFO] [stdout] 57 | output_lines.push("## INSIDE".to_string()); [INFO] [stdout] ... [INFO] [stdout] 78 | } [INFO] [stdout] 79 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:16:25 [INFO] [stdout] | [INFO] [stdout] 16 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 17 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 18 | | // Convert JSON to Markdown [INFO] [stdout] 19 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... | [INFO] [stdout] 24 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 16 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 17 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 18 | // Convert JSON to Markdown [INFO] [stdout] ... [INFO] [stdout] 22 | } [INFO] [stdout] 23 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:32:25 [INFO] [stdout] | [INFO] [stdout] 32 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 33 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 34 | | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] 35 | | return; [INFO] [stdout] 36 | | } [INFO] [stdout] 37 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 32 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 33 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 34 | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] 35 | return; [INFO] [stdout] 36 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/outline.rs:122:13 [INFO] [stdout] | [INFO] [stdout] 122 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 123 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 124 | | let outside_count = obj.get("outside") [INFO] [stdout] 125 | | .and_then(|v| v.as_array()) [INFO] [stdout] ... | [INFO] [stdout] 134 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 122 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 123 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 124 | let outside_count = obj.get("outside") [INFO] [stdout] ... [INFO] [stdout] 132 | return outside_count + inside_count; [INFO] [stdout] 133 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:164:25 [INFO] [stdout] | [INFO] [stdout] 164 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 165 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 166 | | // Convert JSON to Markdown [INFO] [stdout] 167 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... | [INFO] [stdout] 172 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 164 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 165 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 166 | // Convert JSON to Markdown [INFO] [stdout] ... [INFO] [stdout] 170 | } [INFO] [stdout] 171 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:180:25 [INFO] [stdout] | [INFO] [stdout] 180 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 181 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 182 | | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 183 | | return; [INFO] [stdout] 184 | | } [INFO] [stdout] 185 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 180 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 181 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 182 | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 183 | return; [INFO] [stdout] 184 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/app/outline.rs:192:29 [INFO] [stdout] | [INFO] [stdout] 192 | let title = entry.lines.first() [INFO] [stdout] | _____________________________^ [INFO] [stdout] 193 | | .map(|s| s.clone()) [INFO] [stdout] | |_______________________________________^ help: consider calling the dedicated `cloned` method: `entry.lines.first().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/outline.rs:245:17 [INFO] [stdout] | [INFO] [stdout] 245 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 246 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 247 | | // Add OUTSIDE entries [INFO] [stdout] 248 | | if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] ... | [INFO] [stdout] 293 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 245 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 246 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 247 | // Add OUTSIDE entries [INFO] [stdout] ... [INFO] [stdout] 291 | } [INFO] [stdout] 292 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:310:25 [INFO] [stdout] | [INFO] [stdout] 310 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 311 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 312 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 313 | | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] ... | [INFO] [stdout] 318 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 310 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 311 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 312 | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... [INFO] [stdout] 316 | } [INFO] [stdout] 317 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:311:29 [INFO] [stdout] | [INFO] [stdout] 311 | / ... if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 312 | | ... if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 313 | | ... self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 314 | | ... self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] ... | [INFO] [stdout] 317 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 311 ~ if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) [INFO] [stdout] 312 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 313 | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 314 | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] 315 | return; [INFO] [stdout] 316 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `entries` [INFO] [stdout] --> src/app/outline.rs:316:18 [INFO] [stdout] | [INFO] [stdout] 316 | for i in start_index..entries.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 316 - for i in start_index..entries.len() { [INFO] [stdout] 316 + for (i, ) in entries.iter().enumerate().skip(start_index) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:326:25 [INFO] [stdout] | [INFO] [stdout] 326 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 327 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 328 | | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 329 | | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] ... | [INFO] [stdout] 332 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 326 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 327 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 328 | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 329 | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] 330 | return; [INFO] [stdout] 331 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `entries` [INFO] [stdout] --> src/app/outline.rs:324:18 [INFO] [stdout] | [INFO] [stdout] 324 | for i in 0..start_index { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 324 - for i in 0..start_index { [INFO] [stdout] 324 + for (i, ) in entries.iter().enumerate().take(start_index) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/app/pdf.rs:127:21 [INFO] [stdout] | [INFO] [stdout] 127 | / if let Some(parsed_font) = ParsedFont::from_bytes(&font_bytes, 0, &mut warnings) { [INFO] [stdout] 128 | | Some(doc.add_font(&parsed_font)) [INFO] [stdout] 129 | | } else { [INFO] [stdout] 130 | | None [INFO] [stdout] 131 | | } [INFO] [stdout] | |_____________________^ help: try: `ParsedFont::from_bytes(&font_bytes, 0, &mut warnings).map(|parsed_font| doc.add_font(&parsed_font))` [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: stripping a prefix manually [INFO] [stdout] --> src/app/pdf.rs:154:17 [INFO] [stdout] | [INFO] [stdout] 154 | &trimmed[3..] [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/app/pdf.rs:153:24 [INFO] [stdout] | [INFO] [stdout] 153 | let text = if trimmed.starts_with("## ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 153 ~ let text = if let Some() = trimmed.strip_prefix("## ") { [INFO] [stdout] 154 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/app/pdf.rs:156:17 [INFO] [stdout] | [INFO] [stdout] 156 | &trimmed[4..] [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/app/pdf.rs:155:20 [INFO] [stdout] | [INFO] [stdout] 155 | } else if trimmed.starts_with("### ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 155 ~ } else if let Some() = trimmed.strip_prefix("### ") { [INFO] [stdout] 156 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/overwrite.rs:16:25 [INFO] [stdout] | [INFO] [stdout] 16 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 17 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 18 | | // Convert JSON to Markdown [INFO] [stdout] 19 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... | [INFO] [stdout] 24 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 16 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 17 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 18 | // Convert JSON to Markdown [INFO] [stdout] ... [INFO] [stdout] 22 | } [INFO] [stdout] 23 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/overwrite.rs:32:25 [INFO] [stdout] | [INFO] [stdout] 32 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 33 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 34 | | self.paste_markdown_section_overwrite(&md_text, "INSIDE"); [INFO] [stdout] 35 | | return; [INFO] [stdout] 36 | | } [INFO] [stdout] 37 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 32 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 33 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 34 | self.paste_markdown_section_overwrite(&md_text, "INSIDE"); [INFO] [stdout] 35 | return; [INFO] [stdout] 36 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/overwrite.rs:145:25 [INFO] [stdout] | [INFO] [stdout] 145 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 146 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 147 | | // Convert JSON to Markdown [INFO] [stdout] 148 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... | [INFO] [stdout] 153 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 145 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 146 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 147 | // Convert JSON to Markdown [INFO] [stdout] ... [INFO] [stdout] 151 | } [INFO] [stdout] 152 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/overwrite.rs:161:25 [INFO] [stdout] | [INFO] [stdout] 161 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 162 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 163 | | self.paste_markdown_section_overwrite(&md_text, "OUTSIDE"); [INFO] [stdout] 164 | | return; [INFO] [stdout] 165 | | } [INFO] [stdout] 166 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 161 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 162 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 163 | self.paste_markdown_section_overwrite(&md_text, "OUTSIDE"); [INFO] [stdout] 164 | return; [INFO] [stdout] 165 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:11:13 [INFO] [stdout] | [INFO] [stdout] 11 | / if let Ok(clipboard_json) = serde_json::from_str::(text) { [INFO] [stdout] 12 | | if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 13 | | if let Some(new_inside) = clipboard_obj.get("inside") { [INFO] [stdout] 14 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... | [INFO] [stdout] 25 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 11 ~ if let Ok(clipboard_json) = serde_json::from_str::(text) [INFO] [stdout] 12 ~ && let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 13 | if let Some(new_inside) = clipboard_obj.get("inside") { [INFO] [stdout] ... [INFO] [stdout] 23 | } [INFO] [stdout] 24 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BuiltinFont` which implements the `Copy` trait [INFO] [stdout] --> src/app/pdf.rs:202:35 [INFO] [stdout] | [INFO] [stdout] 202 | ... font: font.clone(), [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `font` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:12:17 [INFO] [stdout] | [INFO] [stdout] 12 | / if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 13 | | if let Some(new_inside) = clipboard_obj.get("inside") { [INFO] [stdout] 14 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 15 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... | [INFO] [stdout] 24 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 12 ~ if let Some(clipboard_obj) = clipboard_json.as_object() [INFO] [stdout] 13 ~ && let Some(new_inside) = clipboard_obj.get("inside") { [INFO] [stdout] 14 | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... [INFO] [stdout] 22 | } [INFO] [stdout] 23 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:13:21 [INFO] [stdout] | [INFO] [stdout] 13 | / if let Some(new_inside) = clipboard_obj.get("inside") { [INFO] [stdout] 14 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 15 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 16 | | current_obj.insert("inside".to_string(), new_inside.clone()); [INFO] [stdout] ... | [INFO] [stdout] 23 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 13 ~ if let Some(new_inside) = clipboard_obj.get("inside") [INFO] [stdout] 14 ~ && let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 15 | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... [INFO] [stdout] 21 | } [INFO] [stdout] 22 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BuiltinFont` which implements the `Copy` trait [INFO] [stdout] --> src/app/pdf.rs:207:35 [INFO] [stdout] | [INFO] [stdout] 207 | ... font: font.clone(), [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `font` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:14:25 [INFO] [stdout] | [INFO] [stdout] 14 | / if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 15 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 16 | | current_obj.insert("inside".to_string(), new_inside.clone()); [INFO] [stdout] 17 | | self.json_input = serde_json::to_string_pretty(¤t_json).unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 22 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 14 ~ if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 15 ~ && let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 16 | current_obj.insert("inside".to_string(), new_inside.clone()); [INFO] [stdout] ... [INFO] [stdout] 20 | self.set_status("INSIDE section overwritten"); [INFO] [stdout] 21 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/app/pdf.rs:214:21 [INFO] [stdout] | [INFO] [stdout] 214 | current_y = current_y - line_height; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `current_y -= line_height` [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: manual implementation of an assign operation [INFO] [stdout] --> src/app/pdf.rs:217:17 [INFO] [stdout] | [INFO] [stdout] 217 | current_y = current_y - line_height; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `current_y -= line_height` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:35:13 [INFO] [stdout] | [INFO] [stdout] 35 | / if let Ok(clipboard_json) = serde_json::from_str::(text) { [INFO] [stdout] 36 | | if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 37 | | if let Some(new_outside) = clipboard_obj.get("outside") { [INFO] [stdout] 38 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... | [INFO] [stdout] 49 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 35 ~ if let Ok(clipboard_json) = serde_json::from_str::(text) [INFO] [stdout] 36 ~ && let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 37 | if let Some(new_outside) = clipboard_obj.get("outside") { [INFO] [stdout] ... [INFO] [stdout] 47 | } [INFO] [stdout] 48 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:36:17 [INFO] [stdout] | [INFO] [stdout] 36 | / if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 37 | | if let Some(new_outside) = clipboard_obj.get("outside") { [INFO] [stdout] 38 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 39 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... | [INFO] [stdout] 48 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 36 ~ if let Some(clipboard_obj) = clipboard_json.as_object() [INFO] [stdout] 37 ~ && let Some(new_outside) = clipboard_obj.get("outside") { [INFO] [stdout] 38 | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... [INFO] [stdout] 46 | } [INFO] [stdout] 47 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:37:21 [INFO] [stdout] | [INFO] [stdout] 37 | / if let Some(new_outside) = clipboard_obj.get("outside") { [INFO] [stdout] 38 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 39 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 40 | | current_obj.insert("outside".to_string(), new_outside.clone()); [INFO] [stdout] ... | [INFO] [stdout] 47 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 37 ~ if let Some(new_outside) = clipboard_obj.get("outside") [INFO] [stdout] 38 ~ && let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 39 | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... [INFO] [stdout] 45 | } [INFO] [stdout] 46 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:38:25 [INFO] [stdout] | [INFO] [stdout] 38 | / if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 39 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 40 | | current_obj.insert("outside".to_string(), new_outside.clone()); [INFO] [stdout] 41 | | self.json_input = serde_json::to_string_pretty(¤t_json).unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 46 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 38 ~ if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 39 ~ && let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 40 | current_obj.insert("outside".to_string(), new_outside.clone()); [INFO] [stdout] ... [INFO] [stdout] 44 | self.set_status("OUTSIDE section overwritten"); [INFO] [stdout] 45 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:59:13 [INFO] [stdout] | [INFO] [stdout] 59 | / if let Ok(clipboard_json) = serde_json::from_str::(text) { [INFO] [stdout] 60 | | if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 61 | | if let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 62 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... | [INFO] [stdout] 79 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 59 ~ if let Ok(clipboard_json) = serde_json::from_str::(text) [INFO] [stdout] 60 ~ && let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 61 | if let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] ... [INFO] [stdout] 77 | } [INFO] [stdout] 78 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:60:17 [INFO] [stdout] | [INFO] [stdout] 60 | / if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 61 | | if let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 62 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 63 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... | [INFO] [stdout] 78 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 60 ~ if let Some(clipboard_obj) = clipboard_json.as_object() [INFO] [stdout] 61 ~ && let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 62 | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... [INFO] [stdout] 76 | } [INFO] [stdout] 77 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:61:21 [INFO] [stdout] | [INFO] [stdout] 61 | / if let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 62 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 63 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 64 | | let current_inside = current_obj [INFO] [stdout] ... | [INFO] [stdout] 77 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 61 ~ if let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 62 ~ && let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 63 | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... [INFO] [stdout] 75 | } [INFO] [stdout] 76 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:62:25 [INFO] [stdout] | [INFO] [stdout] 62 | / if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 63 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 64 | | let current_inside = current_obj [INFO] [stdout] 65 | | .entry("inside".to_string()) [INFO] [stdout] ... | [INFO] [stdout] 76 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 62 ~ if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 63 ~ && let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 64 | let current_inside = current_obj [INFO] [stdout] ... [INFO] [stdout] 74 | } [INFO] [stdout] 75 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `entries` [INFO] [stdout] --> src/app/search.rs:24:22 [INFO] [stdout] | [INFO] [stdout] 24 | for i in 0..entries.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 24 - for i in 0..entries.len() { [INFO] [stdout] 24 + for (i, ) in entries.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:89:13 [INFO] [stdout] | [INFO] [stdout] 89 | / if let Ok(clipboard_json) = serde_json::from_str::(text) { [INFO] [stdout] 90 | | if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 91 | | if let Some(new_outside) = clipboard_obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 92 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... | [INFO] [stdout] 109 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 89 ~ if let Ok(clipboard_json) = serde_json::from_str::(text) [INFO] [stdout] 90 ~ && let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 91 | if let Some(new_outside) = clipboard_obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] ... [INFO] [stdout] 107 | } [INFO] [stdout] 108 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:90:17 [INFO] [stdout] | [INFO] [stdout] 90 | / if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 91 | | if let Some(new_outside) = clipboard_obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 92 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 93 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... | [INFO] [stdout] 108 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 90 ~ if let Some(clipboard_obj) = clipboard_json.as_object() [INFO] [stdout] 91 ~ && let Some(new_outside) = clipboard_obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 92 | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... [INFO] [stdout] 106 | } [INFO] [stdout] 107 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:91:21 [INFO] [stdout] | [INFO] [stdout] 91 | / if let Some(new_outside) = clipboard_obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 92 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 93 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 94 | | let current_outside = current_obj [INFO] [stdout] ... | [INFO] [stdout] 107 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 91 ~ if let Some(new_outside) = clipboard_obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 92 ~ && let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 93 | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... [INFO] [stdout] 105 | } [INFO] [stdout] 106 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:92:25 [INFO] [stdout] | [INFO] [stdout] 92 | / if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 93 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 94 | | let current_outside = current_obj [INFO] [stdout] 95 | | .entry("outside".to_string()) [INFO] [stdout] ... | [INFO] [stdout] 106 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 92 ~ if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 93 ~ && let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 94 | let current_outside = current_obj [INFO] [stdout] ... [INFO] [stdout] 104 | } [INFO] [stdout] 105 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:121:13 [INFO] [stdout] | [INFO] [stdout] 121 | / if let Ok(clipboard_json) = serde_json::from_str::(text) { [INFO] [stdout] 122 | | if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 123 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 124 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... | [INFO] [stdout] 158 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 121 ~ if let Ok(clipboard_json) = serde_json::from_str::(text) [INFO] [stdout] 122 ~ && let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 123 | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... [INFO] [stdout] 156 | } [INFO] [stdout] 157 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/search.rs:44:17 [INFO] [stdout] | [INFO] [stdout] 44 | / if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 45 | | if filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 46 | | let found_name = filename.to_string(); [INFO] [stdout] 47 | | self.explorer_selected_index = i; [INFO] [stdout] ... | [INFO] [stdout] 52 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 44 ~ if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) [INFO] [stdout] 45 ~ && filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 46 | let found_name = filename.to_string(); [INFO] [stdout] ... [INFO] [stdout] 50 | return; [INFO] [stdout] 51 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:122:17 [INFO] [stdout] | [INFO] [stdout] 122 | / if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 123 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 124 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 125 | | let mut appended_count = 0; [INFO] [stdout] ... | [INFO] [stdout] 157 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 122 ~ if let Some(clipboard_obj) = clipboard_json.as_object() [INFO] [stdout] 123 ~ && let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 124 | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... [INFO] [stdout] 155 | } [INFO] [stdout] 156 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:123:21 [INFO] [stdout] | [INFO] [stdout] 123 | / if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 124 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 125 | | let mut appended_count = 0; [INFO] [stdout] ... | [INFO] [stdout] 156 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 123 ~ if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 124 ~ && let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 125 | let mut appended_count = 0; [INFO] [stdout] ... [INFO] [stdout] 154 | self.set_status(&format!("Appended {} entries total", appended_count)); [INFO] [stdout] 155 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/url.rs:49:41 [INFO] [stdout] | [INFO] [stdout] 49 | / ... if let Some(name_val) = obj.get("name") { [INFO] [stdout] 50 | | ... if entry.lines.iter().any(|l| l.contains(&name_val.as_str().unwrap_or(""))) { [INFO] [stdout] 51 | | ... obj.insert("url".to_string(), Value::String(url.to_string())); [INFO] [stdout] 52 | | ... break; [INFO] [stdout] 53 | | ... } [INFO] [stdout] 54 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 49 ~ if let Some(name_val) = obj.get("name") [INFO] [stdout] 50 ~ && entry.lines.iter().any(|l| l.contains(&name_val.as_str().unwrap_or(""))) { [INFO] [stdout] 51 | obj.insert("url".to_string(), Value::String(url.to_string())); [INFO] [stdout] 52 | break; [INFO] [stdout] 53 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/app/search.rs:92:60 [INFO] [stdout] | [INFO] [stdout] 92 | for (_line_idx, line) in entry.lines.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] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 92 - for (_line_idx, line) in entry.lines.iter().enumerate() { [INFO] [stdout] 92 + for line in entry.lines.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/app/clipboard/paste/url.rs:50:86 [INFO] [stdout] | [INFO] [stdout] 50 | ... if entry.lines.iter().any(|l| l.contains(&name_val.as_str().unwrap_or(""))) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `name_val.as_str().unwrap_or("")` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/command.rs:10:9 [INFO] [stdout] | [INFO] [stdout] 10 | / if self.explorer_open && self.explorer_has_focus { [INFO] [stdout] 11 | | if self.vim_buffer == "go" { [INFO] [stdout] 12 | | // Preview file without moving focus (NERDTree-like) [INFO] [stdout] 13 | | self.explorer_preview_entry(); [INFO] [stdout] ... | [INFO] [stdout] 17 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 10 ~ if self.explorer_open && self.explorer_has_focus [INFO] [stdout] 11 ~ && self.vim_buffer == "go" { [INFO] [stdout] 12 | // Preview file without moving focus (NERDTree-like) [INFO] [stdout] ... [INFO] [stdout] 15 | return true; [INFO] [stdout] 16 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/search.rs:199:9 [INFO] [stdout] | [INFO] [stdout] 199 | / if let Some(match_idx) = self.current_match_index { [INFO] [stdout] 200 | | if let Some(&(line, col)) = self.search_matches.get(match_idx) { [INFO] [stdout] 201 | | if self.format_mode == FormatMode::Edit { [INFO] [stdout] 202 | | self.content_cursor_line = line; [INFO] [stdout] ... | [INFO] [stdout] 222 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 199 ~ if let Some(match_idx) = self.current_match_index [INFO] [stdout] 200 ~ && let Some(&(line, col)) = self.search_matches.get(match_idx) { [INFO] [stdout] 201 | if self.format_mode == FormatMode::Edit { [INFO] [stdout] ... [INFO] [stdout] 220 | } [INFO] [stdout] 221 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/app/command.rs:296:24 [INFO] [stdout] | [INFO] [stdout] 296 | if value >= 1 && value <= 10 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1..=10).contains(&value)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] = note: `#[warn(clippy::manual_range_contains)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `parent` after checking its variant with `is_none` [INFO] [stdout] --> src/app/completion.rs:117:17 [INFO] [stdout] | [INFO] [stdout] 114 | let dir = if parent.is_none() || parent == Some(std::path::Path::new("")) { [INFO] [stdout] | ---------------- the check is happening here [INFO] [stdout] ... [INFO] [stdout] 117 | parent.unwrap().to_path_buf() [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `if let` or `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/app/completion.rs:108:109 [INFO] [stdout] | [INFO] [stdout] 108 | let (dir, file_prefix) = if partial.ends_with('/') || partial.ends_with('\\') || partial.is_empty() { [INFO] [stdout] | _____________________________________________________________________________________________________________^ [INFO] [stdout] 109 | | (path_buf.clone(), String::new()) [INFO] [stdout] 110 | | } else if path_buf.is_dir() { [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/app/completion.rs:110:37 [INFO] [stdout] | [INFO] [stdout] 110 | } else if path_buf.is_dir() { [INFO] [stdout] | _____________________________________^ [INFO] [stdout] 111 | | (path_buf.clone(), String::new()) [INFO] [stdout] 112 | | } else { [INFO] [stdout] | |_________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] = note: `#[warn(clippy::if_same_then_else)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this creates an owned instance just for comparison [INFO] [stdout] --> src/app/completion.rs:131:41 [INFO] [stdout] | [INFO] [stdout] 131 | let is_current_dir = dir == PathBuf::from(".") || dir == current_dir; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: try: `*"."` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned [INFO] [stdout] = note: `#[warn(clippy::cmp_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/app/edit.rs:88:33 [INFO] [stdout] | [INFO] [stdout] 88 | ... return; [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] 87 - self.edit_cursor_pos = 0; [INFO] [stdout] 88 - return; [INFO] [stdout] 87 + self.edit_cursor_pos = 0; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:18:9 [INFO] [stdout] | [INFO] [stdout] 18 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 19 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 20 | | let mut current_idx = 0; [INFO] [stdout] ... | [INFO] [stdout] 94 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 18 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 19 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 20 | let mut current_idx = 0; [INFO] [stdout] ... [INFO] [stdout] 92 | } [INFO] [stdout] 93 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:23:17 [INFO] [stdout] | [INFO] [stdout] 23 | / if let Some(outside) = obj.get("outside") { [INFO] [stdout] 24 | | if let Some(outside_array) = outside.as_array() { [INFO] [stdout] 25 | | if target_idx < current_idx + outside_array.len() { [INFO] [stdout] 26 | | let local_idx = target_idx - current_idx; [INFO] [stdout] ... | [INFO] [stdout] 60 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 23 ~ if let Some(outside) = obj.get("outside") [INFO] [stdout] 24 ~ && let Some(outside_array) = outside.as_array() { [INFO] [stdout] 25 | if target_idx < current_idx + outside_array.len() { [INFO] [stdout] ... [INFO] [stdout] 58 | current_idx += outside_array.len(); [INFO] [stdout] 59 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:63:17 [INFO] [stdout] | [INFO] [stdout] 63 | / if let Some(inside) = obj.get("inside") { [INFO] [stdout] 64 | | if let Some(inside_array) = inside.as_array() { [INFO] [stdout] 65 | | if target_idx < current_idx + inside_array.len() { [INFO] [stdout] 66 | | let local_idx = target_idx - current_idx; [INFO] [stdout] ... | [INFO] [stdout] 92 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 63 ~ if let Some(inside) = obj.get("inside") [INFO] [stdout] 64 ~ && let Some(inside_array) = inside.as_array() { [INFO] [stdout] 65 | if target_idx < current_idx + inside_array.len() { [INFO] [stdout] ... [INFO] [stdout] 90 | } [INFO] [stdout] 91 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:64:21 [INFO] [stdout] | [INFO] [stdout] 64 | / if let Some(inside_array) = inside.as_array() { [INFO] [stdout] 65 | | if target_idx < current_idx + inside_array.len() { [INFO] [stdout] 66 | | let local_idx = target_idx - current_idx; [INFO] [stdout] 67 | | if let Some(entry_obj) = inside_array[local_idx].as_object() { [INFO] [stdout] ... | [INFO] [stdout] 91 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 64 ~ if let Some(inside_array) = inside.as_array() [INFO] [stdout] 65 ~ && target_idx < current_idx + inside_array.len() { [INFO] [stdout] 66 | let local_idx = target_idx - current_idx; [INFO] [stdout] ... [INFO] [stdout] 89 | } [INFO] [stdout] 90 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:119:21 [INFO] [stdout] | [INFO] [stdout] 119 | / if let Some(outside) = obj.get_mut("outside") { [INFO] [stdout] 120 | | if let Some(outside_array) = outside.as_array_mut() { [INFO] [stdout] 121 | | if target_idx < current_idx + outside_array.len() { [INFO] [stdout] 122 | | let local_idx = target_idx - current_idx; [INFO] [stdout] ... | [INFO] [stdout] 159 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 119 ~ if let Some(outside) = obj.get_mut("outside") [INFO] [stdout] 120 ~ && let Some(outside_array) = outside.as_array_mut() { [INFO] [stdout] 121 | if target_idx < current_idx + outside_array.len() { [INFO] [stdout] ... [INFO] [stdout] 157 | } [INFO] [stdout] 158 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/app/edit.rs:125:40 [INFO] [stdout] | [INFO] [stdout] 125 | ... if self.edit_buffer.len() >= 1 && self.edit_buffer_is_placeholder.len() >= 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.edit_buffer.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/app/edit.rs:125:71 [INFO] [stdout] | [INFO] [stdout] 125 | ... if self.edit_buffer.len() >= 1 && self.edit_buffer_is_placeholder.len() >= 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.edit_buffer_is_placeholder.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:162:21 [INFO] [stdout] | [INFO] [stdout] 162 | / if !found { [INFO] [stdout] 163 | | if let Some(inside) = obj.get_mut("inside") { [INFO] [stdout] 164 | | if let Some(inside_array) = inside.as_array_mut() { [INFO] [stdout] 165 | | let local_idx = target_idx - current_idx; [INFO] [stdout] ... | [INFO] [stdout] 186 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 162 ~ if !found [INFO] [stdout] 163 ~ && let Some(inside) = obj.get_mut("inside") { [INFO] [stdout] 164 | if let Some(inside_array) = inside.as_array_mut() { [INFO] [stdout] ... [INFO] [stdout] 184 | } [INFO] [stdout] 185 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:163:25 [INFO] [stdout] | [INFO] [stdout] 163 | / if let Some(inside) = obj.get_mut("inside") { [INFO] [stdout] 164 | | if let Some(inside_array) = inside.as_array_mut() { [INFO] [stdout] 165 | | let local_idx = target_idx - current_idx; [INFO] [stdout] 166 | | if local_idx < inside_array.len() { [INFO] [stdout] ... | [INFO] [stdout] 185 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 163 ~ if let Some(inside) = obj.get_mut("inside") [INFO] [stdout] 164 ~ && let Some(inside_array) = inside.as_array_mut() { [INFO] [stdout] 165 | let local_idx = target_idx - current_idx; [INFO] [stdout] ... [INFO] [stdout] 183 | } [INFO] [stdout] 184 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:166:33 [INFO] [stdout] | [INFO] [stdout] 166 | / ... if local_idx < inside_array.len() { [INFO] [stdout] 167 | | ... if let Some(entry_obj) = inside_array[local_idx].as_object_mut() { [INFO] [stdout] 168 | | ... // Update fields (date and context for inside) - use placeholder flags [INFO] [stdout] 169 | | ... if self.edit_buffer.len() >= 1 && self.edit_buffer_is_placeholder.len() >= 1 { [INFO] [stdout] ... | [INFO] [stdout] 183 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 166 ~ if local_idx < inside_array.len() [INFO] [stdout] 167 ~ && let Some(entry_obj) = inside_array[local_idx].as_object_mut() { [INFO] [stdout] 168 | // Update fields (date and context for inside) - use placeholder flags [INFO] [stdout] ... [INFO] [stdout] 181 | found = true; [INFO] [stdout] 182 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/app/edit.rs:169:44 [INFO] [stdout] | [INFO] [stdout] 169 | ... if self.edit_buffer.len() >= 1 && self.edit_buffer_is_placeholder.len() >= 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.edit_buffer.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to one [INFO] [stdout] --> src/app/edit.rs:169:75 [INFO] [stdout] | [INFO] [stdout] 169 | ... if self.edit_buffer.len() >= 1 && self.edit_buffer_is_placeholder.len() >= 1 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!self.edit_buffer_is_placeholder.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:582:21 [INFO] [stdout] | [INFO] [stdout] 582 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 583 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 584 | | let outside_count = obj [INFO] [stdout] 585 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 593 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 582 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 583 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 584 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 591 | self.scroll = 0; [INFO] [stdout] 592 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:650:21 [INFO] [stdout] | [INFO] [stdout] 650 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 651 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 652 | | let outside_count = obj [INFO] [stdout] 653 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 661 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 650 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 651 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 652 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 659 | self.scroll = 0; [INFO] [stdout] 660 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/toon.rs:104:13 [INFO] [stdout] | [INFO] [stdout] 104 | / if field == "percentage" { [INFO] [stdout] 105 | | if let Ok(num) = value.parse::() { [INFO] [stdout] 106 | | entry.insert(field.clone(), json!(num)); [INFO] [stdout] 107 | | continue; [INFO] [stdout] 108 | | } [INFO] [stdout] 109 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 104 ~ if field == "percentage" [INFO] [stdout] 105 ~ && let Ok(num) = value.parse::() { [INFO] [stdout] 106 | entry.insert(field.clone(), json!(num)); [INFO] [stdout] 107 | continue; [INFO] [stdout] 108 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/app/toon.rs:125:9 [INFO] [stdout] | [INFO] [stdout] 125 | while let Some(ch) = chars.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for ch in chars` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/edit.rs:737:9 [INFO] [stdout] | [INFO] [stdout] 737 | / if self.format_mode == FormatMode::Edit { [INFO] [stdout] 738 | | if self.content_cursor_line < lines.len() { [INFO] [stdout] 739 | | let current = &lines[self.content_cursor_line]; [INFO] [stdout] 740 | | let cursor_display_col = self.prefix_display_width(current, self.content_cursor_col) as u16; [INFO] [stdout] ... | [INFO] [stdout] 757 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 737 ~ if self.format_mode == FormatMode::Edit [INFO] [stdout] 738 ~ && self.content_cursor_line < lines.len() { [INFO] [stdout] 739 | let current = &lines[self.content_cursor_line]; [INFO] [stdout] ... [INFO] [stdout] 755 | // Otherwise, keep hscroll unchanged (camera stays put) [INFO] [stdout] 756 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/toon.rs:156:9 [INFO] [stdout] | [INFO] [stdout] 156 | / if let Some(outside) = json_value.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 157 | | if !outside.is_empty() { [INFO] [stdout] 158 | | let fields = vec!["name", "context", "url", "percentage"]; [INFO] [stdout] 159 | | toon_output.push_str(&format!("outside[{}]{{{}}}:\n", [INFO] [stdout] ... | [INFO] [stdout] 171 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 156 ~ if let Some(outside) = json_value.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 157 ~ && !outside.is_empty() { [INFO] [stdout] 158 | let fields = vec!["name", "context", "url", "percentage"]; [INFO] [stdout] ... [INFO] [stdout] 169 | toon_output.push('\n'); [INFO] [stdout] 170 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/toon.rs:174:9 [INFO] [stdout] | [INFO] [stdout] 174 | / if let Some(inside) = json_value.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 175 | | if !inside.is_empty() { [INFO] [stdout] 176 | | let fields = vec!["date", "context"]; [INFO] [stdout] 177 | | toon_output.push_str(&format!("inside[{}]{{{}}}:\n", [INFO] [stdout] ... | [INFO] [stdout] 188 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 174 ~ if let Some(inside) = json_value.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 175 ~ && !inside.is_empty() { [INFO] [stdout] 176 | let fields = vec!["date", "context"]; [INFO] [stdout] ... [INFO] [stdout] 186 | } [INFO] [stdout] 187 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/app/edit.rs:974:32 [INFO] [stdout] | [INFO] [stdout] 974 | let is_context_field = (self.edit_buffer.len() == 2 && self.edit_field_index == 1) || [INFO] [stdout] | ________________________________^ [INFO] [stdout] 975 | | (self.edit_buffer.len() == 4 && self.edit_field_index == 1); [INFO] [stdout] | |__________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 974 - let is_context_field = (self.edit_buffer.len() == 2 && self.edit_field_index == 1) || [INFO] [stdout] 975 - (self.edit_buffer.len() == 4 && self.edit_field_index == 1); [INFO] [stdout] 974 + let is_context_field = !(self.edit_field_index != 1 || self.edit_buffer.len() != 2 && self.edit_buffer.len() != 4); [INFO] [stdout] | [INFO] [stdout] 974 - let is_context_field = (self.edit_buffer.len() == 2 && self.edit_field_index == 1) || [INFO] [stdout] 975 - (self.edit_buffer.len() == 4 && self.edit_field_index == 1); [INFO] [stdout] 974 + let is_context_field = (self.edit_buffer.len() == 4 || self.edit_buffer.len() == 2) && self.edit_field_index == 1; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/toon.rs:236:9 [INFO] [stdout] | [INFO] [stdout] 236 | / if self.is_toon_file() { [INFO] [stdout] 237 | | if let Ok(toon_str) = self.convert_to_toon() { [INFO] [stdout] 238 | | self.toon_input = toon_str; [INFO] [stdout] 239 | | return true; [INFO] [stdout] 240 | | } [INFO] [stdout] 241 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 236 ~ if self.is_toon_file() [INFO] [stdout] 237 ~ && let Ok(toon_str) = self.convert_to_toon() { [INFO] [stdout] 238 | self.toon_input = toon_str; [INFO] [stdout] 239 | return true; [INFO] [stdout] 240 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/app.rs:322:9 [INFO] [stdout] | [INFO] [stdout] 222 | / let app = Self { [INFO] [stdout] 223 | | input_mode: InputMode::Normal, [INFO] [stdout] 224 | | json_input: String::new(), [INFO] [stdout] 225 | | markdown_input: String::new(), [INFO] [stdout] ... | [INFO] [stdout] 319 | | markdown_highlight_cache: Vec::new(), [INFO] [stdout] 320 | | }; [INFO] [stdout] | |__________- unnecessary `let` binding [INFO] [stdout] 321 | [INFO] [stdout] 322 | app [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] 222 ~ [INFO] [stdout] 223 | [INFO] [stdout] 224 ~ Self { [INFO] [stdout] 225 + input_mode: InputMode::Normal, [INFO] [stdout] 226 + json_input: String::new(), [INFO] [stdout] 227 + markdown_input: String::new(), [INFO] [stdout] 228 + toon_input: String::new(), [INFO] [stdout] 229 + rendered_content: vec![], [INFO] [stdout] 230 + relf_line_styles: Vec::new(), [INFO] [stdout] 231 + relf_visual_styles: Vec::new(), [INFO] [stdout] 232 + relf_entries: Vec::new(), [INFO] [stdout] 233 + selected_entry_index: 0, [INFO] [stdout] 234 + editing_entry: false, [INFO] [stdout] 235 + edit_buffer: Vec::new(), [INFO] [stdout] 236 + edit_buffer_is_placeholder: Vec::new(), [INFO] [stdout] 237 + edit_field_index: 0, [INFO] [stdout] 238 + edit_field_editing_mode: false, [INFO] [stdout] 239 + edit_insert_mode: false, [INFO] [stdout] 240 + edit_skip_normal_mode: false, [INFO] [stdout] 241 + edit_cursor_pos: 0, [INFO] [stdout] 242 + edit_hscroll: 0, [INFO] [stdout] 243 + edit_vscroll: 0, [INFO] [stdout] 244 + edit_yank_buffer: String::new(), [INFO] [stdout] 245 + showing_help: false, [INFO] [stdout] 246 + scroll: 0, [INFO] [stdout] 247 + max_scroll: 0, [INFO] [stdout] 248 + status_message: "".to_string(), [INFO] [stdout] 249 + status_time: Some(Instant::now()), [INFO] [stdout] 250 + file_path: None, [INFO] [stdout] 251 + vim_buffer: String::new(), [INFO] [stdout] 252 + format_mode, [INFO] [stdout] 253 + previous_format_mode: format_mode, // Initialize with same mode [INFO] [stdout] 254 + command_buffer: String::new(), [INFO] [stdout] 255 + completion_candidates: Vec::new(), [INFO] [stdout] 256 + completion_index: 0, [INFO] [stdout] 257 + completion_original: String::new(), [INFO] [stdout] 258 + is_modified: false, [INFO] [stdout] 259 + content_cursor_line: 0, [INFO] [stdout] 260 + content_cursor_col: 0, [INFO] [stdout] 261 + show_cursor: true, [INFO] [stdout] 262 + dd_count: 0, [INFO] [stdout] 263 + yy_count: 0, [INFO] [stdout] 264 + line_yank_buffer: String::new(), [INFO] [stdout] 265 + content_width: 80, [INFO] [stdout] 266 + hscroll: 0, [INFO] [stdout] 267 + visible_height: 20, [INFO] [stdout] 268 + search_query: String::new(), [INFO] [stdout] 269 + search_buffer: String::new(), [INFO] [stdout] 270 + search_matches: Vec::new(), [INFO] [stdout] 271 + current_match_index: None, [INFO] [stdout] 272 + filter_pattern: String::new(), [INFO] [stdout] 273 + undo_stack: Vec::new(), [INFO] [stdout] 274 + redo_stack: Vec::new(), [INFO] [stdout] 275 + auto_reload: true, [INFO] [stdout] 276 + last_save_time: None, [INFO] [stdout] 277 + file_path_changed: false, [INFO] [stdout] 278 + dragging_scrollbar: None, [INFO] [stdout] 279 + substitute_confirmations: Vec::new(), [INFO] [stdout] 280 + current_substitute_index: 0, [INFO] [stdout] 281 + last_click_time: None, [INFO] [stdout] 282 + show_line_numbers: rc_config.show_line_numbers, [INFO] [stdout] 283 + show_relative_line_numbers: rc_config.show_relative_line_numbers, [INFO] [stdout] 284 + show_extension: rc_config.show_extension, [INFO] [stdout] 285 + max_visible_cards: rc_config.max_visible_cards, [INFO] [stdout] 286 + command_history: Vec::new(), [INFO] [stdout] 287 + search_history: Vec::new(), [INFO] [stdout] 288 + command_history_index: None, [INFO] [stdout] 289 + search_history_index: None, [INFO] [stdout] 290 + explorer_open: false, [INFO] [stdout] 291 + explorer_entries: Vec::new(), [INFO] [stdout] 292 + explorer_selected_index: 0, [INFO] [stdout] 293 + explorer_scroll: 0, [INFO] [stdout] 294 + explorer_horizontal_scroll: 0, [INFO] [stdout] 295 + explorer_current_dir: std::env::current_dir().unwrap_or_else(|_| PathBuf::from(".")), [INFO] [stdout] 296 + explorer_has_focus: true, // Explorer has focus when opened [INFO] [stdout] 297 + explorer_dir_changed: false, [INFO] [stdout] 298 + file_op_pending: None, [INFO] [stdout] 299 + file_op_prompt_buffer: String::new(), [INFO] [stdout] 300 + visual_mode: false, [INFO] [stdout] 301 + visual_start_index: 0, [INFO] [stdout] 302 + visual_end_index: 0, [INFO] [stdout] 303 + view_edit_mode: false, [INFO] [stdout] 304 + colorscheme: rc_config.colorscheme, [INFO] [stdout] 305 + border_style: rc_config.border_style, [INFO] [stdout] 306 + outline_open: false, [INFO] [stdout] 307 + outline_selected_index: 0, [INFO] [stdout] 308 + outline_scroll: 0, [INFO] [stdout] 309 + outline_horizontal_scroll: 0, [INFO] [stdout] 310 + outline_opened_from_explorer: false, [INFO] [stdout] 311 + outline_has_focus: false, [INFO] [stdout] 312 + outline_search_query: String::new(), [INFO] [stdout] 313 + outline_search_matches: Vec::new(), [INFO] [stdout] 314 + outline_search_current: 0, [INFO] [stdout] 315 + file_mode: if rc_config.default_format.as_deref() == Some("markdown") { [INFO] [stdout] 316 + FileMode::Markdown [INFO] [stdout] 317 + } else { [INFO] [stdout] 318 + FileMode::Json [INFO] [stdout] 319 + }, [INFO] [stdout] 320 + syntax_highlighter: None, [INFO] [stdout] 321 + markdown_highlight_cache: Vec::new(), [INFO] [stdout] 322 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/app.rs:379:17 [INFO] [stdout] | [INFO] [stdout] 379 | return; [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] 378 - // This branch should not be reached during normal operation [INFO] [stdout] 379 - return; [INFO] [stdout] 378 + // This branch should not be reached during normal operation [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/explorer.rs:293:13 [INFO] [stdout] | [INFO] [stdout] 293 | / if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 294 | | if filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 295 | | self.explorer_selected_index = i; [INFO] [stdout] 296 | | self.explorer_update_scroll(); [INFO] [stdout] ... | [INFO] [stdout] 299 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 293 ~ if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) [INFO] [stdout] 294 ~ && filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 295 | self.explorer_selected_index = i; [INFO] [stdout] 296 | self.explorer_update_scroll(); [INFO] [stdout] 297 | return; [INFO] [stdout] 298 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/explorer.rs:304:13 [INFO] [stdout] | [INFO] [stdout] 304 | / if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 305 | | if filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 306 | | self.explorer_selected_index = i; [INFO] [stdout] 307 | | self.explorer_update_scroll(); [INFO] [stdout] ... | [INFO] [stdout] 310 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 304 ~ if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) [INFO] [stdout] 305 ~ && filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 306 | self.explorer_selected_index = i; [INFO] [stdout] 307 | self.explorer_update_scroll(); [INFO] [stdout] 308 | return; [INFO] [stdout] 309 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/explorer.rs:334:13 [INFO] [stdout] | [INFO] [stdout] 334 | / if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 335 | | if filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 336 | | self.explorer_selected_index = i; [INFO] [stdout] 337 | | self.explorer_update_scroll(); [INFO] [stdout] ... | [INFO] [stdout] 340 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 334 ~ if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) [INFO] [stdout] 335 ~ && filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 336 | self.explorer_selected_index = i; [INFO] [stdout] 337 | self.explorer_update_scroll(); [INFO] [stdout] 338 | return; [INFO] [stdout] 339 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app.rs:470:9 [INFO] [stdout] | [INFO] [stdout] 470 | / if let Some(time) = self.status_time { [INFO] [stdout] 471 | | if time.elapsed() > Duration::from_secs(3) { [INFO] [stdout] 472 | | self.status_message = String::new(); [INFO] [stdout] 473 | | self.status_time = None; [INFO] [stdout] 474 | | } [INFO] [stdout] 475 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 470 ~ if let Some(time) = self.status_time [INFO] [stdout] 471 ~ && time.elapsed() > Duration::from_secs(3) { [INFO] [stdout] 472 | self.status_message = String::new(); [INFO] [stdout] 473 | self.status_time = None; [INFO] [stdout] 474 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/explorer.rs:345:13 [INFO] [stdout] | [INFO] [stdout] 345 | / if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 346 | | if filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 347 | | self.explorer_selected_index = i; [INFO] [stdout] 348 | | self.explorer_update_scroll(); [INFO] [stdout] ... | [INFO] [stdout] 351 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 345 ~ if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) [INFO] [stdout] 346 ~ && filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 347 | self.explorer_selected_index = i; [INFO] [stdout] 348 | self.explorer_update_scroll(); [INFO] [stdout] 349 | return; [INFO] [stdout] 350 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `lines` [INFO] [stdout] --> src/app.rs:573:18 [INFO] [stdout] | [INFO] [stdout] 573 | for i in 0..self.content_cursor_line.min(lines.len()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 573 - for i in 0..self.content_cursor_line.min(lines.len()) { [INFO] [stdout] 573 + for in lines.iter().take(self.content_cursor_line.min(lines.len())) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `default` can be confused for the standard trait method `std::default::Default::default` [INFO] [stdout] --> src/config/colorscheme.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | / pub fn default() -> Self { [INFO] [stdout] 43 | | Self { [INFO] [stdout] 44 | | name: "Default", [INFO] [stdout] 45 | | background: Color::Black, [INFO] [stdout] ... | [INFO] [stdout] 79 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/explorer_ops.rs:310:17 [INFO] [stdout] | [INFO] [stdout] 310 | / if is_move_operation { [INFO] [stdout] 311 | | if let Some(parent) = new_path.parent() { [INFO] [stdout] 312 | | if !parent.exists() { [INFO] [stdout] 313 | | if let Err(e) = fs::create_dir_all(parent) { [INFO] [stdout] ... | [INFO] [stdout] 321 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 310 ~ if is_move_operation [INFO] [stdout] 311 ~ && let Some(parent) = new_path.parent() { [INFO] [stdout] 312 | if !parent.exists() { [INFO] [stdout] ... [INFO] [stdout] 319 | } [INFO] [stdout] 320 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/explorer_ops.rs:311:21 [INFO] [stdout] | [INFO] [stdout] 311 | / if let Some(parent) = new_path.parent() { [INFO] [stdout] 312 | | if !parent.exists() { [INFO] [stdout] 313 | | if let Err(e) = fs::create_dir_all(parent) { [INFO] [stdout] 314 | | self.set_status(&format!("Error creating directories: {}", e)); [INFO] [stdout] ... | [INFO] [stdout] 320 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 311 ~ if let Some(parent) = new_path.parent() [INFO] [stdout] 312 ~ && !parent.exists() { [INFO] [stdout] 313 | if let Err(e) = fs::create_dir_all(parent) { [INFO] [stdout] ... [INFO] [stdout] 318 | } [INFO] [stdout] 319 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/explorer_ops.rs:312:25 [INFO] [stdout] | [INFO] [stdout] 312 | / if !parent.exists() { [INFO] [stdout] 313 | | if let Err(e) = fs::create_dir_all(parent) { [INFO] [stdout] 314 | | self.set_status(&format!("Error creating directories: {}", e)); [INFO] [stdout] 315 | | self.file_op_pending = None; [INFO] [stdout] ... | [INFO] [stdout] 319 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 312 ~ if !parent.exists() [INFO] [stdout] 313 ~ && let Err(e) = fs::create_dir_all(parent) { [INFO] [stdout] 314 | self.set_status(&format!("Error creating directories: {}", e)); [INFO] [stdout] ... [INFO] [stdout] 317 | return; [INFO] [stdout] 318 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/config/rc.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | / impl Default for BorderStyle { [INFO] [stdout] 12 | | fn default() -> Self { [INFO] [stdout] 13 | | BorderStyle::Rounded [INFO] [stdout] 14 | | } [INFO] [stdout] 15 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 6 + #[derive(Default)] [INFO] [stdout] 7 | pub enum BorderStyle { [INFO] [stdout] 8 ~ #[default] [INFO] [stdout] 9 ~ Rounded, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/config/rc.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | / if let Some(rc_path) = Self::get_rc_path() { [INFO] [stdout] 58 | | if let Ok(contents) = fs::read_to_string(&rc_path) { [INFO] [stdout] 59 | | config.parse(&contents); [INFO] [stdout] 60 | | } [INFO] [stdout] 61 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 57 ~ if let Some(rc_path) = Self::get_rc_path() [INFO] [stdout] 58 ~ && let Ok(contents) = fs::read_to_string(&rc_path) { [INFO] [stdout] 59 | config.parse(&contents); [INFO] [stdout] 60 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/config/rc.rs:98:17 [INFO] [stdout] | [INFO] [stdout] 98 | / if parts.len() >= 2 { [INFO] [stdout] 99 | | self.handle_set(&parts[1..]); [INFO] [stdout] 100 | | } [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] 97 ~ "set" [INFO] [stdout] 98 ~ if parts.len() >= 2 => { [INFO] [stdout] 99 | self.handle_set(&parts[1..]); [INFO] [stdout] 100 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/config/rc.rs:103:17 [INFO] [stdout] | [INFO] [stdout] 103 | / if parts.len() >= 2 { [INFO] [stdout] 104 | | self.handle_colorscheme(parts[1]); [INFO] [stdout] 105 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 102 ~ "colorscheme" [INFO] [stdout] 103 ~ if parts.len() >= 2 => { [INFO] [stdout] 104 | self.handle_colorscheme(parts[1]); [INFO] [stdout] 105 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/config/rc.rs:149:21 [INFO] [stdout] | [INFO] [stdout] 149 | / if let Ok(value) = value_str.parse::() { [INFO] [stdout] 150 | | if value >= 1 && value <= 10 { [INFO] [stdout] 151 | | self.max_visible_cards = value; [INFO] [stdout] 152 | | } [INFO] [stdout] 153 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 149 ~ if let Ok(value) = value_str.parse::() [INFO] [stdout] 150 ~ && value >= 1 && value <= 10 { [INFO] [stdout] 151 | self.max_visible_cards = value; [INFO] [stdout] 152 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/config/rc.rs:150:28 [INFO] [stdout] | [INFO] [stdout] 150 | if value >= 1 && value <= 10 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1..=10).contains(&value)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/config/rc.rs:190:9 [INFO] [stdout] | [INFO] [stdout] 190 | config.show_line_numbers = true; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `config::rc::RcConfig { show_line_numbers: true, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/config/rc.rs:189:9 [INFO] [stdout] | [INFO] [stdout] 189 | let mut config = RcConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/config/rc.rs:243:9 [INFO] [stdout] | [INFO] [stdout] 243 | config.border_style = BorderStyle::Plain; // Start with plain [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `config::rc::RcConfig { border_style: BorderStyle::Plain, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/config/rc.rs:242:9 [INFO] [stdout] | [INFO] [stdout] 242 | let mut config = RcConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/file.rs:467:9 [INFO] [stdout] | [INFO] [stdout] 467 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 468 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 469 | | // OUTSIDE section [INFO] [stdout] 470 | | if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] ... | [INFO] [stdout] 545 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 467 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 468 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 469 | // OUTSIDE section [INFO] [stdout] ... [INFO] [stdout] 543 | } [INFO] [stdout] 544 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/file.rs:470:17 [INFO] [stdout] | [INFO] [stdout] 470 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 471 | | if !outside.is_empty() { [INFO] [stdout] 472 | | output_lines.push("## OUTSIDE".to_string()); [INFO] [stdout] 473 | | output_lines.push("".to_string()); [INFO] [stdout] ... | [INFO] [stdout] 513 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 470 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 471 ~ && !outside.is_empty() { [INFO] [stdout] 472 | output_lines.push("## OUTSIDE".to_string()); [INFO] [stdout] ... [INFO] [stdout] 511 | } [INFO] [stdout] 512 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/file.rs:493:33 [INFO] [stdout] | [INFO] [stdout] 493 | / ... if let Some(url_str) = url { [INFO] [stdout] 494 | | ... if !url_str.is_empty() { [INFO] [stdout] 495 | | ... output_lines.push("".to_string()); [INFO] [stdout] 496 | | ... output_lines.push(format!("**URL:** {}", url_str)); [INFO] [stdout] 497 | | ... } [INFO] [stdout] 498 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 493 ~ if let Some(url_str) = url [INFO] [stdout] 494 ~ && !url_str.is_empty() { [INFO] [stdout] 495 | output_lines.push("".to_string()); [INFO] [stdout] 496 | output_lines.push(format!("**URL:** {}", url_str)); [INFO] [stdout] 497 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/config/rc.rs:278:9 [INFO] [stdout] | [INFO] [stdout] 278 | config.show_relative_line_numbers = true; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `config::rc::RcConfig { show_relative_line_numbers: true, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/config/rc.rs:277:9 [INFO] [stdout] | [INFO] [stdout] 277 | let mut config = RcConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/file.rs:516:17 [INFO] [stdout] | [INFO] [stdout] 516 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 517 | | if !inside.is_empty() { [INFO] [stdout] 518 | | output_lines.push("## INSIDE".to_string()); [INFO] [stdout] 519 | | output_lines.push("".to_string()); [INFO] [stdout] ... | [INFO] [stdout] 543 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 516 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 517 ~ && !inside.is_empty() { [INFO] [stdout] 518 | output_lines.push("## INSIDE".to_string()); [INFO] [stdout] ... [INFO] [stdout] 541 | } [INFO] [stdout] 542 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/config/rc.rs:286:9 [INFO] [stdout] | [INFO] [stdout] 286 | config.show_relative_line_numbers = true; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `config::rc::RcConfig { show_relative_line_numbers: true, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/config/rc.rs:285:9 [INFO] [stdout] | [INFO] [stdout] 285 | let mut config = RcConfig::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/input/event_loop.rs:116:25 [INFO] [stdout] | [INFO] [stdout] 116 | / loop { [INFO] [stdout] 117 | | if let Ok(true) = event::poll(Duration::from_millis(1000)) { [INFO] [stdout] 118 | | if let Ok(Event::Key(next_key)) = event::read() { [INFO] [stdout] 119 | | #[cfg(target_os = "windows")] [INFO] [stdout] ... | [INFO] [stdout] 174 | | } [INFO] [stdout] | |_________________________^ help: try: `while let Ok(true) = event::poll(Duration::from_millis(1000)) { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/app/markdown.rs:55:31 [INFO] [stdout] | [INFO] [stdout] 55 | let trimmed = line[4..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/app/markdown.rs:54:20 [INFO] [stdout] | [INFO] [stdout] 54 | } else if line.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] 54 ~ } else if let Some() = line.strip_prefix("### ") { [INFO] [stdout] 55 ~ let trimmed = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/input/mouse.rs:37:13 [INFO] [stdout] | [INFO] [stdout] 37 | / if app.dragging_scrollbar != Some(ScrollbarType::Horizontal) { [INFO] [stdout] 38 | | // If outline has focus, scroll outline [INFO] [stdout] 39 | | if app.outline_open && app.outline_has_focus { [INFO] [stdout] 40 | | app.outline_move_up(); [INFO] [stdout] ... | [INFO] [stdout] 65 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 35 ~ MouseEventKind::ScrollUp [INFO] [stdout] 36 | // Don't scroll vertically if horizontal scrollbar is being dragged [INFO] [stdout] 37 ~ if app.dragging_scrollbar != Some(ScrollbarType::Horizontal) => { [INFO] [stdout] 38 | // If outline has focus, scroll outline [INFO] [stdout] ... [INFO] [stdout] 64 | } [INFO] [stdout] 65 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/app/markdown.rs:60:31 [INFO] [stdout] | [INFO] [stdout] 60 | let trimmed = line[3..].trim(); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/app/markdown.rs:58:20 [INFO] [stdout] | [INFO] [stdout] 58 | } else if line.starts_with("###") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 58 ~ } else if let Some() = line.strip_prefix("###") { [INFO] [stdout] 59 | // Handle "###" without space (edge case) [INFO] [stdout] 60 ~ let trimmed = .trim(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/input/mouse.rs:69:13 [INFO] [stdout] | [INFO] [stdout] 69 | / if app.dragging_scrollbar != Some(ScrollbarType::Horizontal) { [INFO] [stdout] 70 | | // If outline has focus, scroll outline [INFO] [stdout] 71 | | if app.outline_open && app.outline_has_focus { [INFO] [stdout] 72 | | app.outline_move_down(); [INFO] [stdout] ... | [INFO] [stdout] 95 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 67 ~ MouseEventKind::ScrollDown [INFO] [stdout] 68 | // Don't scroll vertically if horizontal scrollbar is being dragged [INFO] [stdout] 69 ~ if app.dragging_scrollbar != Some(ScrollbarType::Horizontal) => { [INFO] [stdout] 70 | // If outline has focus, scroll outline [INFO] [stdout] ... [INFO] [stdout] 94 | } [INFO] [stdout] 95 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/input/mouse.rs:21:52 [INFO] [stdout] | [INFO] [stdout] 21 | if app.format_mode == FormatMode::View { [INFO] [stdout] | ____________________________________________________^ [INFO] [stdout] 22 | | app.relf_hscroll_by(-8); [INFO] [stdout] 23 | | } else if app.format_mode == FormatMode::Edit { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/input/mouse.rs:23:59 [INFO] [stdout] | [INFO] [stdout] 23 | } else if app.format_mode == FormatMode::Edit { [INFO] [stdout] | ___________________________________________________________^ [INFO] [stdout] 24 | | app.relf_hscroll_by(-8); [INFO] [stdout] 25 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/input/mouse.rs:29:52 [INFO] [stdout] | [INFO] [stdout] 29 | if app.format_mode == FormatMode::View { [INFO] [stdout] | ____________________________________________________^ [INFO] [stdout] 30 | | app.relf_hscroll_by(8); [INFO] [stdout] 31 | | } else if app.format_mode == FormatMode::Edit { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/input/mouse.rs:31:59 [INFO] [stdout] | [INFO] [stdout] 31 | } else if app.format_mode == FormatMode::Edit { [INFO] [stdout] | ___________________________________________________________^ [INFO] [stdout] 32 | | app.relf_hscroll_by(8); [INFO] [stdout] 33 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/app/markdown.rs:123:36 [INFO] [stdout] | [INFO] [stdout] 123 | url = Some(trimmed[8..].trim().to_string()); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/app/markdown.rs:122:21 [INFO] [stdout] | [INFO] [stdout] 122 | if trimmed.starts_with("**URL:**") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 122 ~ if let Some() = trimmed.strip_prefix("**URL:**") { [INFO] [stdout] 123 ~ url = Some(.trim().to_string()); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/app/markdown.rs:130:39 [INFO] [stdout] | [INFO] [stdout] 130 | let pct_str = trimmed[15..].trim().trim_end_matches('%'); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/app/markdown.rs:129:21 [INFO] [stdout] | [INFO] [stdout] 129 | if trimmed.starts_with("**Percentage:**") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 129 ~ if let Some() = trimmed.strip_prefix("**Percentage:**") { [INFO] [stdout] 130 ~ let pct_str = .trim().trim_end_matches('%'); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/app/markdown.rs:147:23 [INFO] [stdout] | [INFO] [stdout] 147 | while content_lines.last().map_or(false, |l| l.trim().is_empty()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 147 - while content_lines.last().map_or(false, |l| l.trim().is_empty()) { [INFO] [stdout] 147 + while content_lines.last().is_some_and(|l| l.trim().is_empty()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/markdown.rs:191:9 [INFO] [stdout] | [INFO] [stdout] 191 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 192 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 193 | | // OUTSIDE section [INFO] [stdout] 194 | | if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] ... | [INFO] [stdout] 265 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 191 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 192 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 193 | // OUTSIDE section [INFO] [stdout] ... [INFO] [stdout] 263 | } [INFO] [stdout] 264 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/markdown.rs:194:17 [INFO] [stdout] | [INFO] [stdout] 194 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 195 | | if !outside.is_empty() { [INFO] [stdout] 196 | | output_lines.push("## OUTSIDE".to_string()); [INFO] [stdout] 197 | | output_lines.push("".to_string()); [INFO] [stdout] ... | [INFO] [stdout] 235 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 194 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 195 ~ && !outside.is_empty() { [INFO] [stdout] 196 | output_lines.push("## OUTSIDE".to_string()); [INFO] [stdout] ... [INFO] [stdout] 233 | } [INFO] [stdout] 234 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/markdown.rs:215:33 [INFO] [stdout] | [INFO] [stdout] 215 | / ... if let Some(url_str) = url { [INFO] [stdout] 216 | | ... if !url_str.is_empty() { [INFO] [stdout] 217 | | ... output_lines.push("".to_string()); [INFO] [stdout] 218 | | ... output_lines.push(format!("**URL:** {}", url_str)); [INFO] [stdout] 219 | | ... } [INFO] [stdout] 220 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 215 ~ if let Some(url_str) = url [INFO] [stdout] 216 ~ && !url_str.is_empty() { [INFO] [stdout] 217 | output_lines.push("".to_string()); [INFO] [stdout] 218 | output_lines.push(format!("**URL:** {}", url_str)); [INFO] [stdout] 219 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/input/mouse.rs:295:13 [INFO] [stdout] | [INFO] [stdout] 295 | / if app.format_mode == FormatMode::Edit { [INFO] [stdout] 296 | | let click_x = mouse.column; [INFO] [stdout] 297 | | let terminal_width = [INFO] [stdout] 298 | | terminal.size().map(|s| s.width).unwrap_or(80); [INFO] [stdout] ... | [INFO] [stdout] 312 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 293 ~ Some(ScrollbarType::Horizontal) [INFO] [stdout] 294 | // Continue horizontal scrollbar drag (Edit mode only) [INFO] [stdout] 295 ~ if app.format_mode == FormatMode::Edit => { [INFO] [stdout] 296 | let click_x = mouse.column; [INFO] [stdout] ... [INFO] [stdout] 311 | } [INFO] [stdout] 312 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/markdown.rs:238:17 [INFO] [stdout] | [INFO] [stdout] 238 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 239 | | if !inside.is_empty() { [INFO] [stdout] 240 | | output_lines.push("## INSIDE".to_string()); [INFO] [stdout] 241 | | output_lines.push("".to_string()); [INFO] [stdout] ... | [INFO] [stdout] 263 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 238 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 239 ~ && !inside.is_empty() { [INFO] [stdout] 240 | output_lines.push("## INSIDE".to_string()); [INFO] [stdout] ... [INFO] [stdout] 261 | } [INFO] [stdout] 262 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/markdown.rs:273:9 [INFO] [stdout] | [INFO] [stdout] 273 | / if self.is_markdown_file() { [INFO] [stdout] 274 | | if let Ok(md_str) = self.convert_to_markdown() { [INFO] [stdout] 275 | | self.markdown_input = md_str; [INFO] [stdout] 276 | | return true; [INFO] [stdout] 277 | | } [INFO] [stdout] 278 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 273 ~ if self.is_markdown_file() [INFO] [stdout] 274 ~ && let Ok(md_str) = self.convert_to_markdown() { [INFO] [stdout] 275 | self.markdown_input = md_str; [INFO] [stdout] 276 | return true; [INFO] [stdout] 277 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:202:21 [INFO] [stdout] | [INFO] [stdout] 202 | / if let Some(outside) = obj.get_mut("outside") { [INFO] [stdout] 203 | | if let Some(outside_array) = outside.as_array_mut() { [INFO] [stdout] 204 | | let outside_count = outside_array.len(); [INFO] [stdout] 205 | | if target_idx < current_idx + outside_count { [INFO] [stdout] ... | [INFO] [stdout] 213 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 202 ~ if let Some(outside) = obj.get_mut("outside") [INFO] [stdout] 203 ~ && let Some(outside_array) = outside.as_array_mut() { [INFO] [stdout] 204 | let outside_count = outside_array.len(); [INFO] [stdout] ... [INFO] [stdout] 211 | } [INFO] [stdout] 212 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:216:21 [INFO] [stdout] | [INFO] [stdout] 216 | / if !found { [INFO] [stdout] 217 | | if let Some(inside) = obj.get_mut("inside") { [INFO] [stdout] 218 | | if let Some(inside_array) = inside.as_array_mut() { [INFO] [stdout] 219 | | let local_idx = target_idx - current_idx; [INFO] [stdout] ... | [INFO] [stdout] 226 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 216 ~ if !found [INFO] [stdout] 217 ~ && let Some(inside) = obj.get_mut("inside") { [INFO] [stdout] 218 | if let Some(inside_array) = inside.as_array_mut() { [INFO] [stdout] ... [INFO] [stdout] 224 | } [INFO] [stdout] 225 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:217:25 [INFO] [stdout] | [INFO] [stdout] 217 | / if let Some(inside) = obj.get_mut("inside") { [INFO] [stdout] 218 | | if let Some(inside_array) = inside.as_array_mut() { [INFO] [stdout] 219 | | let local_idx = target_idx - current_idx; [INFO] [stdout] 220 | | if local_idx < inside_array.len() { [INFO] [stdout] ... | [INFO] [stdout] 225 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 217 ~ if let Some(inside) = obj.get_mut("inside") [INFO] [stdout] 218 ~ && let Some(inside_array) = inside.as_array_mut() { [INFO] [stdout] 219 | let local_idx = target_idx - current_idx; [INFO] [stdout] ... [INFO] [stdout] 223 | } [INFO] [stdout] 224 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:382:21 [INFO] [stdout] | [INFO] [stdout] 382 | return Ok(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] 382 - return Ok(false); [INFO] [stdout] 382 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:394:21 [INFO] [stdout] | [INFO] [stdout] 394 | return Ok(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] 394 - return Ok(false); [INFO] [stdout] 394 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:406:21 [INFO] [stdout] | [INFO] [stdout] 406 | return Ok(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] 406 - return Ok(false); [INFO] [stdout] 406 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:422:21 [INFO] [stdout] | [INFO] [stdout] 422 | return Ok(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] 422 - return Ok(false); [INFO] [stdout] 422 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:424:22 [INFO] [stdout] | [INFO] [stdout] 424 | _ => return Ok(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] 424 - _ => return Ok(false), [INFO] [stdout] 424 + _ => Ok(false), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:432:21 [INFO] [stdout] | [INFO] [stdout] 432 | return Ok(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] 432 - return Ok(false); [INFO] [stdout] 432 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:436:21 [INFO] [stdout] | [INFO] [stdout] 436 | return Ok(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] 436 - return Ok(false); [INFO] [stdout] 436 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:457:21 [INFO] [stdout] | [INFO] [stdout] 457 | return Ok(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] 457 - return Ok(false); [INFO] [stdout] 457 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:482:21 [INFO] [stdout] | [INFO] [stdout] 482 | return Ok(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] 482 - return Ok(false); [INFO] [stdout] 482 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:484:22 [INFO] [stdout] | [INFO] [stdout] 484 | _ => return Ok(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] 484 - _ => return Ok(false), [INFO] [stdout] 484 + _ => Ok(false), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:350:13 [INFO] [stdout] | [INFO] [stdout] 350 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 351 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 352 | | if let Some(outside) = obj.get("outside") { [INFO] [stdout] 353 | | if let Some(outside_array) = outside.as_array() { [INFO] [stdout] ... | [INFO] [stdout] 362 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 350 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 351 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 352 | if let Some(outside) = obj.get("outside") { [INFO] [stdout] ... [INFO] [stdout] 360 | } [INFO] [stdout] 361 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:351:17 [INFO] [stdout] | [INFO] [stdout] 351 | / if let Some(obj) = json_value.as_object() { [INFO] [stdout] 352 | | if let Some(outside) = obj.get("outside") { [INFO] [stdout] 353 | | if let Some(outside_array) = outside.as_array() { [INFO] [stdout] 354 | | if !outside_array.is_empty() { [INFO] [stdout] ... | [INFO] [stdout] 361 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 351 ~ if let Some(obj) = json_value.as_object() [INFO] [stdout] 352 ~ && let Some(outside) = obj.get("outside") { [INFO] [stdout] 353 | if let Some(outside_array) = outside.as_array() { [INFO] [stdout] ... [INFO] [stdout] 359 | } [INFO] [stdout] 360 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:352:21 [INFO] [stdout] | [INFO] [stdout] 352 | / if let Some(outside) = obj.get("outside") { [INFO] [stdout] 353 | | if let Some(outside_array) = outside.as_array() { [INFO] [stdout] 354 | | if !outside_array.is_empty() { [INFO] [stdout] 355 | | self.selected_entry_index = 0; [INFO] [stdout] ... | [INFO] [stdout] 360 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 352 ~ if let Some(outside) = obj.get("outside") [INFO] [stdout] 353 ~ && let Some(outside_array) = outside.as_array() { [INFO] [stdout] 354 | if !outside_array.is_empty() { [INFO] [stdout] ... [INFO] [stdout] 358 | } [INFO] [stdout] 359 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:353:25 [INFO] [stdout] | [INFO] [stdout] 353 | / if let Some(outside_array) = outside.as_array() { [INFO] [stdout] 354 | | if !outside_array.is_empty() { [INFO] [stdout] 355 | | self.selected_entry_index = 0; [INFO] [stdout] 356 | | self.set_status("Jumped to first OUTSIDE entry"); [INFO] [stdout] ... | [INFO] [stdout] 359 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 353 ~ if let Some(outside_array) = outside.as_array() [INFO] [stdout] 354 ~ && !outside_array.is_empty() { [INFO] [stdout] 355 | self.selected_entry_index = 0; [INFO] [stdout] 356 | self.set_status("Jumped to first OUTSIDE entry"); [INFO] [stdout] 357 | return; [INFO] [stdout] 358 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:386:13 [INFO] [stdout] | [INFO] [stdout] 386 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 387 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 388 | | let outside_count = obj [INFO] [stdout] 389 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 404 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 386 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 387 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 388 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 402 | } [INFO] [stdout] 403 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:394:21 [INFO] [stdout] | [INFO] [stdout] 394 | / if let Some(inside) = obj.get("inside") { [INFO] [stdout] 395 | | if let Some(inside_array) = inside.as_array() { [INFO] [stdout] 396 | | if !inside_array.is_empty() && outside_count < self.relf_entries.len() { [INFO] [stdout] 397 | | self.selected_entry_index = outside_count; [INFO] [stdout] ... | [INFO] [stdout] 402 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 394 ~ if let Some(inside) = obj.get("inside") [INFO] [stdout] 395 ~ && let Some(inside_array) = inside.as_array() { [INFO] [stdout] 396 | if !inside_array.is_empty() && outside_count < self.relf_entries.len() { [INFO] [stdout] ... [INFO] [stdout] 400 | } [INFO] [stdout] 401 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/navigation.rs:395:25 [INFO] [stdout] | [INFO] [stdout] 395 | / if let Some(inside_array) = inside.as_array() { [INFO] [stdout] 396 | | if !inside_array.is_empty() && outside_count < self.relf_entries.len() { [INFO] [stdout] 397 | | self.selected_entry_index = outside_count; [INFO] [stdout] 398 | | self.set_status("Jumped to first INSIDE entry"); [INFO] [stdout] ... | [INFO] [stdout] 401 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 395 ~ if let Some(inside_array) = inside.as_array() [INFO] [stdout] 396 ~ && !inside_array.is_empty() && outside_count < self.relf_entries.len() { [INFO] [stdout] 397 | self.selected_entry_index = outside_count; [INFO] [stdout] 398 | self.set_status("Jumped to first INSIDE entry"); [INFO] [stdout] 399 | return; [INFO] [stdout] 400 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/input/normal_mode.rs:632:13 [INFO] [stdout] | [INFO] [stdout] 632 | / if key.modifiers.contains(KeyModifiers::CONTROL) { [INFO] [stdout] 633 | | app.outline_page_down(); [INFO] [stdout] 634 | | return Ok(false); [INFO] [stdout] 635 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 630 ~ KeyCode::Char('f') [INFO] [stdout] 631 | // Ctrl+f: page down [INFO] [stdout] 632 ~ if key.modifiers.contains(KeyModifiers::CONTROL) => { [INFO] [stdout] 633 | app.outline_page_down(); [INFO] [stdout] 634 | return Ok(false); [INFO] [stdout] 635 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/input/normal_mode.rs:639:13 [INFO] [stdout] | [INFO] [stdout] 639 | / if key.modifiers.contains(KeyModifiers::CONTROL) { [INFO] [stdout] 640 | | app.outline_page_up(); [INFO] [stdout] 641 | | return Ok(false); [INFO] [stdout] 642 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 637 ~ KeyCode::Char('b') [INFO] [stdout] 638 | // Ctrl+b: page up [INFO] [stdout] 639 ~ if key.modifiers.contains(KeyModifiers::CONTROL) => { [INFO] [stdout] 640 | app.outline_page_up(); [INFO] [stdout] 641 | return Ok(false); [INFO] [stdout] 642 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/input/overlay_mode.rs:171:17 [INFO] [stdout] | [INFO] [stdout] 171 | / if app.view_edit_mode && app.edit_field_index < app.edit_buffer.len() { [INFO] [stdout] 172 | | let field = &mut app.edit_buffer[app.edit_field_index]; [INFO] [stdout] 173 | | // Find byte index for character position [INFO] [stdout] 174 | | let byte_pos = if app.edit_cursor_pos == 0 { [INFO] [stdout] ... | [INFO] [stdout] 183 | | app.edit_cursor_pos += 1; // Move cursor past newline (1 character) [INFO] [stdout] 184 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 169 ~ KeyCode::Enter [INFO] [stdout] 170 | // In View Edit mode, insert newline character [INFO] [stdout] 171 ~ if app.view_edit_mode && app.edit_field_index < app.edit_buffer.len() => { [INFO] [stdout] 172 | let field = &mut app.edit_buffer[app.edit_field_index]; [INFO] [stdout] ... [INFO] [stdout] 183 | app.edit_cursor_pos += 1; // Move cursor past newline (1 character) [INFO] [stdout] 184 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/outline.rs:122:13 [INFO] [stdout] | [INFO] [stdout] 122 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 123 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 124 | | let outside_count = obj.get("outside") [INFO] [stdout] 125 | | .and_then(|v| v.as_array()) [INFO] [stdout] ... | [INFO] [stdout] 134 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 122 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 123 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 124 | let outside_count = obj.get("outside") [INFO] [stdout] ... [INFO] [stdout] 132 | return outside_count + inside_count; [INFO] [stdout] 133 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you are using an explicit closure for cloning elements [INFO] [stdout] --> src/app/outline.rs:192:29 [INFO] [stdout] | [INFO] [stdout] 192 | let title = entry.lines.first() [INFO] [stdout] | _____________________________^ [INFO] [stdout] 193 | | .map(|s| s.clone()) [INFO] [stdout] | |_______________________________________^ help: consider calling the dedicated `cloned` method: `entry.lines.first().cloned()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stdout] = note: `#[warn(clippy::map_clone)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/outline.rs:245:17 [INFO] [stdout] | [INFO] [stdout] 245 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 246 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 247 | | // Add OUTSIDE entries [INFO] [stdout] 248 | | if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] ... | [INFO] [stdout] 293 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 245 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 246 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 247 | // Add OUTSIDE entries [INFO] [stdout] ... [INFO] [stdout] 291 | } [INFO] [stdout] 292 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `entries` [INFO] [stdout] --> src/app/outline.rs:316:18 [INFO] [stdout] | [INFO] [stdout] 316 | for i in start_index..entries.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] = note: `#[warn(clippy::needless_range_loop)]` on by default [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 316 - for i in start_index..entries.len() { [INFO] [stdout] 316 + for (i, ) in entries.iter().enumerate().skip(start_index) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `entries` [INFO] [stdout] --> src/app/outline.rs:324:18 [INFO] [stdout] | [INFO] [stdout] 324 | for i in 0..start_index { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 324 - for i in 0..start_index { [INFO] [stdout] 324 + for (i, ) in entries.iter().enumerate().take(start_index) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/app/pdf.rs:127:21 [INFO] [stdout] | [INFO] [stdout] 127 | / if let Some(parsed_font) = ParsedFont::from_bytes(&font_bytes, 0, &mut warnings) { [INFO] [stdout] 128 | | Some(doc.add_font(&parsed_font)) [INFO] [stdout] 129 | | } else { [INFO] [stdout] 130 | | None [INFO] [stdout] 131 | | } [INFO] [stdout] | |_____________________^ help: try: `ParsedFont::from_bytes(&font_bytes, 0, &mut warnings).map(|parsed_font| doc.add_font(&parsed_font))` [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: stripping a prefix manually [INFO] [stdout] --> src/app/pdf.rs:154:17 [INFO] [stdout] | [INFO] [stdout] 154 | &trimmed[3..] [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/app/pdf.rs:153:24 [INFO] [stdout] | [INFO] [stdout] 153 | let text = if trimmed.starts_with("## ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 153 ~ let text = if let Some() = trimmed.strip_prefix("## ") { [INFO] [stdout] 154 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/app/pdf.rs:156:17 [INFO] [stdout] | [INFO] [stdout] 156 | &trimmed[4..] [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/app/pdf.rs:155:20 [INFO] [stdout] | [INFO] [stdout] 155 | } else if trimmed.starts_with("### ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 155 ~ } else if let Some() = trimmed.strip_prefix("### ") { [INFO] [stdout] 156 ~ [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `lines` [INFO] [stdout] --> src/input/overlay_mode.rs:706:26 [INFO] [stdout] | [INFO] [stdout] 706 | for i in 0..=current_line { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 706 - for i in 0..=current_line { [INFO] [stdout] 706 + for (i, ) in lines.iter().enumerate().take(current_line + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `lines` [INFO] [stdout] --> src/input/overlay_mode.rs:771:34 [INFO] [stdout] | [INFO] [stdout] 771 | for i in 0..current_line { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 771 - for i in 0..current_line { [INFO] [stdout] 771 + for in lines.iter().take(current_line) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BuiltinFont` which implements the `Copy` trait [INFO] [stdout] --> src/app/pdf.rs:202:35 [INFO] [stdout] | [INFO] [stdout] 202 | ... font: font.clone(), [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `font` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] = note: `#[warn(clippy::clone_on_copy)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `lines` [INFO] [stdout] --> src/input/overlay_mode.rs:842:26 [INFO] [stdout] | [INFO] [stdout] 842 | for i in 0..=current_line { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 842 - for i in 0..=current_line { [INFO] [stdout] 842 + for (i, ) in lines.iter().enumerate().take(current_line + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: using `clone` on type `BuiltinFont` which implements the `Copy` trait [INFO] [stdout] --> src/app/pdf.rs:207:35 [INFO] [stdout] | [INFO] [stdout] 207 | ... font: font.clone(), [INFO] [stdout] | ^^^^^^^^^^^^ help: try removing the `clone` call: `font` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/app/pdf.rs:214:21 [INFO] [stdout] | [INFO] [stdout] 214 | current_y = current_y - line_height; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `current_y -= line_height` [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: manual implementation of an assign operation [INFO] [stdout] --> src/app/pdf.rs:217:17 [INFO] [stdout] | [INFO] [stdout] 217 | current_y = current_y - line_height; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `current_y -= line_height` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/input/overlay_mode.rs:914:36 [INFO] [stdout] | [INFO] [stdout] 914 | let is_context_field = (app.edit_buffer.len() == 2 && app.edit_field_index == 1) || [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 915 | | (app.edit_buffer.len() == 4 && app.edit_field_index == 1); [INFO] [stdout] | |____________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 914 - let is_context_field = (app.edit_buffer.len() == 2 && app.edit_field_index == 1) || [INFO] [stdout] 915 - (app.edit_buffer.len() == 4 && app.edit_field_index == 1); [INFO] [stdout] 914 + let is_context_field = !(app.edit_field_index != 1 || app.edit_buffer.len() != 2 && app.edit_buffer.len() != 4); [INFO] [stdout] | [INFO] [stdout] 914 - let is_context_field = (app.edit_buffer.len() == 2 && app.edit_field_index == 1) || [INFO] [stdout] 915 - (app.edit_buffer.len() == 4 && app.edit_field_index == 1); [INFO] [stdout] 914 + let is_context_field = (app.edit_buffer.len() == 4 || app.edit_buffer.len() == 2) && app.edit_field_index == 1; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/input/overlay_mode.rs:927:36 [INFO] [stdout] | [INFO] [stdout] 927 | let is_context_field = (app.edit_buffer.len() == 2 && app.edit_field_index == 1) || [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 928 | | (app.edit_buffer.len() == 4 && app.edit_field_index == 1); [INFO] [stdout] | |____________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 927 - let is_context_field = (app.edit_buffer.len() == 2 && app.edit_field_index == 1) || [INFO] [stdout] 928 - (app.edit_buffer.len() == 4 && app.edit_field_index == 1); [INFO] [stdout] 927 + let is_context_field = !(app.edit_field_index != 1 || app.edit_buffer.len() != 2 && app.edit_buffer.len() != 4); [INFO] [stdout] | [INFO] [stdout] 927 - let is_context_field = (app.edit_buffer.len() == 2 && app.edit_field_index == 1) || [INFO] [stdout] 928 - (app.edit_buffer.len() == 4 && app.edit_field_index == 1); [INFO] [stdout] 927 + let is_context_field = (app.edit_buffer.len() == 4 || app.edit_buffer.len() == 2) && app.edit_field_index == 1; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/input/overlay_mode.rs:897:13 [INFO] [stdout] | [INFO] [stdout] 897 | / if app.edit_field_index > 0 { [INFO] [stdout] 898 | | app.edit_field_index -= 1; [INFO] [stdout] 899 | | app.edit_cursor_pos = 0; [INFO] [stdout] 900 | | app.edit_hscroll = 0; [INFO] [stdout] 901 | | app.edit_vscroll = 0; [INFO] [stdout] 902 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 896 ~ KeyCode::Up | KeyCode::Char('k') [INFO] [stdout] 897 ~ if app.edit_field_index > 0 => { [INFO] [stdout] 898 | app.edit_field_index -= 1; [INFO] [stdout] ... [INFO] [stdout] 901 | app.edit_vscroll = 0; [INFO] [stdout] 902 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/input/overlay_mode.rs:905:13 [INFO] [stdout] | [INFO] [stdout] 905 | / if app.edit_field_index + 1 < app.edit_buffer.len() { [INFO] [stdout] 906 | | app.edit_field_index += 1; [INFO] [stdout] 907 | | app.edit_cursor_pos = 0; [INFO] [stdout] 908 | | app.edit_hscroll = 0; [INFO] [stdout] 909 | | app.edit_vscroll = 0; [INFO] [stdout] 910 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 904 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 905 ~ if app.edit_field_index + 1 < app.edit_buffer.len() => { [INFO] [stdout] 906 | app.edit_field_index += 1; [INFO] [stdout] ... [INFO] [stdout] 909 | app.edit_vscroll = 0; [INFO] [stdout] 910 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `entries` [INFO] [stdout] --> src/app/search.rs:24:22 [INFO] [stdout] | [INFO] [stdout] 24 | for i in 0..entries.len() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 24 - for i in 0..entries.len() { [INFO] [stdout] 24 + for (i, ) in entries.iter().enumerate() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/search.rs:44:17 [INFO] [stdout] | [INFO] [stdout] 44 | / if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) { [INFO] [stdout] 45 | | if filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 46 | | let found_name = filename.to_string(); [INFO] [stdout] 47 | | self.explorer_selected_index = i; [INFO] [stdout] ... | [INFO] [stdout] 52 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 44 ~ if let Some(filename) = self.explorer_entries[i].path.file_name().and_then(|n| n.to_str()) [INFO] [stdout] 45 ~ && filename.to_lowercase().contains(&search_pattern.to_lowercase()) { [INFO] [stdout] 46 | let found_name = filename.to_string(); [INFO] [stdout] ... [INFO] [stdout] 50 | return; [INFO] [stdout] 51 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to use `.enumerate()` and immediately discard the index [INFO] [stdout] --> src/app/search.rs:92:60 [INFO] [stdout] | [INFO] [stdout] 92 | for (_line_idx, line) in entry.lines.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] = note: `#[warn(clippy::unused_enumerate_index)]` on by default [INFO] [stdout] help: remove the `.enumerate()` call [INFO] [stdout] | [INFO] [stdout] 92 - for (_line_idx, line) in entry.lines.iter().enumerate() { [INFO] [stdout] 92 + for line in entry.lines.iter() { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/search.rs:199:9 [INFO] [stdout] | [INFO] [stdout] 199 | / if let Some(match_idx) = self.current_match_index { [INFO] [stdout] 200 | | if let Some(&(line, col)) = self.search_matches.get(match_idx) { [INFO] [stdout] 201 | | if self.format_mode == FormatMode::Edit { [INFO] [stdout] 202 | | self.content_cursor_line = line; [INFO] [stdout] ... | [INFO] [stdout] 222 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 199 ~ if let Some(match_idx) = self.current_match_index [INFO] [stdout] 200 ~ && let Some(&(line, col)) = self.search_matches.get(match_idx) { [INFO] [stdout] 201 | if self.format_mode == FormatMode::Edit { [INFO] [stdout] ... [INFO] [stdout] 220 | } [INFO] [stdout] 221 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/json_ops.rs:65:29 [INFO] [stdout] | [INFO] [stdout] 65 | / ... if let Some(ref key) = current_key { [INFO] [stdout] 66 | | ... if let Some(arr) = obj.get_mut(key).and_then(|v| v.as_array_mut()) { [INFO] [stdout] 67 | | ... if item_index < arr.len() { [INFO] [stdout] 68 | | ... arr.remove(item_index); [INFO] [stdout] ... | [INFO] [stdout] 73 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 65 ~ if let Some(ref key) = current_key [INFO] [stdout] 66 ~ && let Some(arr) = obj.get_mut(key).and_then(|v| v.as_array_mut()) { [INFO] [stdout] 67 | if item_index < arr.len() { [INFO] [stdout] ... [INFO] [stdout] 71 | } [INFO] [stdout] 72 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/json_ops.rs:66:33 [INFO] [stdout] | [INFO] [stdout] 66 | / ... if let Some(arr) = obj.get_mut(key).and_then(|v| v.as_array_mut()) { [INFO] [stdout] 67 | | ... if item_index < arr.len() { [INFO] [stdout] 68 | | ... arr.remove(item_index); [INFO] [stdout] 69 | | ... deleted = true; [INFO] [stdout] ... | [INFO] [stdout] 72 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 66 ~ if let Some(arr) = obj.get_mut(key).and_then(|v| v.as_array_mut()) [INFO] [stdout] 67 ~ && item_index < arr.len() { [INFO] [stdout] 68 | arr.remove(item_index); [INFO] [stdout] 69 | deleted = true; [INFO] [stdout] 70 | break; [INFO] [stdout] 71 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/json_ops.rs:240:29 [INFO] [stdout] | [INFO] [stdout] 240 | / ... if let Some(ref key) = current_key { [INFO] [stdout] 241 | | ... if let Some(arr) = obj.get_mut(key).and_then(|v| v.as_array_mut()) { [INFO] [stdout] 242 | | ... if item_index < arr.len() { [INFO] [stdout] 243 | | ... let entry_clone = arr[item_index].clone(); [INFO] [stdout] ... | [INFO] [stdout] 249 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 240 ~ if let Some(ref key) = current_key [INFO] [stdout] 241 ~ && let Some(arr) = obj.get_mut(key).and_then(|v| v.as_array_mut()) { [INFO] [stdout] 242 | if item_index < arr.len() { [INFO] [stdout] ... [INFO] [stdout] 247 | } [INFO] [stdout] 248 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/json_ops.rs:241:33 [INFO] [stdout] | [INFO] [stdout] 241 | / ... if let Some(arr) = obj.get_mut(key).and_then(|v| v.as_array_mut()) { [INFO] [stdout] 242 | | ... if item_index < arr.len() { [INFO] [stdout] 243 | | ... let entry_clone = arr[item_index].clone(); [INFO] [stdout] 244 | | ... arr.insert(item_index + 1, entry_clone); [INFO] [stdout] ... | [INFO] [stdout] 248 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 241 ~ if let Some(arr) = obj.get_mut(key).and_then(|v| v.as_array_mut()) [INFO] [stdout] 242 ~ && item_index < arr.len() { [INFO] [stdout] 243 | let entry_clone = arr[item_index].clone(); [INFO] [stdout] ... [INFO] [stdout] 246 | break; [INFO] [stdout] 247 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_ops.rs:298:71 [INFO] [stdout] | [INFO] [stdout] 298 | b_percent.cmp(&a_percent).then_with(|| a_name.cmp(&b_name)) [INFO] [stdout] | ^^^^^^^ help: change this to: `b_name` [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/json_ops.rs:316:32 [INFO] [stdout] | [INFO] [stdout] 316 | b_date.cmp(&a_date) // Descending order (newest first) [INFO] [stdout] | ^^^^^^^ help: change this to: `a_date` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_ops.rs:374:32 [INFO] [stdout] | [INFO] [stdout] 374 | b_date.cmp(&a_date) // Descending order (newest first) [INFO] [stdout] | ^^^^^^^ help: change this to: `a_date` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_ops.rs:414:32 [INFO] [stdout] | [INFO] [stdout] 414 | a_name.cmp(&b_name) [INFO] [stdout] | ^^^^^^^ help: change this to: `b_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_ops.rs:432:32 [INFO] [stdout] | [INFO] [stdout] 432 | b_date.cmp(&a_date) // Descending order (newest first) [INFO] [stdout] | ^^^^^^^ help: change this to: `a_date` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_ops.rs:479:32 [INFO] [stdout] | [INFO] [stdout] 479 | b_date.cmp(&a_date) // Descending order (newest first) [INFO] [stdout] | ^^^^^^^ help: change this to: `a_date` [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` statement can be collapsed [INFO] [stdout] --> src/app/toon.rs:104:13 [INFO] [stdout] | [INFO] [stdout] 104 | / if field == "percentage" { [INFO] [stdout] 105 | | if let Ok(num) = value.parse::() { [INFO] [stdout] 106 | | entry.insert(field.clone(), json!(num)); [INFO] [stdout] 107 | | continue; [INFO] [stdout] 108 | | } [INFO] [stdout] 109 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 104 ~ if field == "percentage" [INFO] [stdout] 105 ~ && let Ok(num) = value.parse::() { [INFO] [stdout] 106 | entry.insert(field.clone(), json!(num)); [INFO] [stdout] 107 | continue; [INFO] [stdout] 108 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/app/toon.rs:125:9 [INFO] [stdout] | [INFO] [stdout] 125 | while let Some(ch) = chars.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for ch in chars` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] = note: `#[warn(clippy::while_let_on_iterator)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/toon.rs:156:9 [INFO] [stdout] | [INFO] [stdout] 156 | / if let Some(outside) = json_value.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 157 | | if !outside.is_empty() { [INFO] [stdout] 158 | | let fields = vec!["name", "context", "url", "percentage"]; [INFO] [stdout] 159 | | toon_output.push_str(&format!("outside[{}]{{{}}}:\n", [INFO] [stdout] ... | [INFO] [stdout] 171 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 156 ~ if let Some(outside) = json_value.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 157 ~ && !outside.is_empty() { [INFO] [stdout] 158 | let fields = vec!["name", "context", "url", "percentage"]; [INFO] [stdout] ... [INFO] [stdout] 169 | toon_output.push('\n'); [INFO] [stdout] 170 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/markdown_ops.rs:35:18 [INFO] [stdout] | [INFO] [stdout] 35 | (line[4..].trim().to_string(), true) [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/markdown_ops.rs:34:39 [INFO] [stdout] | [INFO] [stdout] 34 | let (title, has_header) = if line.starts_with("### ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 34 ~ let (title, has_header) = if let Some() = line.strip_prefix("### ") { [INFO] [stdout] 35 ~ (.trim().to_string(), true) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/toon.rs:174:9 [INFO] [stdout] | [INFO] [stdout] 174 | / if let Some(inside) = json_value.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 175 | | if !inside.is_empty() { [INFO] [stdout] 176 | | let fields = vec!["date", "context"]; [INFO] [stdout] 177 | | toon_output.push_str(&format!("inside[{}]{{{}}}:\n", [INFO] [stdout] ... | [INFO] [stdout] 188 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 174 ~ if let Some(inside) = json_value.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 175 ~ && !inside.is_empty() { [INFO] [stdout] 176 | let fields = vec!["date", "context"]; [INFO] [stdout] ... [INFO] [stdout] 186 | } [INFO] [stdout] 187 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/markdown_ops.rs:84:31 [INFO] [stdout] | [INFO] [stdout] 84 | url = trimmed[8..].trim().to_string(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/markdown_ops.rs:83:21 [INFO] [stdout] | [INFO] [stdout] 83 | if trimmed.starts_with("**URL:**") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 83 ~ if let Some() = trimmed.strip_prefix("**URL:**") { [INFO] [stdout] 84 ~ url = .trim().to_string(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/markdown_ops.rs:90:39 [INFO] [stdout] | [INFO] [stdout] 90 | let pct_str = trimmed[15..].trim().trim_end_matches('%'); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/markdown_ops.rs:89:21 [INFO] [stdout] | [INFO] [stdout] 89 | if trimmed.starts_with("**Percentage:**") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 89 ~ if let Some() = trimmed.strip_prefix("**Percentage:**") { [INFO] [stdout] 90 ~ let pct_str = .trim().trim_end_matches('%'); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/markdown_ops.rs:102:23 [INFO] [stdout] | [INFO] [stdout] 102 | while content_lines.last().map_or(false, |l| l.trim().is_empty()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 102 - while content_lines.last().map_or(false, |l| l.trim().is_empty()) { [INFO] [stdout] 102 + while content_lines.last().is_some_and(|l| l.trim().is_empty()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/toon.rs:236:9 [INFO] [stdout] | [INFO] [stdout] 236 | / if self.is_toon_file() { [INFO] [stdout] 237 | | if let Ok(toon_str) = self.convert_to_toon() { [INFO] [stdout] 238 | | self.toon_input = toon_str; [INFO] [stdout] 239 | | return true; [INFO] [stdout] 240 | | } [INFO] [stdout] 241 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 236 ~ if self.is_toon_file() [INFO] [stdout] 237 ~ && let Ok(toon_str) = self.convert_to_toon() { [INFO] [stdout] 238 | self.toon_input = toon_str; [INFO] [stdout] 239 | return true; [INFO] [stdout] 240 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/markdown_ops.rs:194:13 [INFO] [stdout] | [INFO] [stdout] 194 | / if let Some(section_start) = inside_section_start { [INFO] [stdout] 195 | | if i == section_start && !inserted { [INFO] [stdout] 196 | | result_lines.push("".to_string()); [INFO] [stdout] 197 | | result_lines.push(new_entry.trim().to_string()); [INFO] [stdout] ... | [INFO] [stdout] 202 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 194 ~ if let Some(section_start) = inside_section_start [INFO] [stdout] 195 ~ && i == section_start && !inserted { [INFO] [stdout] 196 | result_lines.push("".to_string()); [INFO] [stdout] ... [INFO] [stdout] 200 | inserted = true; [INFO] [stdout] 201 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/app.rs:322:9 [INFO] [stdout] | [INFO] [stdout] 222 | / let app = Self { [INFO] [stdout] 223 | | input_mode: InputMode::Normal, [INFO] [stdout] 224 | | json_input: String::new(), [INFO] [stdout] 225 | | markdown_input: String::new(), [INFO] [stdout] ... | [INFO] [stdout] 319 | | markdown_highlight_cache: Vec::new(), [INFO] [stdout] 320 | | }; [INFO] [stdout] | |__________- unnecessary `let` binding [INFO] [stdout] 321 | [INFO] [stdout] 322 | app [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] 222 ~ [INFO] [stdout] 223 | [INFO] [stdout] 224 ~ Self { [INFO] [stdout] 225 + input_mode: InputMode::Normal, [INFO] [stdout] 226 + json_input: String::new(), [INFO] [stdout] 227 + markdown_input: String::new(), [INFO] [stdout] 228 + toon_input: String::new(), [INFO] [stdout] 229 + rendered_content: vec![], [INFO] [stdout] 230 + relf_line_styles: Vec::new(), [INFO] [stdout] 231 + relf_visual_styles: Vec::new(), [INFO] [stdout] 232 + relf_entries: Vec::new(), [INFO] [stdout] 233 + selected_entry_index: 0, [INFO] [stdout] 234 + editing_entry: false, [INFO] [stdout] 235 + edit_buffer: Vec::new(), [INFO] [stdout] 236 + edit_buffer_is_placeholder: Vec::new(), [INFO] [stdout] 237 + edit_field_index: 0, [INFO] [stdout] 238 + edit_field_editing_mode: false, [INFO] [stdout] 239 + edit_insert_mode: false, [INFO] [stdout] 240 + edit_skip_normal_mode: false, [INFO] [stdout] 241 + edit_cursor_pos: 0, [INFO] [stdout] 242 + edit_hscroll: 0, [INFO] [stdout] 243 + edit_vscroll: 0, [INFO] [stdout] 244 + edit_yank_buffer: String::new(), [INFO] [stdout] 245 + showing_help: false, [INFO] [stdout] 246 + scroll: 0, [INFO] [stdout] 247 + max_scroll: 0, [INFO] [stdout] 248 + status_message: "".to_string(), [INFO] [stdout] 249 + status_time: Some(Instant::now()), [INFO] [stdout] 250 + file_path: None, [INFO] [stdout] 251 + vim_buffer: String::new(), [INFO] [stdout] 252 + format_mode, [INFO] [stdout] 253 + previous_format_mode: format_mode, // Initialize with same mode [INFO] [stdout] 254 + command_buffer: String::new(), [INFO] [stdout] 255 + completion_candidates: Vec::new(), [INFO] [stdout] 256 + completion_index: 0, [INFO] [stdout] 257 + completion_original: String::new(), [INFO] [stdout] 258 + is_modified: false, [INFO] [stdout] 259 + content_cursor_line: 0, [INFO] [stdout] 260 + content_cursor_col: 0, [INFO] [stdout] 261 + show_cursor: true, [INFO] [stdout] 262 + dd_count: 0, [INFO] [stdout] 263 + yy_count: 0, [INFO] [stdout] 264 + line_yank_buffer: String::new(), [INFO] [stdout] 265 + content_width: 80, [INFO] [stdout] 266 + hscroll: 0, [INFO] [stdout] 267 + visible_height: 20, [INFO] [stdout] 268 + search_query: String::new(), [INFO] [stdout] 269 + search_buffer: String::new(), [INFO] [stdout] 270 + search_matches: Vec::new(), [INFO] [stdout] 271 + current_match_index: None, [INFO] [stdout] 272 + filter_pattern: String::new(), [INFO] [stdout] 273 + undo_stack: Vec::new(), [INFO] [stdout] 274 + redo_stack: Vec::new(), [INFO] [stdout] 275 + auto_reload: true, [INFO] [stdout] 276 + last_save_time: None, [INFO] [stdout] 277 + file_path_changed: false, [INFO] [stdout] 278 + dragging_scrollbar: None, [INFO] [stdout] 279 + substitute_confirmations: Vec::new(), [INFO] [stdout] 280 + current_substitute_index: 0, [INFO] [stdout] 281 + last_click_time: None, [INFO] [stdout] 282 + show_line_numbers: rc_config.show_line_numbers, [INFO] [stdout] 283 + show_relative_line_numbers: rc_config.show_relative_line_numbers, [INFO] [stdout] 284 + show_extension: rc_config.show_extension, [INFO] [stdout] 285 + max_visible_cards: rc_config.max_visible_cards, [INFO] [stdout] 286 + command_history: Vec::new(), [INFO] [stdout] 287 + search_history: Vec::new(), [INFO] [stdout] 288 + command_history_index: None, [INFO] [stdout] 289 + search_history_index: None, [INFO] [stdout] 290 + explorer_open: false, [INFO] [stdout] 291 + explorer_entries: Vec::new(), [INFO] [stdout] 292 + explorer_selected_index: 0, [INFO] [stdout] 293 + explorer_scroll: 0, [INFO] [stdout] 294 + explorer_horizontal_scroll: 0, [INFO] [stdout] 295 + explorer_current_dir: std::env::current_dir().unwrap_or_else(|_| PathBuf::from(".")), [INFO] [stdout] 296 + explorer_has_focus: true, // Explorer has focus when opened [INFO] [stdout] 297 + explorer_dir_changed: false, [INFO] [stdout] 298 + file_op_pending: None, [INFO] [stdout] 299 + file_op_prompt_buffer: String::new(), [INFO] [stdout] 300 + visual_mode: false, [INFO] [stdout] 301 + visual_start_index: 0, [INFO] [stdout] 302 + visual_end_index: 0, [INFO] [stdout] 303 + view_edit_mode: false, [INFO] [stdout] 304 + colorscheme: rc_config.colorscheme, [INFO] [stdout] 305 + border_style: rc_config.border_style, [INFO] [stdout] 306 + outline_open: false, [INFO] [stdout] 307 + outline_selected_index: 0, [INFO] [stdout] 308 + outline_scroll: 0, [INFO] [stdout] 309 + outline_horizontal_scroll: 0, [INFO] [stdout] 310 + outline_opened_from_explorer: false, [INFO] [stdout] 311 + outline_has_focus: false, [INFO] [stdout] 312 + outline_search_query: String::new(), [INFO] [stdout] 313 + outline_search_matches: Vec::new(), [INFO] [stdout] 314 + outline_search_current: 0, [INFO] [stdout] 315 + file_mode: if rc_config.default_format.as_deref() == Some("markdown") { [INFO] [stdout] 316 + FileMode::Markdown [INFO] [stdout] 317 + } else { [INFO] [stdout] 318 + FileMode::Json [INFO] [stdout] 319 + }, [INFO] [stdout] 320 + syntax_highlighter: None, [INFO] [stdout] 321 + markdown_highlight_cache: Vec::new(), [INFO] [stdout] 322 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/app.rs:379:17 [INFO] [stdout] | [INFO] [stdout] 379 | return; [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] 378 - // This branch should not be reached during normal operation [INFO] [stdout] 379 - return; [INFO] [stdout] 378 + // This branch should not be reached during normal operation [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app.rs:470:9 [INFO] [stdout] | [INFO] [stdout] 470 | / if let Some(time) = self.status_time { [INFO] [stdout] 471 | | if time.elapsed() > Duration::from_secs(3) { [INFO] [stdout] 472 | | self.status_message = String::new(); [INFO] [stdout] 473 | | self.status_time = None; [INFO] [stdout] 474 | | } [INFO] [stdout] 475 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 470 ~ if let Some(time) = self.status_time [INFO] [stdout] 471 ~ && time.elapsed() > Duration::from_secs(3) { [INFO] [stdout] 472 | self.status_message = String::new(); [INFO] [stdout] 473 | self.status_time = None; [INFO] [stdout] 474 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `lines` [INFO] [stdout] --> src/app.rs:573:18 [INFO] [stdout] | [INFO] [stdout] 573 | for i in 0..self.content_cursor_line.min(lines.len()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 573 - for i in 0..self.content_cursor_line.min(lines.len()) { [INFO] [stdout] 573 + for in lines.iter().take(self.content_cursor_line.min(lines.len())) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/navigation.rs:31:9 [INFO] [stdout] | [INFO] [stdout] 31 | ((content_len + avail - 1) / avail).max(1) as u16 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `content_len.div_ceil(avail)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/rendering.rs:84:21 [INFO] [stdout] | [INFO] [stdout] 84 | / if section_key == "outside" || section_key == "inside" { [INFO] [stdout] 85 | | if let Some(section_array) = section_value.as_array() { [INFO] [stdout] 86 | | for item in section_array { [INFO] [stdout] 87 | | let original_index = global_index; [INFO] [stdout] ... | [INFO] [stdout] 183 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 84 ~ if (section_key == "outside" || section_key == "inside") { [INFO] [stdout] 85 ~ && let Some(section_array) = section_value.as_array() { [INFO] [stdout] 86 | for item in section_array { [INFO] [stdout] ... [INFO] [stdout] 181 | } [INFO] [stdout] 182 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `default` can be confused for the standard trait method `std::default::Default::default` [INFO] [stdout] --> src/config/colorscheme.rs:42:5 [INFO] [stdout] | [INFO] [stdout] 42 | / pub fn default() -> Self { [INFO] [stdout] 43 | | Self { [INFO] [stdout] 44 | | name: "Default", [INFO] [stdout] 45 | | background: Color::Black, [INFO] [stdout] ... | [INFO] [stdout] 79 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/config/rc.rs:11:1 [INFO] [stdout] | [INFO] [stdout] 11 | / impl Default for BorderStyle { [INFO] [stdout] 12 | | fn default() -> Self { [INFO] [stdout] 13 | | BorderStyle::Rounded [INFO] [stdout] 14 | | } [INFO] [stdout] 15 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 6 + #[derive(Default)] [INFO] [stdout] 7 | pub enum BorderStyle { [INFO] [stdout] 8 ~ #[default] [INFO] [stdout] 9 ~ Rounded, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/syntax_highlight.rs:238:9 [INFO] [stdout] | [INFO] [stdout] 237 | let highlighted = self.render_bold_in_text(text, default_style); [INFO] [stdout] | ---------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 238 | highlighted [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 237 ~ [INFO] [stdout] 238 ~ self.render_bold_in_text(text, default_style) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/config/rc.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | / if let Some(rc_path) = Self::get_rc_path() { [INFO] [stdout] 58 | | if let Ok(contents) = fs::read_to_string(&rc_path) { [INFO] [stdout] 59 | | config.parse(&contents); [INFO] [stdout] 60 | | } [INFO] [stdout] 61 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 57 ~ if let Some(rc_path) = Self::get_rc_path() [INFO] [stdout] 58 ~ && let Ok(contents) = fs::read_to_string(&rc_path) { [INFO] [stdout] 59 | config.parse(&contents); [INFO] [stdout] 60 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/config/rc.rs:98:17 [INFO] [stdout] | [INFO] [stdout] 98 | / if parts.len() >= 2 { [INFO] [stdout] 99 | | self.handle_set(&parts[1..]); [INFO] [stdout] 100 | | } [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] 97 ~ "set" [INFO] [stdout] 98 ~ if parts.len() >= 2 => { [INFO] [stdout] 99 | self.handle_set(&parts[1..]); [INFO] [stdout] 100 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/config/rc.rs:103:17 [INFO] [stdout] | [INFO] [stdout] 103 | / if parts.len() >= 2 { [INFO] [stdout] 104 | | self.handle_colorscheme(parts[1]); [INFO] [stdout] 105 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 102 ~ "colorscheme" [INFO] [stdout] 103 ~ if parts.len() >= 2 => { [INFO] [stdout] 104 | self.handle_colorscheme(parts[1]); [INFO] [stdout] 105 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/config/rc.rs:149:21 [INFO] [stdout] | [INFO] [stdout] 149 | / if let Ok(value) = value_str.parse::() { [INFO] [stdout] 150 | | if value >= 1 && value <= 10 { [INFO] [stdout] 151 | | self.max_visible_cards = value; [INFO] [stdout] 152 | | } [INFO] [stdout] 153 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 149 ~ if let Ok(value) = value_str.parse::() [INFO] [stdout] 150 ~ && value >= 1 && value <= 10 { [INFO] [stdout] 151 | self.max_visible_cards = value; [INFO] [stdout] 152 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual `RangeInclusive::contains` implementation [INFO] [stdout] --> src/config/rc.rs:150:28 [INFO] [stdout] | [INFO] [stdout] 150 | if value >= 1 && value <= 10 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(1..=10).contains(&value)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:28:13 [INFO] [stdout] | [INFO] [stdout] 28 | / if trimmed.contains('[') && trimmed.contains('{') && trimmed.ends_with(':') { [INFO] [stdout] 29 | | if let Ok((section, _)) = Self::parse_toon_header(trimmed) { [INFO] [stdout] 30 | | current_section = section; [INFO] [stdout] 31 | | entry_index = 0; [INFO] [stdout] ... | [INFO] [stdout] 35 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 28 ~ if trimmed.contains('[') && trimmed.contains('{') && trimmed.ends_with(':') [INFO] [stdout] 29 ~ && let Ok((section, _)) = Self::parse_toon_header(trimmed) { [INFO] [stdout] 30 | current_section = section; [INFO] [stdout] ... [INFO] [stdout] 33 | continue; [INFO] [stdout] 34 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `while let` loop [INFO] [stdout] --> src/input/event_loop.rs:116:25 [INFO] [stdout] | [INFO] [stdout] 116 | / loop { [INFO] [stdout] 117 | | if let Ok(true) = event::poll(Duration::from_millis(1000)) { [INFO] [stdout] 118 | | if let Ok(Event::Key(next_key)) = event::read() { [INFO] [stdout] 119 | | #[cfg(target_os = "windows")] [INFO] [stdout] ... | [INFO] [stdout] 174 | | } [INFO] [stdout] | |_________________________^ help: try: `while let Ok(true) = event::poll(Duration::from_millis(1000)) { .. }` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_loop [INFO] [stdout] = note: `#[warn(clippy::while_let_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/toon_ops.rs:189:9 [INFO] [stdout] | [INFO] [stdout] 189 | while let Some(ch) = chars.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for ch in chars` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:219:9 [INFO] [stdout] | [INFO] [stdout] 219 | / if let Some(outside) = json_value.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 220 | | if !outside.is_empty() { [INFO] [stdout] 221 | | let fields = vec!["name", "context", "url", "percentage"]; [INFO] [stdout] 222 | | toon_output.push_str(&format!("outside[{}]{{{}}}:\n", [INFO] [stdout] ... | [INFO] [stdout] 234 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 219 ~ if let Some(outside) = json_value.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 220 ~ && !outside.is_empty() { [INFO] [stdout] 221 | let fields = vec!["name", "context", "url", "percentage"]; [INFO] [stdout] ... [INFO] [stdout] 232 | toon_output.push('\n'); [INFO] [stdout] 233 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/input/mouse.rs:37:13 [INFO] [stdout] | [INFO] [stdout] 37 | / if app.dragging_scrollbar != Some(ScrollbarType::Horizontal) { [INFO] [stdout] 38 | | // If outline has focus, scroll outline [INFO] [stdout] 39 | | if app.outline_open && app.outline_has_focus { [INFO] [stdout] 40 | | app.outline_move_up(); [INFO] [stdout] ... | [INFO] [stdout] 65 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 35 ~ MouseEventKind::ScrollUp [INFO] [stdout] 36 | // Don't scroll vertically if horizontal scrollbar is being dragged [INFO] [stdout] 37 ~ if app.dragging_scrollbar != Some(ScrollbarType::Horizontal) => { [INFO] [stdout] 38 | // If outline has focus, scroll outline [INFO] [stdout] ... [INFO] [stdout] 64 | } [INFO] [stdout] 65 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:237:9 [INFO] [stdout] | [INFO] [stdout] 237 | / if let Some(inside) = json_value.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 238 | | if !inside.is_empty() { [INFO] [stdout] 239 | | let fields = vec!["date", "context"]; [INFO] [stdout] 240 | | toon_output.push_str(&format!("inside[{}]{{{}}}:\n", [INFO] [stdout] ... | [INFO] [stdout] 251 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 237 ~ if let Some(inside) = json_value.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 238 ~ && !inside.is_empty() { [INFO] [stdout] 239 | let fields = vec!["date", "context"]; [INFO] [stdout] ... [INFO] [stdout] 249 | } [INFO] [stdout] 250 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/input/mouse.rs:69:13 [INFO] [stdout] | [INFO] [stdout] 69 | / if app.dragging_scrollbar != Some(ScrollbarType::Horizontal) { [INFO] [stdout] 70 | | // If outline has focus, scroll outline [INFO] [stdout] 71 | | if app.outline_open && app.outline_has_focus { [INFO] [stdout] 72 | | app.outline_move_down(); [INFO] [stdout] ... | [INFO] [stdout] 95 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 67 ~ MouseEventKind::ScrollDown [INFO] [stdout] 68 | // Don't scroll vertically if horizontal scrollbar is being dragged [INFO] [stdout] 69 ~ if app.dragging_scrollbar != Some(ScrollbarType::Horizontal) => { [INFO] [stdout] 70 | // If outline has focus, scroll outline [INFO] [stdout] ... [INFO] [stdout] 94 | } [INFO] [stdout] 95 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/input/mouse.rs:21:52 [INFO] [stdout] | [INFO] [stdout] 21 | if app.format_mode == FormatMode::View { [INFO] [stdout] | ____________________________________________________^ [INFO] [stdout] 22 | | app.relf_hscroll_by(-8); [INFO] [stdout] 23 | | } else if app.format_mode == FormatMode::Edit { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/input/mouse.rs:23:59 [INFO] [stdout] | [INFO] [stdout] 23 | } else if app.format_mode == FormatMode::Edit { [INFO] [stdout] | ___________________________________________________________^ [INFO] [stdout] 24 | | app.relf_hscroll_by(-8); [INFO] [stdout] 25 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` has identical blocks [INFO] [stdout] --> src/input/mouse.rs:29:52 [INFO] [stdout] | [INFO] [stdout] 29 | if app.format_mode == FormatMode::View { [INFO] [stdout] | ____________________________________________________^ [INFO] [stdout] 30 | | app.relf_hscroll_by(8); [INFO] [stdout] 31 | | } else if app.format_mode == FormatMode::Edit { [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] note: same as this [INFO] [stdout] --> src/input/mouse.rs:31:59 [INFO] [stdout] | [INFO] [stdout] 31 | } else if app.format_mode == FormatMode::Edit { [INFO] [stdout] | ___________________________________________________________^ [INFO] [stdout] 32 | | app.relf_hscroll_by(8); [INFO] [stdout] 33 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:357:17 [INFO] [stdout] | [INFO] [stdout] 357 | / if let Some(outside) = json.get_mut("outside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 358 | | if entry_info.entry_index < outside.len() { [INFO] [stdout] 359 | | outside.remove(entry_info.entry_index); [INFO] [stdout] 360 | | } [INFO] [stdout] 361 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 357 ~ if let Some(outside) = json.get_mut("outside").and_then(|v| v.as_array_mut()) [INFO] [stdout] 358 ~ && entry_info.entry_index < outside.len() { [INFO] [stdout] 359 | outside.remove(entry_info.entry_index); [INFO] [stdout] 360 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:362:20 [INFO] [stdout] | [INFO] [stdout] 362 | } else if entry_info.section == "inside" { [INFO] [stdout] | ____________________^ [INFO] [stdout] 363 | | if let Some(inside) = json.get_mut("inside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 364 | | if entry_info.entry_index < inside.len() { [INFO] [stdout] 365 | | inside.remove(entry_info.entry_index); [INFO] [stdout] ... | [INFO] [stdout] 368 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 362 ~ } else if entry_info.section == "inside" [INFO] [stdout] 363 ~ && let Some(inside) = json.get_mut("inside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 364 | if entry_info.entry_index < inside.len() { [INFO] [stdout] 365 | inside.remove(entry_info.entry_index); [INFO] [stdout] 366 | } [INFO] [stdout] 367 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:363:17 [INFO] [stdout] | [INFO] [stdout] 363 | / if let Some(inside) = json.get_mut("inside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 364 | | if entry_info.entry_index < inside.len() { [INFO] [stdout] 365 | | inside.remove(entry_info.entry_index); [INFO] [stdout] 366 | | } [INFO] [stdout] 367 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 363 ~ if let Some(inside) = json.get_mut("inside").and_then(|v| v.as_array_mut()) [INFO] [stdout] 364 ~ && entry_info.entry_index < inside.len() { [INFO] [stdout] 365 | inside.remove(entry_info.entry_index); [INFO] [stdout] 366 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:385:17 [INFO] [stdout] | [INFO] [stdout] 385 | / if let Some(outside) = json.get_mut("outside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 386 | | if entry_info.entry_index < outside.len() { [INFO] [stdout] 387 | | let entry_clone = outside[entry_info.entry_index].clone(); [INFO] [stdout] 388 | | outside.insert(entry_info.entry_index + 1, entry_clone); [INFO] [stdout] 389 | | } [INFO] [stdout] 390 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 385 ~ if let Some(outside) = json.get_mut("outside").and_then(|v| v.as_array_mut()) [INFO] [stdout] 386 ~ && entry_info.entry_index < outside.len() { [INFO] [stdout] 387 | let entry_clone = outside[entry_info.entry_index].clone(); [INFO] [stdout] 388 | outside.insert(entry_info.entry_index + 1, entry_clone); [INFO] [stdout] 389 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/input/mouse.rs:295:13 [INFO] [stdout] | [INFO] [stdout] 295 | / if app.format_mode == FormatMode::Edit { [INFO] [stdout] 296 | | let click_x = mouse.column; [INFO] [stdout] 297 | | let terminal_width = [INFO] [stdout] 298 | | terminal.size().map(|s| s.width).unwrap_or(80); [INFO] [stdout] ... | [INFO] [stdout] 312 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 293 ~ Some(ScrollbarType::Horizontal) [INFO] [stdout] 294 | // Continue horizontal scrollbar drag (Edit mode only) [INFO] [stdout] 295 ~ if app.format_mode == FormatMode::Edit => { [INFO] [stdout] 296 | let click_x = mouse.column; [INFO] [stdout] ... [INFO] [stdout] 311 | } [INFO] [stdout] 312 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:391:20 [INFO] [stdout] | [INFO] [stdout] 391 | } else if entry_info.section == "inside" { [INFO] [stdout] | ____________________^ [INFO] [stdout] 392 | | if let Some(inside) = json.get_mut("inside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 393 | | if entry_info.entry_index < inside.len() { [INFO] [stdout] 394 | | let entry_clone = inside[entry_info.entry_index].clone(); [INFO] [stdout] ... | [INFO] [stdout] 398 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 391 ~ } else if entry_info.section == "inside" [INFO] [stdout] 392 ~ && let Some(inside) = json.get_mut("inside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 393 | if entry_info.entry_index < inside.len() { [INFO] [stdout] ... [INFO] [stdout] 396 | } [INFO] [stdout] 397 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:392:17 [INFO] [stdout] | [INFO] [stdout] 392 | / if let Some(inside) = json.get_mut("inside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 393 | | if entry_info.entry_index < inside.len() { [INFO] [stdout] 394 | | let entry_clone = inside[entry_info.entry_index].clone(); [INFO] [stdout] 395 | | inside.insert(entry_info.entry_index + 1, entry_clone); [INFO] [stdout] 396 | | } [INFO] [stdout] 397 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 392 ~ if let Some(inside) = json.get_mut("inside").and_then(|v| v.as_array_mut()) [INFO] [stdout] 393 ~ && entry_info.entry_index < inside.len() { [INFO] [stdout] 394 | let entry_clone = inside[entry_info.entry_index].clone(); [INFO] [stdout] 395 | inside.insert(entry_info.entry_index + 1, entry_clone); [INFO] [stdout] 396 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/ui/json_highlight.rs:30:17 [INFO] [stdout] | [INFO] [stdout] 30 | while let Some(next_ch) = chars.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for next_ch in chars.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/ui/json_highlight.rs:44:17 [INFO] [stdout] | [INFO] [stdout] 44 | while let Some(peek_ch) = temp_chars.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for peek_ch in temp_chars` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:382:21 [INFO] [stdout] | [INFO] [stdout] 382 | return Ok(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] 382 - return Ok(false); [INFO] [stdout] 382 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:394:21 [INFO] [stdout] | [INFO] [stdout] 394 | return Ok(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] 394 - return Ok(false); [INFO] [stdout] 394 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:406:21 [INFO] [stdout] | [INFO] [stdout] 406 | return Ok(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] 406 - return Ok(false); [INFO] [stdout] 406 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:422:21 [INFO] [stdout] | [INFO] [stdout] 422 | return Ok(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] 422 - return Ok(false); [INFO] [stdout] 422 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:424:22 [INFO] [stdout] | [INFO] [stdout] 424 | _ => return Ok(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] 424 - _ => return Ok(false), [INFO] [stdout] 424 + _ => Ok(false), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:432:21 [INFO] [stdout] | [INFO] [stdout] 432 | return Ok(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] 432 - return Ok(false); [INFO] [stdout] 432 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:436:21 [INFO] [stdout] | [INFO] [stdout] 436 | return Ok(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] 436 - return Ok(false); [INFO] [stdout] 436 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:457:21 [INFO] [stdout] | [INFO] [stdout] 457 | return Ok(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] 457 - return Ok(false); [INFO] [stdout] 457 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:482:21 [INFO] [stdout] | [INFO] [stdout] 482 | return Ok(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] 482 - return Ok(false); [INFO] [stdout] 482 + Ok(false) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/input/normal_mode.rs:484:22 [INFO] [stdout] | [INFO] [stdout] 484 | _ => return Ok(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] 484 - _ => return Ok(false), [INFO] [stdout] 484 + _ => Ok(false), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/input/normal_mode.rs:632:13 [INFO] [stdout] | [INFO] [stdout] 632 | / if key.modifiers.contains(KeyModifiers::CONTROL) { [INFO] [stdout] 633 | | app.outline_page_down(); [INFO] [stdout] 634 | | return Ok(false); [INFO] [stdout] 635 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 630 ~ KeyCode::Char('f') [INFO] [stdout] 631 | // Ctrl+f: page down [INFO] [stdout] 632 ~ if key.modifiers.contains(KeyModifiers::CONTROL) => { [INFO] [stdout] 633 | app.outline_page_down(); [INFO] [stdout] 634 | return Ok(false); [INFO] [stdout] 635 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/input/normal_mode.rs:639:13 [INFO] [stdout] | [INFO] [stdout] 639 | / if key.modifiers.contains(KeyModifiers::CONTROL) { [INFO] [stdout] 640 | | app.outline_page_up(); [INFO] [stdout] 641 | | return Ok(false); [INFO] [stdout] 642 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 637 ~ KeyCode::Char('b') [INFO] [stdout] 638 | // Ctrl+b: page up [INFO] [stdout] 639 ~ if key.modifiers.contains(KeyModifiers::CONTROL) => { [INFO] [stdout] 640 | app.outline_page_up(); [INFO] [stdout] 641 | return Ok(false); [INFO] [stdout] 642 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual arithmetic check found [INFO] [stdout] --> src/ui/utils.rs:33:29 [INFO] [stdout] | [INFO] [stdout] 33 | let visible_start = if span_start < start_col { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 34 | | start_col - span_start [INFO] [stdout] 35 | | } else { [INFO] [stdout] 36 | | 0 [INFO] [stdout] 37 | | }; [INFO] [stdout] | |_________^ help: replace it with: `start_col.saturating_sub(span_start)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] = note: `#[warn(clippy::implicit_saturating_sub)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/input/overlay_mode.rs:171:17 [INFO] [stdout] | [INFO] [stdout] 171 | / if app.view_edit_mode && app.edit_field_index < app.edit_buffer.len() { [INFO] [stdout] 172 | | let field = &mut app.edit_buffer[app.edit_field_index]; [INFO] [stdout] 173 | | // Find byte index for character position [INFO] [stdout] 174 | | let byte_pos = if app.edit_cursor_pos == 0 { [INFO] [stdout] ... | [INFO] [stdout] 183 | | app.edit_cursor_pos += 1; // Move cursor past newline (1 character) [INFO] [stdout] 184 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 169 ~ KeyCode::Enter [INFO] [stdout] 170 | // In View Edit mode, insert newline character [INFO] [stdout] 171 ~ if app.view_edit_mode && app.edit_field_index < app.edit_buffer.len() => { [INFO] [stdout] 172 | let field = &mut app.edit_buffer[app.edit_field_index]; [INFO] [stdout] ... [INFO] [stdout] 183 | app.edit_cursor_pos += 1; // Move cursor past newline (1 character) [INFO] [stdout] 184 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/explorer.rs:56:9 [INFO] [stdout] | [INFO] [stdout] 56 | / if !app.show_extension && entry.path.is_file() { [INFO] [stdout] 57 | | if let Some(stem) = entry.path.file_stem().and_then(|s| s.to_str()) { [INFO] [stdout] 58 | | name = stem.to_string(); [INFO] [stdout] 59 | | } [INFO] [stdout] 60 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 56 ~ if !app.show_extension && entry.path.is_file() [INFO] [stdout] 57 ~ && let Some(stem) = entry.path.file_stem().and_then(|s| s.to_str()) { [INFO] [stdout] 58 | name = stem.to_string(); [INFO] [stdout] 59 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `app.edit_buffer_is_placeholder.get(0)` [INFO] [stdout] --> src/ui/edit_overlay.rs:78:30 [INFO] [stdout] | [INFO] [stdout] 78 | let is_placeholder = app.edit_buffer_is_placeholder.get(0).copied().unwrap_or(false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `app.edit_buffer_is_placeholder.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `app.edit_buffer_is_placeholder.get(0)` [INFO] [stdout] --> src/ui/edit_overlay.rs:112:30 [INFO] [stdout] | [INFO] [stdout] 112 | let is_placeholder = app.edit_buffer_is_placeholder.get(0).copied().unwrap_or(false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `app.edit_buffer_is_placeholder.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `lines` [INFO] [stdout] --> src/input/overlay_mode.rs:706:26 [INFO] [stdout] | [INFO] [stdout] 706 | for i in 0..=current_line { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 706 - for i in 0..=current_line { [INFO] [stdout] 706 + for (i, ) in lines.iter().enumerate().take(current_line + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `actual_pos` is used as a loop counter [INFO] [stdout] --> src/ui/edit_overlay.rs:292:13 [INFO] [stdout] | [INFO] [stdout] 292 | for ch in field.chars() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (actual_pos, ch) in field.chars().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is only used to index `lines` [INFO] [stdout] --> src/input/overlay_mode.rs:771:34 [INFO] [stdout] | [INFO] [stdout] 771 | for i in 0..current_line { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator [INFO] [stdout] | [INFO] [stdout] 771 - for i in 0..current_line { [INFO] [stdout] 771 + for in lines.iter().take(current_line) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the loop variable `i` is used to index `lines` [INFO] [stdout] --> src/input/overlay_mode.rs:842:26 [INFO] [stdout] | [INFO] [stdout] 842 | for i in 0..=current_line { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stdout] help: consider using an iterator and enumerate() [INFO] [stdout] | [INFO] [stdout] 842 - for i in 0..=current_line { [INFO] [stdout] 842 + for (i, ) in lines.iter().enumerate().take(current_line + 1) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/input/overlay_mode.rs:914:36 [INFO] [stdout] | [INFO] [stdout] 914 | let is_context_field = (app.edit_buffer.len() == 2 && app.edit_field_index == 1) || [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 915 | | (app.edit_buffer.len() == 4 && app.edit_field_index == 1); [INFO] [stdout] | |____________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 914 - let is_context_field = (app.edit_buffer.len() == 2 && app.edit_field_index == 1) || [INFO] [stdout] 915 - (app.edit_buffer.len() == 4 && app.edit_field_index == 1); [INFO] [stdout] 914 + let is_context_field = !(app.edit_field_index != 1 || app.edit_buffer.len() != 2 && app.edit_buffer.len() != 4); [INFO] [stdout] | [INFO] [stdout] 914 - let is_context_field = (app.edit_buffer.len() == 2 && app.edit_field_index == 1) || [INFO] [stdout] 915 - (app.edit_buffer.len() == 4 && app.edit_field_index == 1); [INFO] [stdout] 914 + let is_context_field = (app.edit_buffer.len() == 4 || app.edit_buffer.len() == 2) && app.edit_field_index == 1; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/input/overlay_mode.rs:927:36 [INFO] [stdout] | [INFO] [stdout] 927 | let is_context_field = (app.edit_buffer.len() == 2 && app.edit_field_index == 1) || [INFO] [stdout] | ____________________________________^ [INFO] [stdout] 928 | | (app.edit_buffer.len() == 4 && app.edit_field_index == 1); [INFO] [stdout] | |____________________________________________________________________________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 927 - let is_context_field = (app.edit_buffer.len() == 2 && app.edit_field_index == 1) || [INFO] [stdout] 928 - (app.edit_buffer.len() == 4 && app.edit_field_index == 1); [INFO] [stdout] 927 + let is_context_field = !(app.edit_field_index != 1 || app.edit_buffer.len() != 2 && app.edit_buffer.len() != 4); [INFO] [stdout] | [INFO] [stdout] 927 - let is_context_field = (app.edit_buffer.len() == 2 && app.edit_field_index == 1) || [INFO] [stdout] 928 - (app.edit_buffer.len() == 4 && app.edit_field_index == 1); [INFO] [stdout] 927 + let is_context_field = (app.edit_buffer.len() == 4 || app.edit_buffer.len() == 2) && app.edit_field_index == 1; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/input/overlay_mode.rs:897:13 [INFO] [stdout] | [INFO] [stdout] 897 | / if app.edit_field_index > 0 { [INFO] [stdout] 898 | | app.edit_field_index -= 1; [INFO] [stdout] 899 | | app.edit_cursor_pos = 0; [INFO] [stdout] 900 | | app.edit_hscroll = 0; [INFO] [stdout] 901 | | app.edit_vscroll = 0; [INFO] [stdout] 902 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 896 ~ KeyCode::Up | KeyCode::Char('k') [INFO] [stdout] 897 ~ if app.edit_field_index > 0 => { [INFO] [stdout] 898 | app.edit_field_index -= 1; [INFO] [stdout] ... [INFO] [stdout] 901 | app.edit_vscroll = 0; [INFO] [stdout] 902 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/input/overlay_mode.rs:905:13 [INFO] [stdout] | [INFO] [stdout] 905 | / if app.edit_field_index + 1 < app.edit_buffer.len() { [INFO] [stdout] 906 | | app.edit_field_index += 1; [INFO] [stdout] 907 | | app.edit_cursor_pos = 0; [INFO] [stdout] 908 | | app.edit_hscroll = 0; [INFO] [stdout] 909 | | app.edit_vscroll = 0; [INFO] [stdout] 910 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 904 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 905 ~ if app.edit_field_index + 1 < app.edit_buffer.len() => { [INFO] [stdout] 906 | app.edit_field_index += 1; [INFO] [stdout] ... [INFO] [stdout] 909 | app.edit_vscroll = 0; [INFO] [stdout] 910 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/ui/content.rs:53:16 [INFO] [stdout] | [INFO] [stdout] 53 | .chain(std::iter::repeat(&empty_line).take(bottom_padding as usize)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(&empty_line, bottom_padding as usize)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] = note: `#[warn(clippy::manual_repeat_n)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/json_ops.rs:65:29 [INFO] [stdout] | [INFO] [stdout] 65 | / ... if let Some(ref key) = current_key { [INFO] [stdout] 66 | | ... if let Some(arr) = obj.get_mut(key).and_then(|v| v.as_array_mut()) { [INFO] [stdout] 67 | | ... if item_index < arr.len() { [INFO] [stdout] 68 | | ... arr.remove(item_index); [INFO] [stdout] ... | [INFO] [stdout] 73 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 65 ~ if let Some(ref key) = current_key [INFO] [stdout] 66 ~ && let Some(arr) = obj.get_mut(key).and_then(|v| v.as_array_mut()) { [INFO] [stdout] 67 | if item_index < arr.len() { [INFO] [stdout] ... [INFO] [stdout] 71 | } [INFO] [stdout] 72 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/json_ops.rs:66:33 [INFO] [stdout] | [INFO] [stdout] 66 | / ... if let Some(arr) = obj.get_mut(key).and_then(|v| v.as_array_mut()) { [INFO] [stdout] 67 | | ... if item_index < arr.len() { [INFO] [stdout] 68 | | ... arr.remove(item_index); [INFO] [stdout] 69 | | ... deleted = true; [INFO] [stdout] ... | [INFO] [stdout] 72 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 66 ~ if let Some(arr) = obj.get_mut(key).and_then(|v| v.as_array_mut()) [INFO] [stdout] 67 ~ && item_index < arr.len() { [INFO] [stdout] 68 | arr.remove(item_index); [INFO] [stdout] 69 | deleted = true; [INFO] [stdout] 70 | break; [INFO] [stdout] 71 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/content.rs:292:13 [INFO] [stdout] | [INFO] [stdout] 292 | / if app.format_mode == FormatMode::Edit [INFO] [stdout] 293 | | && (app.input_mode == InputMode::Insert || app.input_mode == InputMode::Normal) [INFO] [stdout] 294 | | && app.show_cursor [INFO] [stdout] ... | [INFO] [stdout] 368 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 294 ~ && app.show_cursor [INFO] [stdout] 295 ~ && actual_idx == app.content_cursor_line { [INFO] [stdout] 296 | let cursor_char_pos = app.content_cursor_col; [INFO] [stdout] ... [INFO] [stdout] 365 | } [INFO] [stdout] 366 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/json_ops.rs:240:29 [INFO] [stdout] | [INFO] [stdout] 240 | / ... if let Some(ref key) = current_key { [INFO] [stdout] 241 | | ... if let Some(arr) = obj.get_mut(key).and_then(|v| v.as_array_mut()) { [INFO] [stdout] 242 | | ... if item_index < arr.len() { [INFO] [stdout] 243 | | ... let entry_clone = arr[item_index].clone(); [INFO] [stdout] ... | [INFO] [stdout] 249 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 240 ~ if let Some(ref key) = current_key [INFO] [stdout] 241 ~ && let Some(arr) = obj.get_mut(key).and_then(|v| v.as_array_mut()) { [INFO] [stdout] 242 | if item_index < arr.len() { [INFO] [stdout] ... [INFO] [stdout] 247 | } [INFO] [stdout] 248 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/json_ops.rs:241:33 [INFO] [stdout] | [INFO] [stdout] 241 | / ... if let Some(arr) = obj.get_mut(key).and_then(|v| v.as_array_mut()) { [INFO] [stdout] 242 | | ... if item_index < arr.len() { [INFO] [stdout] 243 | | ... let entry_clone = arr[item_index].clone(); [INFO] [stdout] 244 | | ... arr.insert(item_index + 1, entry_clone); [INFO] [stdout] ... | [INFO] [stdout] 248 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 241 ~ if let Some(arr) = obj.get_mut(key).and_then(|v| v.as_array_mut()) [INFO] [stdout] 242 ~ && item_index < arr.len() { [INFO] [stdout] 243 | let entry_clone = arr[item_index].clone(); [INFO] [stdout] ... [INFO] [stdout] 246 | break; [INFO] [stdout] 247 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_ops.rs:298:71 [INFO] [stdout] | [INFO] [stdout] 298 | b_percent.cmp(&a_percent).then_with(|| a_name.cmp(&b_name)) [INFO] [stdout] | ^^^^^^^ help: change this to: `b_name` [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/json_ops.rs:316:32 [INFO] [stdout] | [INFO] [stdout] 316 | b_date.cmp(&a_date) // Descending order (newest first) [INFO] [stdout] | ^^^^^^^ help: change this to: `a_date` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_ops.rs:374:32 [INFO] [stdout] | [INFO] [stdout] 374 | b_date.cmp(&a_date) // Descending order (newest first) [INFO] [stdout] | ^^^^^^^ help: change this to: `a_date` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_ops.rs:414:32 [INFO] [stdout] | [INFO] [stdout] 414 | a_name.cmp(&b_name) [INFO] [stdout] | ^^^^^^^ help: change this to: `b_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_ops.rs:432:32 [INFO] [stdout] | [INFO] [stdout] 432 | b_date.cmp(&a_date) // Descending order (newest first) [INFO] [stdout] | ^^^^^^^ help: change this to: `a_date` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/json_ops.rs:479:32 [INFO] [stdout] | [INFO] [stdout] 479 | b_date.cmp(&a_date) // Descending order (newest first) [INFO] [stdout] | ^^^^^^^ help: change this to: `a_date` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/markdown_ops.rs:35:18 [INFO] [stdout] | [INFO] [stdout] 35 | (line[4..].trim().to_string(), true) [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/markdown_ops.rs:34:39 [INFO] [stdout] | [INFO] [stdout] 34 | let (title, has_header) = if line.starts_with("### ") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 34 ~ let (title, has_header) = if let Some() = line.strip_prefix("### ") { [INFO] [stdout] 35 ~ (.trim().to_string(), true) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/markdown_ops.rs:84:31 [INFO] [stdout] | [INFO] [stdout] 84 | url = trimmed[8..].trim().to_string(); [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/markdown_ops.rs:83:21 [INFO] [stdout] | [INFO] [stdout] 83 | if trimmed.starts_with("**URL:**") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 83 ~ if let Some() = trimmed.strip_prefix("**URL:**") { [INFO] [stdout] 84 ~ url = .trim().to_string(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/markdown_ops.rs:90:39 [INFO] [stdout] | [INFO] [stdout] 90 | let pct_str = trimmed[15..].trim().trim_end_matches('%'); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/markdown_ops.rs:89:21 [INFO] [stdout] | [INFO] [stdout] 89 | if trimmed.starts_with("**Percentage:**") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_strip [INFO] [stdout] help: try using the `strip_prefix` method [INFO] [stdout] | [INFO] [stdout] 89 ~ if let Some() = trimmed.strip_prefix("**Percentage:**") { [INFO] [stdout] 90 ~ let pct_str = .trim().trim_end_matches('%'); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/markdown_ops.rs:102:23 [INFO] [stdout] | [INFO] [stdout] 102 | while content_lines.last().map_or(false, |l| l.trim().is_empty()) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 102 - while content_lines.last().map_or(false, |l| l.trim().is_empty()) { [INFO] [stdout] 102 + while content_lines.last().is_some_and(|l| l.trim().is_empty()) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/markdown_ops.rs:194:13 [INFO] [stdout] | [INFO] [stdout] 194 | / if let Some(section_start) = inside_section_start { [INFO] [stdout] 195 | | if i == section_start && !inserted { [INFO] [stdout] 196 | | result_lines.push("".to_string()); [INFO] [stdout] 197 | | result_lines.push(new_entry.trim().to_string()); [INFO] [stdout] ... | [INFO] [stdout] 202 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 194 ~ if let Some(section_start) = inside_section_start [INFO] [stdout] 195 ~ && i == section_start && !inserted { [INFO] [stdout] 196 | result_lines.push("".to_string()); [INFO] [stdout] ... [INFO] [stdout] 200 | inserted = true; [INFO] [stdout] 201 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/navigation.rs:31:9 [INFO] [stdout] | [INFO] [stdout] 31 | ((content_len + avail - 1) / avail).max(1) as u16 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `content_len.div_ceil(avail)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/rendering.rs:84:21 [INFO] [stdout] | [INFO] [stdout] 84 | / if section_key == "outside" || section_key == "inside" { [INFO] [stdout] 85 | | if let Some(section_array) = section_value.as_array() { [INFO] [stdout] 86 | | for item in section_array { [INFO] [stdout] 87 | | let original_index = global_index; [INFO] [stdout] ... | [INFO] [stdout] 183 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 84 ~ if (section_key == "outside" || section_key == "inside") { [INFO] [stdout] 85 ~ && let Some(section_array) = section_value.as_array() { [INFO] [stdout] 86 | for item in section_array { [INFO] [stdout] ... [INFO] [stdout] 181 | } [INFO] [stdout] 182 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/syntax_highlight.rs:238:9 [INFO] [stdout] | [INFO] [stdout] 237 | let highlighted = self.render_bold_in_text(text, default_style); [INFO] [stdout] | ---------------------------------------------------------------- unnecessary `let` binding [INFO] [stdout] 238 | highlighted [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 237 ~ [INFO] [stdout] 238 ~ self.render_bold_in_text(text, default_style) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:28:13 [INFO] [stdout] | [INFO] [stdout] 28 | / if trimmed.contains('[') && trimmed.contains('{') && trimmed.ends_with(':') { [INFO] [stdout] 29 | | if let Ok((section, _)) = Self::parse_toon_header(trimmed) { [INFO] [stdout] 30 | | current_section = section; [INFO] [stdout] 31 | | entry_index = 0; [INFO] [stdout] ... | [INFO] [stdout] 35 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 28 ~ if trimmed.contains('[') && trimmed.contains('{') && trimmed.ends_with(':') [INFO] [stdout] 29 ~ && let Ok((section, _)) = Self::parse_toon_header(trimmed) { [INFO] [stdout] 30 | current_section = section; [INFO] [stdout] ... [INFO] [stdout] 33 | continue; [INFO] [stdout] 34 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/toon_ops.rs:189:9 [INFO] [stdout] | [INFO] [stdout] 189 | while let Some(ch) = chars.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for ch in chars` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:219:9 [INFO] [stdout] | [INFO] [stdout] 219 | / if let Some(outside) = json_value.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 220 | | if !outside.is_empty() { [INFO] [stdout] 221 | | let fields = vec!["name", "context", "url", "percentage"]; [INFO] [stdout] 222 | | toon_output.push_str(&format!("outside[{}]{{{}}}:\n", [INFO] [stdout] ... | [INFO] [stdout] 234 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 219 ~ if let Some(outside) = json_value.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 220 ~ && !outside.is_empty() { [INFO] [stdout] 221 | let fields = vec!["name", "context", "url", "percentage"]; [INFO] [stdout] ... [INFO] [stdout] 232 | toon_output.push('\n'); [INFO] [stdout] 233 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:237:9 [INFO] [stdout] | [INFO] [stdout] 237 | / if let Some(inside) = json_value.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 238 | | if !inside.is_empty() { [INFO] [stdout] 239 | | let fields = vec!["date", "context"]; [INFO] [stdout] 240 | | toon_output.push_str(&format!("inside[{}]{{{}}}:\n", [INFO] [stdout] ... | [INFO] [stdout] 251 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 237 ~ if let Some(inside) = json_value.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 238 ~ && !inside.is_empty() { [INFO] [stdout] 239 | let fields = vec!["date", "context"]; [INFO] [stdout] ... [INFO] [stdout] 249 | } [INFO] [stdout] 250 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:357:17 [INFO] [stdout] | [INFO] [stdout] 357 | / if let Some(outside) = json.get_mut("outside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 358 | | if entry_info.entry_index < outside.len() { [INFO] [stdout] 359 | | outside.remove(entry_info.entry_index); [INFO] [stdout] 360 | | } [INFO] [stdout] 361 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 357 ~ if let Some(outside) = json.get_mut("outside").and_then(|v| v.as_array_mut()) [INFO] [stdout] 358 ~ && entry_info.entry_index < outside.len() { [INFO] [stdout] 359 | outside.remove(entry_info.entry_index); [INFO] [stdout] 360 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:362:20 [INFO] [stdout] | [INFO] [stdout] 362 | } else if entry_info.section == "inside" { [INFO] [stdout] | ____________________^ [INFO] [stdout] 363 | | if let Some(inside) = json.get_mut("inside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 364 | | if entry_info.entry_index < inside.len() { [INFO] [stdout] 365 | | inside.remove(entry_info.entry_index); [INFO] [stdout] ... | [INFO] [stdout] 368 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 362 ~ } else if entry_info.section == "inside" [INFO] [stdout] 363 ~ && let Some(inside) = json.get_mut("inside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 364 | if entry_info.entry_index < inside.len() { [INFO] [stdout] 365 | inside.remove(entry_info.entry_index); [INFO] [stdout] 366 | } [INFO] [stdout] 367 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:363:17 [INFO] [stdout] | [INFO] [stdout] 363 | / if let Some(inside) = json.get_mut("inside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 364 | | if entry_info.entry_index < inside.len() { [INFO] [stdout] 365 | | inside.remove(entry_info.entry_index); [INFO] [stdout] 366 | | } [INFO] [stdout] 367 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 363 ~ if let Some(inside) = json.get_mut("inside").and_then(|v| v.as_array_mut()) [INFO] [stdout] 364 ~ && entry_info.entry_index < inside.len() { [INFO] [stdout] 365 | inside.remove(entry_info.entry_index); [INFO] [stdout] 366 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:385:17 [INFO] [stdout] | [INFO] [stdout] 385 | / if let Some(outside) = json.get_mut("outside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 386 | | if entry_info.entry_index < outside.len() { [INFO] [stdout] 387 | | let entry_clone = outside[entry_info.entry_index].clone(); [INFO] [stdout] 388 | | outside.insert(entry_info.entry_index + 1, entry_clone); [INFO] [stdout] 389 | | } [INFO] [stdout] 390 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 385 ~ if let Some(outside) = json.get_mut("outside").and_then(|v| v.as_array_mut()) [INFO] [stdout] 386 ~ && entry_info.entry_index < outside.len() { [INFO] [stdout] 387 | let entry_clone = outside[entry_info.entry_index].clone(); [INFO] [stdout] 388 | outside.insert(entry_info.entry_index + 1, entry_clone); [INFO] [stdout] 389 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:391:20 [INFO] [stdout] | [INFO] [stdout] 391 | } else if entry_info.section == "inside" { [INFO] [stdout] | ____________________^ [INFO] [stdout] 392 | | if let Some(inside) = json.get_mut("inside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 393 | | if entry_info.entry_index < inside.len() { [INFO] [stdout] 394 | | let entry_clone = inside[entry_info.entry_index].clone(); [INFO] [stdout] ... | [INFO] [stdout] 398 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 391 ~ } else if entry_info.section == "inside" [INFO] [stdout] 392 ~ && let Some(inside) = json.get_mut("inside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 393 | if entry_info.entry_index < inside.len() { [INFO] [stdout] ... [INFO] [stdout] 396 | } [INFO] [stdout] 397 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/toon_ops.rs:392:17 [INFO] [stdout] | [INFO] [stdout] 392 | / if let Some(inside) = json.get_mut("inside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 393 | | if entry_info.entry_index < inside.len() { [INFO] [stdout] 394 | | let entry_clone = inside[entry_info.entry_index].clone(); [INFO] [stdout] 395 | | inside.insert(entry_info.entry_index + 1, entry_clone); [INFO] [stdout] 396 | | } [INFO] [stdout] 397 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 392 ~ if let Some(inside) = json.get_mut("inside").and_then(|v| v.as_array_mut()) [INFO] [stdout] 393 ~ && entry_info.entry_index < inside.len() { [INFO] [stdout] 394 | let entry_clone = inside[entry_info.entry_index].clone(); [INFO] [stdout] 395 | inside.insert(entry_info.entry_index + 1, entry_clone); [INFO] [stdout] 396 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/ui/json_highlight.rs:30:17 [INFO] [stdout] | [INFO] [stdout] 30 | while let Some(next_ch) = chars.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for next_ch in chars.by_ref()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this loop could be written as a `for` loop [INFO] [stdout] --> src/ui/json_highlight.rs:44:17 [INFO] [stdout] | [INFO] [stdout] 44 | while let Some(peek_ch) = temp_chars.next() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `for peek_ch in temp_chars` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_let_on_iterator [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual arithmetic check found [INFO] [stdout] --> src/ui/utils.rs:33:29 [INFO] [stdout] | [INFO] [stdout] 33 | let visible_start = if span_start < start_col { [INFO] [stdout] | _____________________________^ [INFO] [stdout] 34 | | start_col - span_start [INFO] [stdout] 35 | | } else { [INFO] [stdout] 36 | | 0 [INFO] [stdout] 37 | | }; [INFO] [stdout] | |_________^ help: replace it with: `start_col.saturating_sub(span_start)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#implicit_saturating_sub [INFO] [stdout] = note: `#[warn(clippy::implicit_saturating_sub)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/explorer.rs:56:9 [INFO] [stdout] | [INFO] [stdout] 56 | / if !app.show_extension && entry.path.is_file() { [INFO] [stdout] 57 | | if let Some(stem) = entry.path.file_stem().and_then(|s| s.to_str()) { [INFO] [stdout] 58 | | name = stem.to_string(); [INFO] [stdout] 59 | | } [INFO] [stdout] 60 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 56 ~ if !app.show_extension && entry.path.is_file() [INFO] [stdout] 57 ~ && let Some(stem) = entry.path.file_stem().and_then(|s| s.to_str()) { [INFO] [stdout] 58 | name = stem.to_string(); [INFO] [stdout] 59 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `app.edit_buffer_is_placeholder.get(0)` [INFO] [stdout] --> src/ui/edit_overlay.rs:78:30 [INFO] [stdout] | [INFO] [stdout] 78 | let is_placeholder = app.edit_buffer_is_placeholder.get(0).copied().unwrap_or(false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `app.edit_buffer_is_placeholder.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] = note: `#[warn(clippy::get_first)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: accessing first element with `app.edit_buffer_is_placeholder.get(0)` [INFO] [stdout] --> src/ui/edit_overlay.rs:112:30 [INFO] [stdout] | [INFO] [stdout] 112 | let is_placeholder = app.edit_buffer_is_placeholder.get(0).copied().unwrap_or(false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `app.edit_buffer_is_placeholder.first()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_first [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the variable `actual_pos` is used as a loop counter [INFO] [stdout] --> src/ui/edit_overlay.rs:292:13 [INFO] [stdout] | [INFO] [stdout] 292 | for ch in field.chars() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `for (actual_pos, ch) in field.chars().enumerate()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#explicit_counter_loop [INFO] [stdout] = note: `#[warn(clippy::explicit_counter_loop)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `repeat().take()` can be written more concisely [INFO] [stdout] --> src/ui/content.rs:53:16 [INFO] [stdout] | [INFO] [stdout] 53 | .chain(std::iter::repeat(&empty_line).take(bottom_padding as usize)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `repeat_n()` instead: `std::iter::repeat_n(&empty_line, bottom_padding as usize)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n [INFO] [stdout] = note: `#[warn(clippy::manual_repeat_n)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/content.rs:292:13 [INFO] [stdout] | [INFO] [stdout] 292 | / if app.format_mode == FormatMode::Edit [INFO] [stdout] 293 | | && (app.input_mode == InputMode::Insert || app.input_mode == InputMode::Normal) [INFO] [stdout] 294 | | && app.show_cursor [INFO] [stdout] ... | [INFO] [stdout] 368 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 294 ~ && app.show_cursor [INFO] [stdout] 295 ~ && actual_idx == app.content_cursor_line { [INFO] [stdout] 296 | let cursor_char_pos = app.content_cursor_col; [INFO] [stdout] ... [INFO] [stdout] 365 | } [INFO] [stdout] 366 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `revw::content_ops::ContentOperations` [INFO] [stdout] --> tests/toon_tests.rs:2:5 [INFO] [stdout] | [INFO] [stdout] 2 | use revw::content_ops::ContentOperations; [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: `revw::toon_ops::ToonOperations` [INFO] [stdout] --> tests/toon_tests.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use revw::toon_ops::ToonOperations; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/basic.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 9 | / if self.format_mode == FormatMode::View && !self.relf_entries.is_empty() { [INFO] [stdout] 10 | | if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 11 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 12 | | let outside_count = obj [INFO] [stdout] ... | [INFO] [stdout] 73 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 9 ~ if self.format_mode == FormatMode::View && !self.relf_entries.is_empty() [INFO] [stdout] 10 ~ && let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 11 | if let Some(obj) = json_value.as_object() { [INFO] [stdout] ... [INFO] [stdout] 71 | } [INFO] [stdout] 72 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/basic.rs:10:13 [INFO] [stdout] | [INFO] [stdout] 10 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 11 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 12 | | let outside_count = obj [INFO] [stdout] 13 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 72 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 10 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 11 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 12 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 70 | return; [INFO] [stdout] 71 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/basic.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 96 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 97 | | let outside_count = obj [INFO] [stdout] 98 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 135 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 95 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 96 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 97 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 133 | return; [INFO] [stdout] 134 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/basic.rs:177:13 [INFO] [stdout] | [INFO] [stdout] 177 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 178 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 179 | | let outside_count = obj [INFO] [stdout] 180 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 217 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 177 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 178 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 179 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 215 | return; [INFO] [stdout] 216 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/basic.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 9 | / if self.format_mode == FormatMode::View && !self.relf_entries.is_empty() { [INFO] [stdout] 10 | | if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 11 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 12 | | let outside_count = obj [INFO] [stdout] ... | [INFO] [stdout] 73 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 9 ~ if self.format_mode == FormatMode::View && !self.relf_entries.is_empty() [INFO] [stdout] 10 ~ && let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 11 | if let Some(obj) = json_value.as_object() { [INFO] [stdout] ... [INFO] [stdout] 71 | } [INFO] [stdout] 72 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:118:9 [INFO] [stdout] | [INFO] [stdout] 118 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 119 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 120 | | let outside_count = obj [INFO] [stdout] 121 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 197 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 118 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 119 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 120 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 195 | } [INFO] [stdout] 196 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/basic.rs:10:13 [INFO] [stdout] | [INFO] [stdout] 10 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 11 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 12 | | let outside_count = obj [INFO] [stdout] 13 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 72 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 10 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 11 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 12 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 70 | return; [INFO] [stdout] 71 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/basic.rs:95:13 [INFO] [stdout] | [INFO] [stdout] 95 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 96 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 97 | | let outside_count = obj [INFO] [stdout] 98 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 135 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 95 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 96 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 97 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 133 | return; [INFO] [stdout] 134 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:146:25 [INFO] [stdout] | [INFO] [stdout] 146 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 147 | | if original_idx < outside.len() { [INFO] [stdout] 148 | | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 149 | | } [INFO] [stdout] 150 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 146 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 147 ~ && original_idx < outside.len() { [INFO] [stdout] 148 | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 149 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:154:25 [INFO] [stdout] | [INFO] [stdout] 154 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 155 | | if inside_idx < inside.len() { [INFO] [stdout] 156 | | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 157 | | } [INFO] [stdout] 158 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 154 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 155 ~ && inside_idx < inside.len() { [INFO] [stdout] 156 | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 157 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:210:9 [INFO] [stdout] | [INFO] [stdout] 210 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 211 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 212 | | let outside_count = obj [INFO] [stdout] 213 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 288 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 210 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 211 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 212 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 286 | } [INFO] [stdout] 287 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:238:25 [INFO] [stdout] | [INFO] [stdout] 238 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 239 | | if original_idx < outside.len() { [INFO] [stdout] 240 | | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 241 | | } [INFO] [stdout] 242 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 238 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 239 ~ && original_idx < outside.len() { [INFO] [stdout] 240 | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 241 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:246:25 [INFO] [stdout] | [INFO] [stdout] 246 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 247 | | if inside_idx < inside.len() { [INFO] [stdout] 248 | | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 249 | | } [INFO] [stdout] 250 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 246 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 247 ~ && inside_idx < inside.len() { [INFO] [stdout] 248 | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:301:9 [INFO] [stdout] | [INFO] [stdout] 301 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 302 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 303 | | let outside_count = obj [INFO] [stdout] 304 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 382 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 301 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 302 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 303 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 380 | } [INFO] [stdout] 381 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:329:25 [INFO] [stdout] | [INFO] [stdout] 329 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 330 | | if original_idx < outside.len() { [INFO] [stdout] 331 | | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 332 | | } [INFO] [stdout] 333 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 329 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 330 ~ && original_idx < outside.len() { [INFO] [stdout] 331 | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 332 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:337:25 [INFO] [stdout] | [INFO] [stdout] 337 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 338 | | if inside_idx < inside.len() { [INFO] [stdout] 339 | | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 340 | | } [INFO] [stdout] 341 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 337 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 338 ~ && inside_idx < inside.len() { [INFO] [stdout] 339 | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 340 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/basic.rs:177:13 [INFO] [stdout] | [INFO] [stdout] 177 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 178 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 179 | | let outside_count = obj [INFO] [stdout] 180 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 217 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 177 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 178 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 179 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 215 | return; [INFO] [stdout] 216 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/delete.rs:181:9 [INFO] [stdout] | [INFO] [stdout] 181 | / if let Ok(mut json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 182 | | if let Some(obj) = json_value.as_object_mut() { [INFO] [stdout] 183 | | let outside_count = obj [INFO] [stdout] 184 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 250 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 181 ~ if let Ok(mut json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 182 ~ && let Some(obj) = json_value.as_object_mut() { [INFO] [stdout] 183 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 248 | } [INFO] [stdout] 249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:118:9 [INFO] [stdout] | [INFO] [stdout] 118 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 119 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 120 | | let outside_count = obj [INFO] [stdout] 121 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 197 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 118 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 119 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 120 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 195 | } [INFO] [stdout] 196 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:146:25 [INFO] [stdout] | [INFO] [stdout] 146 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 147 | | if original_idx < outside.len() { [INFO] [stdout] 148 | | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 149 | | } [INFO] [stdout] 150 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 146 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 147 ~ && original_idx < outside.len() { [INFO] [stdout] 148 | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 149 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:154:25 [INFO] [stdout] | [INFO] [stdout] 154 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 155 | | if inside_idx < inside.len() { [INFO] [stdout] 156 | | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 157 | | } [INFO] [stdout] 158 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 154 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 155 ~ && inside_idx < inside.len() { [INFO] [stdout] 156 | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 157 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/duplicate.rs:13:13 [INFO] [stdout] | [INFO] [stdout] 13 | / if let Ok(mut json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 14 | | if let Some(obj) = json_value.as_object_mut() { [INFO] [stdout] 15 | | let outside_count = obj [INFO] [stdout] 16 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 73 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 13 ~ if let Ok(mut json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 14 ~ && let Some(obj) = json_value.as_object_mut() { [INFO] [stdout] 15 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 71 | } [INFO] [stdout] 72 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/duplicate.rs:24:25 [INFO] [stdout] | [INFO] [stdout] 24 | / if let Some(outside) = obj.get_mut("outside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 25 | | if target_idx < outside.len() { [INFO] [stdout] 26 | | let entry_clone = outside[target_idx].clone(); [INFO] [stdout] 27 | | outside.insert(target_idx + 1, entry_clone); [INFO] [stdout] ... | [INFO] [stdout] 45 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 24 ~ if let Some(outside) = obj.get_mut("outside").and_then(|v| v.as_array_mut()) [INFO] [stdout] 25 ~ && target_idx < outside.len() { [INFO] [stdout] 26 | let entry_clone = outside[target_idx].clone(); [INFO] [stdout] ... [INFO] [stdout] 43 | } [INFO] [stdout] 44 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:210:9 [INFO] [stdout] | [INFO] [stdout] 210 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 211 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 212 | | let outside_count = obj [INFO] [stdout] 213 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 288 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 210 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 211 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 212 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 286 | } [INFO] [stdout] 287 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:238:25 [INFO] [stdout] | [INFO] [stdout] 238 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 239 | | if original_idx < outside.len() { [INFO] [stdout] 240 | | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 241 | | } [INFO] [stdout] 242 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 238 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 239 ~ && original_idx < outside.len() { [INFO] [stdout] 240 | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 241 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/duplicate.rs:49:25 [INFO] [stdout] | [INFO] [stdout] 49 | / if let Some(inside) = obj.get_mut("inside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 50 | | if inside_index < inside.len() { [INFO] [stdout] 51 | | let entry_clone = inside[inside_index].clone(); [INFO] [stdout] 52 | | inside.insert(inside_index + 1, entry_clone); [INFO] [stdout] ... | [INFO] [stdout] 70 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 49 ~ if let Some(inside) = obj.get_mut("inside").and_then(|v| v.as_array_mut()) [INFO] [stdout] 50 ~ && inside_index < inside.len() { [INFO] [stdout] 51 | let entry_clone = inside[inside_index].clone(); [INFO] [stdout] ... [INFO] [stdout] 68 | } [INFO] [stdout] 69 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:246:25 [INFO] [stdout] | [INFO] [stdout] 246 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 247 | | if inside_idx < inside.len() { [INFO] [stdout] 248 | | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 249 | | } [INFO] [stdout] 250 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 246 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 247 ~ && inside_idx < inside.len() { [INFO] [stdout] 248 | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:301:9 [INFO] [stdout] | [INFO] [stdout] 301 | / if let Ok(json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 302 | | if let Some(obj) = json_value.as_object() { [INFO] [stdout] 303 | | let outside_count = obj [INFO] [stdout] 304 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 382 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 301 ~ if let Ok(json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 302 ~ && let Some(obj) = json_value.as_object() { [INFO] [stdout] 303 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 380 | } [INFO] [stdout] 381 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:329:25 [INFO] [stdout] | [INFO] [stdout] 329 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 330 | | if original_idx < outside.len() { [INFO] [stdout] 331 | | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 332 | | } [INFO] [stdout] 333 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 329 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 330 ~ && original_idx < outside.len() { [INFO] [stdout] 331 | selected_outside.push(outside[original_idx].clone()); [INFO] [stdout] 332 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/copy/cards.rs:337:25 [INFO] [stdout] | [INFO] [stdout] 337 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 338 | | if inside_idx < inside.len() { [INFO] [stdout] 339 | | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 340 | | } [INFO] [stdout] 341 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 337 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 338 ~ && inside_idx < inside.len() { [INFO] [stdout] 339 | selected_inside.push(inside[inside_idx].clone()); [INFO] [stdout] 340 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/delete.rs:181:9 [INFO] [stdout] | [INFO] [stdout] 181 | / if let Ok(mut json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 182 | | if let Some(obj) = json_value.as_object_mut() { [INFO] [stdout] 183 | | let outside_count = obj [INFO] [stdout] 184 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 250 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 181 ~ if let Ok(mut json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 182 ~ && let Some(obj) = json_value.as_object_mut() { [INFO] [stdout] 183 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 248 | } [INFO] [stdout] 249 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/helpers.rs:11:13 [INFO] [stdout] | [INFO] [stdout] 11 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 12 | | if !outside.is_empty() { [INFO] [stdout] 13 | | output_lines.push("## OUTSIDE".to_string()); [INFO] [stdout] 14 | | output_lines.push("".to_string()); [INFO] [stdout] ... | [INFO] [stdout] 52 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 11 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 12 ~ && !outside.is_empty() { [INFO] [stdout] 13 | output_lines.push("## OUTSIDE".to_string()); [INFO] [stdout] ... [INFO] [stdout] 50 | } [INFO] [stdout] 51 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/helpers.rs:32:29 [INFO] [stdout] | [INFO] [stdout] 32 | / ... if let Some(url_str) = url { [INFO] [stdout] 33 | | ... if !url_str.is_empty() { [INFO] [stdout] 34 | | ... output_lines.push("".to_string()); [INFO] [stdout] 35 | | ... output_lines.push(format!("**URL:** {}", url_str)); [INFO] [stdout] 36 | | ... } [INFO] [stdout] 37 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 32 ~ if let Some(url_str) = url [INFO] [stdout] 33 ~ && !url_str.is_empty() { [INFO] [stdout] 34 | output_lines.push("".to_string()); [INFO] [stdout] 35 | output_lines.push(format!("**URL:** {}", url_str)); [INFO] [stdout] 36 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/helpers.rs:55:13 [INFO] [stdout] | [INFO] [stdout] 55 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 56 | | if !inside.is_empty() { [INFO] [stdout] 57 | | output_lines.push("## INSIDE".to_string()); [INFO] [stdout] 58 | | output_lines.push("".to_string()); [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#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 55 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 56 ~ && !inside.is_empty() { [INFO] [stdout] 57 | output_lines.push("## INSIDE".to_string()); [INFO] [stdout] ... [INFO] [stdout] 78 | } [INFO] [stdout] 79 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/duplicate.rs:13:13 [INFO] [stdout] | [INFO] [stdout] 13 | / if let Ok(mut json_value) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 14 | | if let Some(obj) = json_value.as_object_mut() { [INFO] [stdout] 15 | | let outside_count = obj [INFO] [stdout] 16 | | .get("outside") [INFO] [stdout] ... | [INFO] [stdout] 73 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 13 ~ if let Ok(mut json_value) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 14 ~ && let Some(obj) = json_value.as_object_mut() { [INFO] [stdout] 15 | let outside_count = obj [INFO] [stdout] ... [INFO] [stdout] 71 | } [INFO] [stdout] 72 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/duplicate.rs:24:25 [INFO] [stdout] | [INFO] [stdout] 24 | / if let Some(outside) = obj.get_mut("outside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 25 | | if target_idx < outside.len() { [INFO] [stdout] 26 | | let entry_clone = outside[target_idx].clone(); [INFO] [stdout] 27 | | outside.insert(target_idx + 1, entry_clone); [INFO] [stdout] ... | [INFO] [stdout] 45 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 24 ~ if let Some(outside) = obj.get_mut("outside").and_then(|v| v.as_array_mut()) [INFO] [stdout] 25 ~ && target_idx < outside.len() { [INFO] [stdout] 26 | let entry_clone = outside[target_idx].clone(); [INFO] [stdout] ... [INFO] [stdout] 43 | } [INFO] [stdout] 44 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/duplicate.rs:49:25 [INFO] [stdout] | [INFO] [stdout] 49 | / if let Some(inside) = obj.get_mut("inside").and_then(|v| v.as_array_mut()) { [INFO] [stdout] 50 | | if inside_index < inside.len() { [INFO] [stdout] 51 | | let entry_clone = inside[inside_index].clone(); [INFO] [stdout] 52 | | inside.insert(inside_index + 1, entry_clone); [INFO] [stdout] ... | [INFO] [stdout] 70 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 49 ~ if let Some(inside) = obj.get_mut("inside").and_then(|v| v.as_array_mut()) [INFO] [stdout] 50 ~ && inside_index < inside.len() { [INFO] [stdout] 51 | let entry_clone = inside[inside_index].clone(); [INFO] [stdout] ... [INFO] [stdout] 68 | } [INFO] [stdout] 69 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:16:25 [INFO] [stdout] | [INFO] [stdout] 16 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 17 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 18 | | // Convert JSON to Markdown [INFO] [stdout] 19 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... | [INFO] [stdout] 24 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 16 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 17 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 18 | // Convert JSON to Markdown [INFO] [stdout] ... [INFO] [stdout] 22 | } [INFO] [stdout] 23 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:32:25 [INFO] [stdout] | [INFO] [stdout] 32 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 33 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 34 | | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] 35 | | return; [INFO] [stdout] 36 | | } [INFO] [stdout] 37 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 32 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 33 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 34 | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] 35 | return; [INFO] [stdout] 36 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:164:25 [INFO] [stdout] | [INFO] [stdout] 164 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 165 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 166 | | // Convert JSON to Markdown [INFO] [stdout] 167 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... | [INFO] [stdout] 172 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 164 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 165 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 166 | // Convert JSON to Markdown [INFO] [stdout] ... [INFO] [stdout] 170 | } [INFO] [stdout] 171 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:180:25 [INFO] [stdout] | [INFO] [stdout] 180 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 181 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 182 | | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 183 | | return; [INFO] [stdout] 184 | | } [INFO] [stdout] 185 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 180 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 181 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 182 | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 183 | return; [INFO] [stdout] 184 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/helpers.rs:11:13 [INFO] [stdout] | [INFO] [stdout] 11 | / if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) { [INFO] [stdout] 12 | | if !outside.is_empty() { [INFO] [stdout] 13 | | output_lines.push("## OUTSIDE".to_string()); [INFO] [stdout] 14 | | output_lines.push("".to_string()); [INFO] [stdout] ... | [INFO] [stdout] 52 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 11 ~ if let Some(outside) = obj.get("outside").and_then(|v| v.as_array()) [INFO] [stdout] 12 ~ && !outside.is_empty() { [INFO] [stdout] 13 | output_lines.push("## OUTSIDE".to_string()); [INFO] [stdout] ... [INFO] [stdout] 50 | } [INFO] [stdout] 51 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/helpers.rs:32:29 [INFO] [stdout] | [INFO] [stdout] 32 | / ... if let Some(url_str) = url { [INFO] [stdout] 33 | | ... if !url_str.is_empty() { [INFO] [stdout] 34 | | ... output_lines.push("".to_string()); [INFO] [stdout] 35 | | ... output_lines.push(format!("**URL:** {}", url_str)); [INFO] [stdout] 36 | | ... } [INFO] [stdout] 37 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 32 ~ if let Some(url_str) = url [INFO] [stdout] 33 ~ && !url_str.is_empty() { [INFO] [stdout] 34 | output_lines.push("".to_string()); [INFO] [stdout] 35 | output_lines.push(format!("**URL:** {}", url_str)); [INFO] [stdout] 36 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/helpers.rs:55:13 [INFO] [stdout] | [INFO] [stdout] 55 | / if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 56 | | if !inside.is_empty() { [INFO] [stdout] 57 | | output_lines.push("## INSIDE".to_string()); [INFO] [stdout] 58 | | output_lines.push("".to_string()); [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#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 55 ~ if let Some(inside) = obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 56 ~ && !inside.is_empty() { [INFO] [stdout] 57 | output_lines.push("## INSIDE".to_string()); [INFO] [stdout] ... [INFO] [stdout] 78 | } [INFO] [stdout] 79 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:310:25 [INFO] [stdout] | [INFO] [stdout] 310 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 311 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 312 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 313 | | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] ... | [INFO] [stdout] 318 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 310 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 311 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 312 | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... [INFO] [stdout] 316 | } [INFO] [stdout] 317 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:311:29 [INFO] [stdout] | [INFO] [stdout] 311 | / ... if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 312 | | ... if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 313 | | ... self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 314 | | ... self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] ... | [INFO] [stdout] 317 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 311 ~ if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) [INFO] [stdout] 312 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 313 | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 314 | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] 315 | return; [INFO] [stdout] 316 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:326:25 [INFO] [stdout] | [INFO] [stdout] 326 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 327 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 328 | | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 329 | | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] ... | [INFO] [stdout] 332 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 326 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 327 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 328 | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 329 | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] 330 | return; [INFO] [stdout] 331 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:16:25 [INFO] [stdout] | [INFO] [stdout] 16 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 17 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 18 | | // Convert JSON to Markdown [INFO] [stdout] 19 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... | [INFO] [stdout] 24 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 16 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 17 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 18 | // Convert JSON to Markdown [INFO] [stdout] ... [INFO] [stdout] 22 | } [INFO] [stdout] 23 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:32:25 [INFO] [stdout] | [INFO] [stdout] 32 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 33 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 34 | | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] 35 | | return; [INFO] [stdout] 36 | | } [INFO] [stdout] 37 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 32 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 33 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 34 | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] 35 | return; [INFO] [stdout] 36 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:164:25 [INFO] [stdout] | [INFO] [stdout] 164 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 165 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 166 | | // Convert JSON to Markdown [INFO] [stdout] 167 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... | [INFO] [stdout] 172 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 164 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 165 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 166 | // Convert JSON to Markdown [INFO] [stdout] ... [INFO] [stdout] 170 | } [INFO] [stdout] 171 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:180:25 [INFO] [stdout] | [INFO] [stdout] 180 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 181 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 182 | | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 183 | | return; [INFO] [stdout] 184 | | } [INFO] [stdout] 185 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 180 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 181 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 182 | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 183 | return; [INFO] [stdout] 184 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:310:25 [INFO] [stdout] | [INFO] [stdout] 310 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 311 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 312 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 313 | | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] ... | [INFO] [stdout] 318 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 310 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 311 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 312 | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... [INFO] [stdout] 316 | } [INFO] [stdout] 317 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:311:29 [INFO] [stdout] | [INFO] [stdout] 311 | / ... if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 312 | | ... if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 313 | | ... self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 314 | | ... self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] ... | [INFO] [stdout] 317 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 311 ~ if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) [INFO] [stdout] 312 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 313 | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 314 | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] 315 | return; [INFO] [stdout] 316 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/append.rs:326:25 [INFO] [stdout] | [INFO] [stdout] 326 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 327 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 328 | | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 329 | | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] ... | [INFO] [stdout] 332 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 326 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 327 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 328 | self.paste_markdown_section_append(&md_text, "OUTSIDE"); [INFO] [stdout] 329 | self.paste_markdown_section_append(&md_text, "INSIDE"); [INFO] [stdout] 330 | return; [INFO] [stdout] 331 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/overwrite.rs:16:25 [INFO] [stdout] | [INFO] [stdout] 16 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 17 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 18 | | // Convert JSON to Markdown [INFO] [stdout] 19 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... | [INFO] [stdout] 24 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 16 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 17 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 18 | // Convert JSON to Markdown [INFO] [stdout] ... [INFO] [stdout] 22 | } [INFO] [stdout] 23 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/overwrite.rs:32:25 [INFO] [stdout] | [INFO] [stdout] 32 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 33 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 34 | | self.paste_markdown_section_overwrite(&md_text, "INSIDE"); [INFO] [stdout] 35 | | return; [INFO] [stdout] 36 | | } [INFO] [stdout] 37 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 32 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 33 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 34 | self.paste_markdown_section_overwrite(&md_text, "INSIDE"); [INFO] [stdout] 35 | return; [INFO] [stdout] 36 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/overwrite.rs:145:25 [INFO] [stdout] | [INFO] [stdout] 145 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 146 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 147 | | // Convert JSON to Markdown [INFO] [stdout] 148 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... | [INFO] [stdout] 153 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 145 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 146 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 147 | // Convert JSON to Markdown [INFO] [stdout] ... [INFO] [stdout] 151 | } [INFO] [stdout] 152 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/overwrite.rs:161:25 [INFO] [stdout] | [INFO] [stdout] 161 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 162 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 163 | | self.paste_markdown_section_overwrite(&md_text, "OUTSIDE"); [INFO] [stdout] 164 | | return; [INFO] [stdout] 165 | | } [INFO] [stdout] 166 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 161 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 162 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 163 | self.paste_markdown_section_overwrite(&md_text, "OUTSIDE"); [INFO] [stdout] 164 | return; [INFO] [stdout] 165 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/overwrite.rs:16:25 [INFO] [stdout] | [INFO] [stdout] 16 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 17 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 18 | | // Convert JSON to Markdown [INFO] [stdout] 19 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... | [INFO] [stdout] 24 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 16 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 17 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 18 | // Convert JSON to Markdown [INFO] [stdout] ... [INFO] [stdout] 22 | } [INFO] [stdout] 23 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/overwrite.rs:32:25 [INFO] [stdout] | [INFO] [stdout] 32 | / if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) { [INFO] [stdout] 33 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 34 | | self.paste_markdown_section_overwrite(&md_text, "INSIDE"); [INFO] [stdout] 35 | | return; [INFO] [stdout] 36 | | } [INFO] [stdout] 37 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 32 ~ if let Ok(clipboard_json) = self.clipboard_text_to_json_value(&clipboard_text) [INFO] [stdout] 33 ~ && let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] 34 | self.paste_markdown_section_overwrite(&md_text, "INSIDE"); [INFO] [stdout] 35 | return; [INFO] [stdout] 36 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:11:13 [INFO] [stdout] | [INFO] [stdout] 11 | / if let Ok(clipboard_json) = serde_json::from_str::(text) { [INFO] [stdout] 12 | | if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 13 | | if let Some(new_inside) = clipboard_obj.get("inside") { [INFO] [stdout] 14 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... | [INFO] [stdout] 25 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 11 ~ if let Ok(clipboard_json) = serde_json::from_str::(text) [INFO] [stdout] 12 ~ && let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 13 | if let Some(new_inside) = clipboard_obj.get("inside") { [INFO] [stdout] ... [INFO] [stdout] 23 | } [INFO] [stdout] 24 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:12:17 [INFO] [stdout] | [INFO] [stdout] 12 | / if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 13 | | if let Some(new_inside) = clipboard_obj.get("inside") { [INFO] [stdout] 14 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 15 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... | [INFO] [stdout] 24 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 12 ~ if let Some(clipboard_obj) = clipboard_json.as_object() [INFO] [stdout] 13 ~ && let Some(new_inside) = clipboard_obj.get("inside") { [INFO] [stdout] 14 | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... [INFO] [stdout] 22 | } [INFO] [stdout] 23 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:13:21 [INFO] [stdout] | [INFO] [stdout] 13 | / if let Some(new_inside) = clipboard_obj.get("inside") { [INFO] [stdout] 14 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 15 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 16 | | current_obj.insert("inside".to_string(), new_inside.clone()); [INFO] [stdout] ... | [INFO] [stdout] 23 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 13 ~ if let Some(new_inside) = clipboard_obj.get("inside") [INFO] [stdout] 14 ~ && let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 15 | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... [INFO] [stdout] 21 | } [INFO] [stdout] 22 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:14:25 [INFO] [stdout] | [INFO] [stdout] 14 | / if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 15 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 16 | | current_obj.insert("inside".to_string(), new_inside.clone()); [INFO] [stdout] 17 | | self.json_input = serde_json::to_string_pretty(¤t_json).unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 22 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 14 ~ if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 15 ~ && let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 16 | current_obj.insert("inside".to_string(), new_inside.clone()); [INFO] [stdout] ... [INFO] [stdout] 20 | self.set_status("INSIDE section overwritten"); [INFO] [stdout] 21 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:35:13 [INFO] [stdout] | [INFO] [stdout] 35 | / if let Ok(clipboard_json) = serde_json::from_str::(text) { [INFO] [stdout] 36 | | if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 37 | | if let Some(new_outside) = clipboard_obj.get("outside") { [INFO] [stdout] 38 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... | [INFO] [stdout] 49 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 35 ~ if let Ok(clipboard_json) = serde_json::from_str::(text) [INFO] [stdout] 36 ~ && let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 37 | if let Some(new_outside) = clipboard_obj.get("outside") { [INFO] [stdout] ... [INFO] [stdout] 47 | } [INFO] [stdout] 48 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:36:17 [INFO] [stdout] | [INFO] [stdout] 36 | / if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 37 | | if let Some(new_outside) = clipboard_obj.get("outside") { [INFO] [stdout] 38 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 39 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... | [INFO] [stdout] 48 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 36 ~ if let Some(clipboard_obj) = clipboard_json.as_object() [INFO] [stdout] 37 ~ && let Some(new_outside) = clipboard_obj.get("outside") { [INFO] [stdout] 38 | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... [INFO] [stdout] 46 | } [INFO] [stdout] 47 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:37:21 [INFO] [stdout] | [INFO] [stdout] 37 | / if let Some(new_outside) = clipboard_obj.get("outside") { [INFO] [stdout] 38 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 39 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 40 | | current_obj.insert("outside".to_string(), new_outside.clone()); [INFO] [stdout] ... | [INFO] [stdout] 47 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 37 ~ if let Some(new_outside) = clipboard_obj.get("outside") [INFO] [stdout] 38 ~ && let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 39 | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... [INFO] [stdout] 45 | } [INFO] [stdout] 46 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:38:25 [INFO] [stdout] | [INFO] [stdout] 38 | / if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 39 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 40 | | current_obj.insert("outside".to_string(), new_outside.clone()); [INFO] [stdout] 41 | | self.json_input = serde_json::to_string_pretty(¤t_json).unwrap(); [INFO] [stdout] ... | [INFO] [stdout] 46 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 38 ~ if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 39 ~ && let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 40 | current_obj.insert("outside".to_string(), new_outside.clone()); [INFO] [stdout] ... [INFO] [stdout] 44 | self.set_status("OUTSIDE section overwritten"); [INFO] [stdout] 45 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:59:13 [INFO] [stdout] | [INFO] [stdout] 59 | / if let Ok(clipboard_json) = serde_json::from_str::(text) { [INFO] [stdout] 60 | | if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 61 | | if let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 62 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... | [INFO] [stdout] 79 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 59 ~ if let Ok(clipboard_json) = serde_json::from_str::(text) [INFO] [stdout] 60 ~ && let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 61 | if let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] ... [INFO] [stdout] 77 | } [INFO] [stdout] 78 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:60:17 [INFO] [stdout] | [INFO] [stdout] 60 | / if let Some(clipboard_obj) = clipboard_json.as_object() { [INFO] [stdout] 61 | | if let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 62 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 63 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... | [INFO] [stdout] 78 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 60 ~ if let Some(clipboard_obj) = clipboard_json.as_object() [INFO] [stdout] 61 ~ && let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 62 | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] ... [INFO] [stdout] 76 | } [INFO] [stdout] 77 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:61:21 [INFO] [stdout] | [INFO] [stdout] 61 | / if let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) { [INFO] [stdout] 62 | | if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 63 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 64 | | let current_inside = current_obj [INFO] [stdout] ... | [INFO] [stdout] 77 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 61 ~ if let Some(new_inside) = clipboard_obj.get("inside").and_then(|v| v.as_array()) [INFO] [stdout] 62 ~ && let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 63 | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] ... [INFO] [stdout] 75 | } [INFO] [stdout] 76 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/text.rs:62:25 [INFO] [stdout] | [INFO] [stdout] 62 | / if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) { [INFO] [stdout] 63 | | if let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 64 | | let current_inside = current_obj [INFO] [stdout] 65 | | .entry("inside".to_string()) [INFO] [stdout] ... | [INFO] [stdout] 76 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 62 ~ if let Ok(mut current_json) = serde_json::from_str::(&self.json_input) [INFO] [stdout] 63 ~ && let Some(current_obj) = current_json.as_object_mut() { [INFO] [stdout] 64 | let current_inside = current_obj [INFO] [stdout] ... [INFO] [stdout] 74 | } [INFO] [stdout] 75 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/app/clipboard/paste/overwrite.rs:145:25 [INFO] [stdout] | [INFO] [stdout] 145 | / if trimmed.starts_with('{') || trimmed.starts_with('[') { [INFO] [stdout] 146 | | if let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 147 | | // Convert JSON to Markdown [INFO] [stdout] 148 | | if let Ok(md_text) = Self::json_to_markdown_string(&clipboard_json) { [INFO] [stdout] ... | [INFO] [stdout] 153 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 145 ~ if (trimmed.starts_with('{') || trimmed.starts_with('[')) { [INFO] [stdout] 146 ~ && let Ok(clipboard_json) = serde_json::from_str::(&clipboard_text) { [INFO] [stdout] 147 | // Convert JSON to Markdown [INFO] [stdout] ... [INFO] [stdout] 151 | } [WARN] too many lines in the log, truncating it