[INFO] cloning repository https://github.com/LingoJack/j [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/LingoJack/j" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FLingoJack%2Fj", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FLingoJack%2Fj'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] c845bc639a0a413a48681edfa8f2a52248884f56 [INFO] linting LingoJack/j against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FLingoJack%2Fj" "/workspace/builds/worker-1-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-1-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/LingoJack/j [INFO] finished tweaking git repo https://github.com/LingoJack/j [INFO] tweaked toml for git repo https://github.com/LingoJack/j written to /workspace/builds/worker-1-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/LingoJack/j 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/LingoJack/j already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded strict v0.2.0 [INFO] [stderr] Downloaded crokey-proc_macros v1.4.0 [INFO] [stderr] Downloaded self-replace v1.5.0 [INFO] [stderr] Downloaded zipsign-api v0.1.5 [INFO] [stderr] Downloaded rust-embed-utils v8.11.0 [INFO] [stderr] Downloaded self_update v0.42.0 [INFO] [stderr] Downloaded async-openai-macros v0.1.1 [INFO] [stderr] Downloaded rust-embed-impl v8.11.0 [INFO] [stderr] Downloaded minimad v0.14.0 [INFO] [stderr] Downloaded chromiumoxide_types v0.7.0 [INFO] [stderr] Downloaded markup5ever_rcdom v0.3.0 [INFO] [stderr] Downloaded ravif v0.13.0 [INFO] [stderr] Downloaded crokey v1.4.0 [INFO] [stderr] Downloaded async-tungstenite v0.27.0 [INFO] [stderr] Downloaded html2md v0.2.15 [INFO] [stderr] Downloaded html2text v0.14.4 [INFO] [stderr] Downloaded chromiumoxide v0.7.0 [INFO] [stderr] Downloaded tiff v0.11.3 [INFO] [stderr] Downloaded rustyline v17.0.2 [INFO] [stderr] Downloaded coolor v1.1.0 [INFO] [stderr] Downloaded moxcms v0.8.1 [INFO] [stderr] Downloaded html5ever v0.31.0 [INFO] [stderr] Downloaded async-openai v0.33.0 [INFO] [stderr] Downloaded chromiumoxide_pdl v0.7.0 [INFO] [stderr] Downloaded which v6.0.3 [INFO] [stderr] Downloaded xml5ever v0.18.1 [INFO] [stderr] Downloaded ignore v0.4.25 [INFO] [stderr] Downloaded image v0.25.10 [INFO] [stderr] Downloaded markup5ever v0.16.2 [INFO] [stderr] Downloaded web_atoms v0.2.3 [INFO] [stderr] Downloaded termimad v0.34.1 [INFO] [stderr] Downloaded chromiumoxide_cdp v0.7.0 [INFO] [stderr] Downloaded icy_sixel v0.1.3 [INFO] [stderr] Downloaded rust-embed v8.11.0 [INFO] [stderr] Downloaded ratatui-image v8.1.1 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] d5eb546d6fbff67afc80be39dd6950679529bad5a2fd69ba72ee3b30fb11de79 [INFO] running `Command { std: "docker" "start" "-a" "d5eb546d6fbff67afc80be39dd6950679529bad5a2fd69ba72ee3b30fb11de79", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "d5eb546d6fbff67afc80be39dd6950679529bad5a2fd69ba72ee3b30fb11de79", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d5eb546d6fbff67afc80be39dd6950679529bad5a2fd69ba72ee3b30fb11de79", kill_on_drop: false }` [INFO] [stdout] d5eb546d6fbff67afc80be39dd6950679529bad5a2fd69ba72ee3b30fb11de79 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-1-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] e8140f5b031ab9e930606279686202f0f3a58b668efe2b5a3e8f0ba3f3331493 [INFO] running `Command { std: "docker" "start" "-a" "e8140f5b031ab9e930606279686202f0f3a58b668efe2b5a3e8f0ba3f3331493", kill_on_drop: false }` [INFO] [stderr] Checking log v0.4.29 [INFO] [stderr] Compiling siphasher v1.0.2 [INFO] [stderr] Checking stable_deref_trait v1.2.1 [INFO] [stderr] Compiling serde_core v1.0.228 [INFO] [stderr] Checking simd-adler32 v0.3.8 [INFO] [stderr] Compiling syn v2.0.117 [INFO] [stderr] Checking parking_lot_core v0.9.12 [INFO] [stderr] Compiling rand v0.8.5 [INFO] [stderr] Compiling zerocopy v0.8.39 [INFO] [stderr] Compiling rustix v1.1.3 [INFO] [stderr] Checking either v1.15.0 [INFO] [stderr] Compiling find-msvc-tools v0.1.9 [INFO] [stderr] Compiling libc v0.2.182 [INFO] [stderr] Checking aho-corasick v1.1.4 [INFO] [stderr] Compiling rustls v0.23.36 [INFO] [stderr] Checking regex-syntax v0.8.9 [INFO] [stderr] Checking mio v1.1.1 [INFO] [stderr] Compiling phf_shared v0.11.3 [INFO] [stderr] Compiling phf_shared v0.13.1 [INFO] [stderr] Checking miniz_oxide v0.8.9 [INFO] [stderr] Compiling cc v1.2.56 [INFO] [stderr] Checking parking_lot v0.12.5 [INFO] [stderr] Checking phf v0.11.3 [INFO] [stderr] Compiling phf_generator v0.11.3 [INFO] [stderr] Checking signal-hook-mio v0.2.5 [INFO] [stderr] Checking brotli v8.0.2 [INFO] [stderr] Checking getrandom v0.3.4 [INFO] [stderr] Compiling unicase v2.9.0 [INFO] [stderr] Checking rayon v1.11.0 [INFO] [stderr] Compiling phf_generator v0.13.1 [INFO] [stderr] Compiling phf_codegen v0.11.3 [INFO] [stderr] Compiling string_cache_codegen v0.5.4 [INFO] [stderr] Compiling mime_guess v2.0.5 [INFO] [stderr] Checking flate2 v1.1.9 [INFO] [stderr] Checking as-slice v0.2.1 [INFO] [stderr] Compiling scopeguard v1.2.0 [INFO] [stderr] Compiling serde_json v1.0.149 [INFO] [stderr] Compiling phf_codegen v0.13.1 [INFO] [stderr] Compiling string_cache_codegen v0.6.1 [INFO] [stderr] Compiling memchr v2.8.0 [INFO] [stderr] Compiling smallvec v1.15.1 [INFO] [stderr] Checking rustls-native-certs v0.8.3 [INFO] [stderr] Compiling lock_api v0.4.14 [INFO] [stderr] Checking aligned v0.4.3 [INFO] [stderr] Checking webpki-roots v1.0.6 [INFO] [stderr] Checking nom v8.0.0 [INFO] [stderr] Compiling markup5ever v0.12.1 [INFO] [stderr] Compiling web_atoms v0.1.3 [INFO] [stderr] Checking core2 v0.4.0 [INFO] [stderr] Compiling linux-raw-sys v0.11.0 [INFO] [stderr] Compiling bitflags v2.11.0 [INFO] [stderr] Compiling portable-atomic v1.13.1 [INFO] [stderr] Compiling web_atoms v0.2.3 [INFO] [stderr] Compiling ring v0.17.14 [INFO] [stderr] Compiling errno v0.3.14 [INFO] [stderr] Compiling signal-hook-registry v1.4.8 [INFO] [stderr] Checking rustix v0.38.44 [INFO] [stderr] Checking regex-automata v0.4.14 [INFO] [stderr] Compiling signal-hook v0.3.18 [INFO] [stderr] Checking bitstream-io v4.9.0 [INFO] [stderr] Checking string_cache v0.9.0 [INFO] [stderr] Checking itertools v0.14.0 [INFO] [stderr] Checking itertools v0.13.0 [INFO] [stderr] Compiling simd_helpers v0.1.0 [INFO] [stderr] Checking minimal-lexical v0.2.1 [INFO] [stderr] Checking dtoa v1.0.11 [INFO] [stderr] Checking zune-core v0.5.1 [INFO] [stderr] Checking dtoa-short v0.3.5 [INFO] [stderr] Checking compact_str v0.8.1 [INFO] [stderr] Checking digest v0.10.7 [INFO] [stderr] Checking zune-jpeg v0.5.12 [INFO] [stderr] Checking nom v7.1.3 [INFO] [stderr] Checking maybe-rayon v0.1.1 [INFO] [stderr] Compiling selectors v0.33.0 [INFO] [stderr] Checking rand_core v0.9.5 [INFO] [stderr] Checking compression-codecs v0.4.37 [INFO] [stderr] Compiling nix v0.30.1 [INFO] [stderr] Checking avif-serialize v0.8.8 [INFO] [stderr] Checking zune-inflate v0.2.54 [INFO] [stderr] Checking fdeflate v0.3.7 [INFO] [stderr] Checking bytemuck v1.25.0 [INFO] [stderr] Checking rgb v0.8.53 [INFO] [stderr] Compiling strict v0.2.0 [INFO] [stderr] Checking pxfm v0.1.28 [INFO] [stderr] Checking regex v1.12.3 [INFO] [stderr] Checking gif v0.14.1 [INFO] [stderr] Checking qoi v0.4.1 [INFO] [stderr] Checking png v0.18.1 [INFO] [stderr] Checking sha2 v0.10.9 [INFO] [stderr] Checking tempfile v3.25.0 [INFO] [stderr] Compiling rust-embed-utils v8.11.0 [INFO] [stderr] Checking xattr v1.6.1 [INFO] [stderr] Compiling nix v0.29.0 [INFO] [stderr] Checking servo_arc v0.4.3 [INFO] [stderr] Checking getopts v0.2.24 [INFO] [stderr] Checking console v0.15.11 [INFO] [stderr] Checking crossbeam-channel v0.5.15 [INFO] [stderr] Checking filetime v0.2.27 [INFO] [stderr] Checking instant v0.1.13 [INFO] [stderr] Checking nibble_vec v0.1.0 [INFO] [stderr] Checking crossterm v0.28.1 [INFO] [stderr] Checking bstr v1.12.1 [INFO] [stderr] Checking futures-timer v3.0.3 [INFO] [stderr] Compiling self_update v0.42.0 [INFO] [stderr] Compiling pulldown-cmark v0.13.1 [INFO] [stderr] Checking indicatif v0.17.11 [INFO] [stderr] Checking radix_trie v0.2.1 [INFO] [stderr] Checking tar v0.4.44 [INFO] [stderr] Checking unicode-truncate v1.1.0 [INFO] [stderr] Compiling synstructure v0.13.2 [INFO] [stderr] Compiling darling_core v0.23.0 [INFO] [stderr] Compiling darling_core v0.20.11 [INFO] [stderr] Checking crossbeam v0.8.4 [INFO] [stderr] Checking globset v0.4.18 [INFO] [stderr] Checking self-replace v1.5.0 [INFO] [stderr] Checking fd-lock v4.0.4 [INFO] [stderr] Checking console v0.16.2 [INFO] [stderr] Checking minimad v0.14.0 [INFO] [stderr] Checking eventsource-stream v0.2.3 [INFO] [stderr] Checking quick-xml v0.37.5 [INFO] [stderr] Checking home v0.5.12 [INFO] [stderr] Checking iana-time-zone v0.1.65 [INFO] [stderr] Checking unit-prefix v0.5.2 [INFO] [stderr] Checking icy_sixel v0.1.3 [INFO] [stderr] Checking chrono v0.4.43 [INFO] [stderr] Checking ignore v0.4.25 [INFO] [stderr] Checking fs2 v0.4.3 [INFO] [stderr] Checking indicatif v0.18.4 [INFO] [stderr] Checking moxcms v0.8.1 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Compiling zerofrom-derive v0.1.6 [INFO] [stderr] Compiling yoke-derive v0.8.1 [INFO] [stderr] Compiling tokio-macros v2.6.0 [INFO] [stderr] Compiling zerovec-derive v0.11.2 [INFO] [stderr] Compiling displaydoc v0.2.5 [INFO] [stderr] Compiling futures-macro v0.3.32 [INFO] [stderr] Compiling zerocopy-derive v0.8.39 [INFO] [stderr] Compiling derive_more-impl v2.1.1 [INFO] [stderr] Compiling tracing-attributes v0.1.31 [INFO] [stderr] Compiling thiserror-impl v2.0.18 [INFO] [stderr] Compiling equator-macro v0.4.2 [INFO] [stderr] Checking rustls-webpki v0.103.9 [INFO] [stderr] Checking tokio v1.49.0 [INFO] [stderr] Checking futures-util v0.3.32 [INFO] [stderr] Compiling phf_macros v0.13.1 [INFO] [stderr] Checking equator v0.4.2 [INFO] [stderr] Compiling profiling-procmacros v1.0.17 [INFO] [stderr] Compiling arg_enum_proc_macro v0.3.4 [INFO] [stderr] Checking aligned-vec v0.6.4 [INFO] [stderr] Checking derive_more v2.1.1 [INFO] [stderr] Checking tracing v0.1.44 [INFO] [stderr] Checking phf v0.13.1 [INFO] [stderr] Checking v_frame v0.3.9 [INFO] [stderr] Compiling num-derive v0.4.2 [INFO] [stderr] Compiling fax_derive v0.2.0 [INFO] [stderr] Checking av1-grain v0.2.5 [INFO] [stderr] Compiling strum_macros v0.26.4 [INFO] [stderr] Compiling html5ever v0.27.0 [INFO] [stderr] Checking zerofrom v0.1.6 [INFO] [stderr] Compiling darling_macro v0.20.11 [INFO] [stderr] Checking profiling v1.0.17 [INFO] [stderr] Compiling thiserror-impl v1.0.69 [INFO] [stderr] Checking yoke v0.8.1 [INFO] [stderr] Checking fax v0.2.6 [INFO] [stderr] Checking zerovec v0.11.5 [INFO] [stderr] Checking zerotrie v0.2.3 [INFO] [stderr] Compiling darling v0.20.11 [INFO] [stderr] Compiling derive_builder_core v0.20.2 [INFO] [stderr] Checking thiserror v2.0.18 [INFO] [stderr] Compiling crossterm v0.29.0 [INFO] [stderr] Checking av-scenechange v0.14.1 [INFO] [stderr] Compiling darling_macro v0.23.0 [INFO] [stderr] Checking tinystr v0.8.2 [INFO] [stderr] Checking potential_utf v0.1.4 [INFO] [stderr] Checking icu_locale_core v2.1.1 [INFO] [stderr] Compiling darling v0.23.0 [INFO] [stderr] Checking rav1e v0.8.1 [INFO] [stderr] Checking icu_collections v2.1.1 [INFO] [stderr] Compiling cssparser-macros v0.6.1 [INFO] [stderr] Compiling instability v0.3.11 [INFO] [stderr] Checking markup5ever v0.36.1 [INFO] [stderr] Compiling lazy-regex-proc_macros v3.6.0 [INFO] [stderr] Compiling match_token v0.1.0 [INFO] [stderr] Checking html5ever v0.36.1 [INFO] [stderr] Checking coolor v1.1.0 [INFO] [stderr] Checking futures-executor v0.3.32 [INFO] [stderr] Checking cssparser v0.36.0 [INFO] [stderr] Compiling derive_builder_macro v0.20.2 [INFO] [stderr] Compiling clap_derive v4.5.55 [INFO] [stderr] Checking thiserror v1.0.69 [INFO] [stderr] Compiling async-openai-macros v0.1.1 [INFO] [stderr] Checking futures v0.3.32 [INFO] [stderr] Checking derive_builder v0.20.2 [INFO] [stderr] Compiling rust-embed-impl v8.11.0 [INFO] [stderr] Checking rustyline v17.0.2 [INFO] [stderr] Checking strum v0.26.3 [INFO] [stderr] Checking lazy-regex v3.6.0 [INFO] [stderr] Compiling crokey-proc_macros v1.4.0 [INFO] [stderr] Checking icu_provider v2.1.1 [INFO] [stderr] Checking ratatui v0.29.0 [INFO] [stderr] Checking serde v1.0.228 [INFO] [stderr] Checking icu_normalizer v2.1.1 [INFO] [stderr] Checking icu_properties v2.1.2 [INFO] [stderr] Checking rust-embed v8.11.0 [INFO] [stderr] Checking string_cache v0.8.9 [INFO] [stderr] Checking serde_urlencoded v0.7.1 [INFO] [stderr] Checking crokey v1.4.0 [INFO] [stderr] Checking secrecy v0.10.3 [INFO] [stderr] Checking serde_yaml v0.9.34+deprecated [INFO] [stderr] Checking termimad v0.34.1 [INFO] [stderr] Checking scraper v0.25.0 [INFO] [stderr] Checking clap v4.5.60 [INFO] [stderr] Checking idna_adapter v1.2.1 [INFO] [stderr] Checking idna v1.1.0 [INFO] [stderr] Checking xml5ever v0.18.1 [INFO] [stderr] Checking markup5ever v0.16.2 [INFO] [stderr] Checking url v2.5.8 [INFO] [stderr] Checking html5ever v0.31.0 [INFO] [stderr] Checking tui-textarea v0.7.0 (/opt/rustwide/workdir/patches/tui-textarea-0.7.0) [INFO] [stderr] Checking tokio-util v0.7.18 [INFO] [stderr] Checking async-compression v0.4.41 [INFO] [stderr] Checking tokio-rustls v0.26.4 [INFO] [stderr] Checking tower v0.5.3 [INFO] [stderr] Checking tokio-stream v0.1.18 [INFO] [stderr] Checking ppv-lite86 v0.2.21 [INFO] [stderr] Checking half v2.7.1 [INFO] [stderr] Checking markup5ever_rcdom v0.3.0 [INFO] [stderr] Checking html2text v0.14.4 [INFO] [stderr] Checking html2md v0.2.15 [INFO] [stderr] Checking exr v1.74.0 [INFO] [stderr] Checking tiff v0.11.3 [INFO] [stderr] Checking rand_chacha v0.3.1 [INFO] [stderr] Checking rand_chacha v0.9.0 [INFO] [stderr] Checking rand v0.9.2 [INFO] [stderr] Checking h2 v0.4.13 [INFO] [stderr] Checking tower-http v0.6.8 [INFO] [stderr] Checking backoff v0.4.0 [INFO] [stderr] Checking ravif v0.13.0 [INFO] [stderr] Checking image v0.25.10 [INFO] [stderr] Checking hyper v1.8.1 [INFO] [stderr] Checking hyper-util v0.1.20 [INFO] [stderr] Checking hyper-rustls v0.27.7 [INFO] [stderr] Checking reqwest v0.12.28 [INFO] [stderr] Checking ratatui-image v8.1.1 [INFO] [stderr] Checking reqwest-eventsource v0.6.0 [INFO] [stderr] Checking async-openai v0.33.0 [INFO] [stderr] Checking j-cli v12.6.13 (/opt/rustwide/workdir) [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/app.rs:648:17 [INFO] [stdout] | [INFO] [stdout] 648 | / if let ToolExecStatus::Failed(ref msg) = tc.status { [INFO] [stdout] 649 | | if let Some(ref tx) = self.tool_result_tx { [INFO] [stdout] 650 | | let _ = tx.send(ToolResultMsg { [INFO] [stdout] 651 | | tool_call_id: tc.tool_call_id.clone(), [INFO] [stdout] ... | [INFO] [stdout] 656 | | } [INFO] [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] 648 ~ if let ToolExecStatus::Failed(ref msg) = tc.status [INFO] [stdout] 649 ~ && let Some(ref tx) = self.tool_result_tx { [INFO] [stdout] 650 | let _ = tx.send(ToolResultMsg { [INFO] [stdout] ... [INFO] [stdout] 654 | }); [INFO] [stdout] 655 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/archive.rs:33:17 [INFO] [stdout] | [INFO] [stdout] 33 | / if app.archive_edit_cursor > 0 { [INFO] [stdout] 34 | | let chars: Vec = app.archive_custom_name.chars().collect(); [INFO] [stdout] 35 | | app.archive_custom_name = chars[..app.archive_edit_cursor - 1] [INFO] [stdout] 36 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 39 | | app.archive_edit_cursor -= 1; [INFO] [stdout] 40 | | } [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] 32 ~ KeyCode::Backspace [INFO] [stdout] 33 ~ if app.archive_edit_cursor > 0 => { [INFO] [stdout] 34 | let chars: Vec = app.archive_custom_name.chars().collect(); [INFO] [stdout] ... [INFO] [stdout] 39 | app.archive_edit_cursor -= 1; [INFO] [stdout] 40 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/archive.rs:116:13 [INFO] [stdout] | [INFO] [stdout] 116 | / if count > 0 { [INFO] [stdout] 117 | | app.archive_list_index = if app.archive_list_index == 0 { [INFO] [stdout] 118 | | count - 1 [INFO] [stdout] 119 | | } else { [INFO] [stdout] 120 | | app.archive_list_index - 1 [INFO] [stdout] 121 | | }; [INFO] [stdout] 122 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 115 ~ KeyCode::Up | KeyCode::Char('k') [INFO] [stdout] 116 ~ if count > 0 => { [INFO] [stdout] 117 | app.archive_list_index = if app.archive_list_index == 0 { [INFO] [stdout] ... [INFO] [stdout] 121 | }; [INFO] [stdout] 122 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/archive.rs:125:13 [INFO] [stdout] | [INFO] [stdout] 125 | / if count > 0 { [INFO] [stdout] 126 | | app.archive_list_index = if app.archive_list_index >= count - 1 { [INFO] [stdout] 127 | | 0 [INFO] [stdout] 128 | | } else { [INFO] [stdout] 129 | | app.archive_list_index + 1 [INFO] [stdout] 130 | | }; [INFO] [stdout] 131 | | } [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] 124 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 125 ~ if count > 0 => { [INFO] [stdout] 126 | app.archive_list_index = if app.archive_list_index >= count - 1 { [INFO] [stdout] ... [INFO] [stdout] 130 | }; [INFO] [stdout] 131 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/archive.rs:134:13 [INFO] [stdout] | [INFO] [stdout] 134 | / if count > 0 { [INFO] [stdout] 135 | | // 如果当前会话有消息,需要确认 [INFO] [stdout] 136 | | if !app.session.messages.is_empty() { [INFO] [stdout] 137 | | app.restore_confirm_needed = true; [INFO] [stdout] ... | [INFO] [stdout] 141 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 133 ~ KeyCode::Enter [INFO] [stdout] 134 ~ if count > 0 => { [INFO] [stdout] 135 | // 如果当前会话有消息,需要确认 [INFO] [stdout] ... [INFO] [stdout] 140 | } [INFO] [stdout] 141 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/archive.rs:145:13 [INFO] [stdout] | [INFO] [stdout] 145 | / if count > 0 { [INFO] [stdout] 146 | | app.do_delete_archive(); [INFO] [stdout] 147 | | } [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] 143 ~ KeyCode::Char('d') | KeyCode::Char('D') [INFO] [stdout] 144 | // 删除选中的归档 [INFO] [stdout] 145 ~ if count > 0 => { [INFO] [stdout] 146 | app.do_delete_archive(); [INFO] [stdout] 147 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/browse.rs:20:13 [INFO] [stdout] | [INFO] [stdout] 20 | / if app.browse_msg_index > 0 { [INFO] [stdout] 21 | | app.browse_msg_index -= 1; [INFO] [stdout] 22 | | app.browse_scroll_offset = 0; // 切换消息时从头显示 [INFO] [stdout] 23 | | app.msg_lines_cache = None; // 选中变化时清缓存 [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 19 ~ KeyCode::Up | KeyCode::Char('k') [INFO] [stdout] 20 ~ if app.browse_msg_index > 0 => { [INFO] [stdout] 21 | app.browse_msg_index -= 1; [INFO] [stdout] 22 | app.browse_scroll_offset = 0; // 切换消息时从头显示 [INFO] [stdout] 23 | app.msg_lines_cache = None; // 选中变化时清缓存 [INFO] [stdout] 24 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/browse.rs:27:13 [INFO] [stdout] | [INFO] [stdout] 27 | / if app.browse_msg_index < msg_count - 1 { [INFO] [stdout] 28 | | app.browse_msg_index += 1; [INFO] [stdout] 29 | | app.browse_scroll_offset = 0; // 切换消息时从头显示 [INFO] [stdout] 30 | | app.msg_lines_cache = None; // 选中变化时清缓存 [INFO] [stdout] 31 | | } [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] 26 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 27 ~ if app.browse_msg_index < msg_count - 1 => { [INFO] [stdout] 28 | app.browse_msg_index += 1; [INFO] [stdout] 29 | app.browse_scroll_offset = 0; // 切换消息时从头显示 [INFO] [stdout] 30 | app.msg_lines_cache = None; // 选中变化时清缓存 [INFO] [stdout] 31 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/chat.rs:388:13 [INFO] [stdout] | [INFO] [stdout] 388 | / if app.cursor_pos > 0 { [INFO] [stdout] 389 | | app.cursor_pos -= 1; [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 387 ~ KeyCode::Left [INFO] [stdout] 388 ~ if app.cursor_pos > 0 => { [INFO] [stdout] 389 | app.cursor_pos -= 1; [INFO] [stdout] 390 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/chat.rs:393:13 [INFO] [stdout] | [INFO] [stdout] 393 | / if app.cursor_pos < char_count { [INFO] [stdout] 394 | | app.cursor_pos += 1; [INFO] [stdout] 395 | | } [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] 392 ~ KeyCode::Right [INFO] [stdout] 393 ~ if app.cursor_pos < char_count => { [INFO] [stdout] 394 | app.cursor_pos += 1; [INFO] [stdout] 395 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/chat.rs:402:13 [INFO] [stdout] | [INFO] [stdout] 402 | / if app.cursor_pos > 0 { [INFO] [stdout] 403 | | let start = app [INFO] [stdout] 404 | | .input [INFO] [stdout] 405 | | .char_indices() [INFO] [stdout] ... | [INFO] [stdout] 416 | | app.cursor_pos -= 1; [INFO] [stdout] 417 | | } [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] 401 ~ KeyCode::Backspace [INFO] [stdout] 402 ~ if app.cursor_pos > 0 => { [INFO] [stdout] 403 | let start = app [INFO] [stdout] ... [INFO] [stdout] 416 | app.cursor_pos -= 1; [INFO] [stdout] 417 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/chat.rs:420:13 [INFO] [stdout] | [INFO] [stdout] 420 | / if app.cursor_pos < char_count { [INFO] [stdout] 421 | | let start = app [INFO] [stdout] 422 | | .input [INFO] [stdout] 423 | | .char_indices() [INFO] [stdout] ... | [INFO] [stdout] 433 | | app.input.drain(start..end); [INFO] [stdout] 434 | | } [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] 419 ~ KeyCode::Delete [INFO] [stdout] 420 ~ if app.cursor_pos < char_count => { [INFO] [stdout] 421 | let start = app [INFO] [stdout] ... [INFO] [stdout] 433 | app.input.drain(start..end); [INFO] [stdout] 434 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/config.rs:27:17 [INFO] [stdout] | [INFO] [stdout] 27 | / if app.config_edit_cursor > 0 { [INFO] [stdout] 28 | | let idx = app [INFO] [stdout] 29 | | .config_edit_buf [INFO] [stdout] 30 | | .char_indices() [INFO] [stdout] ... | [INFO] [stdout] 45 | | app.config_edit_cursor -= 1; [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 26 ~ KeyCode::Backspace [INFO] [stdout] 27 ~ if app.config_edit_cursor > 0 => { [INFO] [stdout] 28 | let idx = app [INFO] [stdout] ... [INFO] [stdout] 45 | app.config_edit_cursor -= 1; [INFO] [stdout] 46 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/config.rs:79:13 [INFO] [stdout] | [INFO] [stdout] 79 | / if app.config_field_idx > 0 { [INFO] [stdout] 80 | | app.config_field_idx -= 1; [INFO] [stdout] 81 | | } [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] 78 ~ KeyCode::Up | KeyCode::Char('k') [INFO] [stdout] 79 ~ if app.config_field_idx > 0 => { [INFO] [stdout] 80 | app.config_field_idx -= 1; [INFO] [stdout] 81 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/config.rs:84:13 [INFO] [stdout] | [INFO] [stdout] 84 | / if app.config_field_idx < total_fields - 1 { [INFO] [stdout] 85 | | app.config_field_idx += 1; [INFO] [stdout] 86 | | } [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] 83 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 84 ~ if app.config_field_idx < total_fields - 1 => { [INFO] [stdout] 85 | app.config_field_idx += 1; [INFO] [stdout] 86 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/config.rs:193:13 [INFO] [stdout] | [INFO] [stdout] 193 | / if !app.agent_config.providers.is_empty() { [INFO] [stdout] 194 | | app.agent_config.active_index = app.config_provider_idx; [INFO] [stdout] 195 | | let name = app.agent_config.providers[app.config_provider_idx] [INFO] [stdout] 196 | | .name [INFO] [stdout] 197 | | .clone(); [INFO] [stdout] 198 | | app.show_toast(format!("已设为活跃模型: {}", name), false); [INFO] [stdout] 199 | | } [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] 191 ~ KeyCode::Char('s') [INFO] [stdout] 192 | // 将当前 provider 设为活跃 [INFO] [stdout] 193 ~ if !app.agent_config.providers.is_empty() => { [INFO] [stdout] 194 | app.agent_config.active_index = app.config_provider_idx; [INFO] [stdout] ... [INFO] [stdout] 198 | app.show_toast(format!("已设为活跃模型: {}", name), false); [INFO] [stdout] 199 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/config.rs:330:13 [INFO] [stdout] | [INFO] [stdout] 330 | / if count > 0 { [INFO] [stdout] 331 | | let i = app [INFO] [stdout] 332 | | .model_list_state [INFO] [stdout] 333 | | .selected() [INFO] [stdout] ... | [INFO] [stdout] 336 | | app.model_list_state.select(Some(i)); [INFO] [stdout] 337 | | } [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] 329 ~ KeyCode::Up | KeyCode::Char('k') [INFO] [stdout] 330 ~ if count > 0 => { [INFO] [stdout] 331 | let i = app [INFO] [stdout] ... [INFO] [stdout] 336 | app.model_list_state.select(Some(i)); [INFO] [stdout] 337 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/config.rs:340:13 [INFO] [stdout] | [INFO] [stdout] 340 | / if count > 0 { [INFO] [stdout] 341 | | let i = app [INFO] [stdout] 342 | | .model_list_state [INFO] [stdout] 343 | | .selected() [INFO] [stdout] ... | [INFO] [stdout] 346 | | app.model_list_state.select(Some(i)); [INFO] [stdout] 347 | | } [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] 339 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 340 ~ if count > 0 => { [INFO] [stdout] 341 | let i = app [INFO] [stdout] ... [INFO] [stdout] 346 | app.model_list_state.select(Some(i)); [INFO] [stdout] 347 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:29:17 [INFO] [stdout] | [INFO] [stdout] 29 | / if app.tool_interact_cursor > 0 { [INFO] [stdout] 30 | | let start = app [INFO] [stdout] 31 | | .tool_interact_input [INFO] [stdout] 32 | | .char_indices() [INFO] [stdout] ... | [INFO] [stdout] 43 | | app.tool_interact_cursor -= 1; [INFO] [stdout] 44 | | } [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] 28 ~ KeyCode::Backspace [INFO] [stdout] 29 ~ if app.tool_interact_cursor > 0 => { [INFO] [stdout] 30 | let start = app [INFO] [stdout] ... [INFO] [stdout] 43 | app.tool_interact_cursor -= 1; [INFO] [stdout] 44 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:47:17 [INFO] [stdout] | [INFO] [stdout] 47 | / if app.tool_interact_cursor > 0 { [INFO] [stdout] 48 | | app.tool_interact_cursor -= 1; [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 46 ~ KeyCode::Left [INFO] [stdout] 47 ~ if app.tool_interact_cursor > 0 => { [INFO] [stdout] 48 | app.tool_interact_cursor -= 1; [INFO] [stdout] 49 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:76:13 [INFO] [stdout] | [INFO] [stdout] 76 | / if app.tool_interact_selected > 0 { [INFO] [stdout] 77 | | app.tool_interact_selected -= 1; [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 75 ~ KeyCode::Up [INFO] [stdout] 76 ~ if app.tool_interact_selected > 0 => { [INFO] [stdout] 77 | app.tool_interact_selected -= 1; [INFO] [stdout] 78 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:81:13 [INFO] [stdout] | [INFO] [stdout] 81 | / if app.tool_interact_selected < 3 { [INFO] [stdout] 82 | | app.tool_interact_selected += 1; [INFO] [stdout] 83 | | } [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] 80 ~ KeyCode::Down [INFO] [stdout] 81 ~ if app.tool_interact_selected < 3 => { [INFO] [stdout] 82 | app.tool_interact_selected += 1; [INFO] [stdout] 83 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:132:17 [INFO] [stdout] | [INFO] [stdout] 132 | / if app.tool_interact_cursor > 0 { [INFO] [stdout] 133 | | let start = app [INFO] [stdout] 134 | | .tool_interact_input [INFO] [stdout] 135 | | .char_indices() [INFO] [stdout] ... | [INFO] [stdout] 146 | | app.tool_interact_cursor -= 1; [INFO] [stdout] 147 | | } [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] 131 ~ KeyCode::Backspace [INFO] [stdout] 132 ~ if app.tool_interact_cursor > 0 => { [INFO] [stdout] 133 | let start = app [INFO] [stdout] ... [INFO] [stdout] 146 | app.tool_interact_cursor -= 1; [INFO] [stdout] 147 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:150:17 [INFO] [stdout] | [INFO] [stdout] 150 | / if app.tool_interact_cursor > 0 { [INFO] [stdout] 151 | | app.tool_interact_cursor -= 1; [INFO] [stdout] 152 | | } [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] 149 ~ KeyCode::Left [INFO] [stdout] 150 ~ if app.tool_interact_cursor > 0 => { [INFO] [stdout] 151 | app.tool_interact_cursor -= 1; [INFO] [stdout] 152 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:181:13 [INFO] [stdout] | [INFO] [stdout] 181 | / if app.tool_ask_cursor > 0 { [INFO] [stdout] 182 | | app.tool_ask_cursor -= 1; [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 180 ~ KeyCode::Up [INFO] [stdout] 181 ~ if app.tool_ask_cursor > 0 => { [INFO] [stdout] 182 | app.tool_ask_cursor -= 1; [INFO] [stdout] 183 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:186:13 [INFO] [stdout] | [INFO] [stdout] 186 | / if app.tool_ask_cursor < option_count - 1 { [INFO] [stdout] 187 | | app.tool_ask_cursor += 1; [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 185 ~ KeyCode::Down [INFO] [stdout] 186 ~ if app.tool_ask_cursor < option_count - 1 => { [INFO] [stdout] 187 | app.tool_ask_cursor += 1; [INFO] [stdout] 188 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:192:13 [INFO] [stdout] | [INFO] [stdout] 192 | / if app.tool_ask_cursor < cur_q.options.len() { [INFO] [stdout] 193 | | let idx = app.tool_ask_cursor; [INFO] [stdout] 194 | | if idx < app.tool_ask_selections.len() { [INFO] [stdout] 195 | | app.tool_ask_selections[idx] = !app.tool_ask_selections[idx]; [INFO] [stdout] 196 | | } [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 190 ~ KeyCode::Char(' ') if is_multi [INFO] [stdout] 191 | // 多选 toggle(不对"自由输入"选项 toggle) [INFO] [stdout] 192 ~ && app.tool_ask_cursor < cur_q.options.len() => { [INFO] [stdout] 193 | let idx = app.tool_ask_cursor; [INFO] [stdout] ... [INFO] [stdout] 196 | } [INFO] [stdout] 197 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:228:13 [INFO] [stdout] | [INFO] [stdout] 228 | / if app.tool_ask_current_idx > 0 { [INFO] [stdout] 229 | | app.tool_ask_current_idx -= 1; [INFO] [stdout] 230 | | // 恢复上一题的状态 [INFO] [stdout] 231 | | if app.tool_ask_answers.len() > app.tool_ask_current_idx { [INFO] [stdout] ... | [INFO] [stdout] 234 | | app.init_ask_question_state(); [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 227 ~ KeyCode::Left | KeyCode::BackTab [INFO] [stdout] 228 ~ if app.tool_ask_current_idx > 0 => { [INFO] [stdout] 229 | app.tool_ask_current_idx -= 1; [INFO] [stdout] ... [INFO] [stdout] 234 | app.init_ask_question_state(); [INFO] [stdout] 235 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:239:13 [INFO] [stdout] | [INFO] [stdout] 239 | / if app.tool_ask_current_idx < total_questions - 1 [INFO] [stdout] 240 | | && app.tool_ask_current_idx < app.tool_ask_answers.len() [INFO] [stdout] 241 | | { [INFO] [stdout] 242 | | app.tool_ask_current_idx += 1; [INFO] [stdout] 243 | | app.init_ask_question_state(); [INFO] [stdout] 244 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 238 ~ KeyCode::Right | KeyCode::Tab [INFO] [stdout] 239 | if app.tool_ask_current_idx < total_questions - 1 [INFO] [stdout] 240 | && app.tool_ask_current_idx < app.tool_ask_answers.len() [INFO] [stdout] 241 ~ => { [INFO] [stdout] 242 | app.tool_ask_current_idx += 1; [INFO] [stdout] 243 | app.init_ask_question_state(); [INFO] [stdout] 244 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/markdown/parser.rs:271:17 [INFO] [stdout] | [INFO] [stdout] 271 | / if !lines.is_empty() && !in_code_block && heading_level.is_none() { [INFO] [stdout] 272 | | let last_empty = lines.last().map(|l| l.spans.is_empty()).unwrap_or(false); [INFO] [stdout] 273 | | if !last_empty { [INFO] [stdout] 274 | | lines.push(Line::from("")); [INFO] [stdout] 275 | | } [INFO] [stdout] 276 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 270 ~ Event::Start(Tag::Paragraph) [INFO] [stdout] 271 ~ if !lines.is_empty() && !in_code_block && heading_level.is_none() => { [INFO] [stdout] 272 | let last_empty = lines.last().map(|l| l.spans.is_empty()).unwrap_or(false); [INFO] [stdout] ... [INFO] [stdout] 275 | } [INFO] [stdout] 276 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/command/chat/permission.rs:31:32 [INFO] [stdout] | [INFO] [stdout] 31 | Ok(content) => match serde_yaml::from_str::(&content) { [INFO] [stdout] | ________________________________^ [INFO] [stdout] 32 | | Ok(config) => config, [INFO] [stdout] 33 | | Err(_) => Self::default(), [INFO] [stdout] 34 | | }, [INFO] [stdout] | |_________________^ help: replace it with: `serde_yaml::from_str::(&content).unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/command/chat/permission.rs:213:20 [INFO] [stdout] | [INFO] [stdout] 213 | let rest = &command[prefix.len()..]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/command/chat/permission.rs:212:5 [INFO] [stdout] | [INFO] [stdout] 212 | if command.starts_with(prefix) { [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] 212 ~ if let Some(rest) = command.strip_prefix(prefix) { [INFO] [stdout] 213 ~ return rest.starts_with(' ') || rest.starts_with('\t'); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `m.tool_calls` after checking its variant with `is_some` [INFO] [stdout] --> src/command/chat/render.rs:130:25 [INFO] [stdout] | [INFO] [stdout] 128 | if m.tool_calls.is_some() { [INFO] [stdout] | ------------------------- help: try: `if let Some() = &m.tool_calls` [INFO] [stdout] 129 | render_tool_call_request_msg( [INFO] [stdout] 130 | m.tool_calls.as_ref().unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/render.rs:92:9 [INFO] [stdout] | [INFO] [stdout] 92 | / if can_reuse_per_msg { [INFO] [stdout] 93 | | if let Some(old_c) = old_cache { [INFO] [stdout] 94 | | if let Some(old_per) = old_c.per_msg_lines.get(idx) { [INFO] [stdout] 95 | | if old_per.msg_index == idx [INFO] [stdout] ... | [INFO] [stdout] 112 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information 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 can_reuse_per_msg [INFO] [stdout] 93 ~ && let Some(old_c) = old_cache { [INFO] [stdout] 94 | if let Some(old_per) = old_c.per_msg_lines.get(idx) { [INFO] [stdout] ... [INFO] [stdout] 110 | } [INFO] [stdout] 111 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/render.rs:93:13 [INFO] [stdout] | [INFO] [stdout] 93 | / if let Some(old_c) = old_cache { [INFO] [stdout] 94 | | if let Some(old_per) = old_c.per_msg_lines.get(idx) { [INFO] [stdout] 95 | | if old_per.msg_index == idx [INFO] [stdout] 96 | | && old_per.content_len == m.content.len() [INFO] [stdout] ... | [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 93 ~ if let Some(old_c) = old_cache [INFO] [stdout] 94 ~ && let Some(old_per) = old_c.per_msg_lines.get(idx) { [INFO] [stdout] 95 | if old_per.msg_index == idx [INFO] [stdout] ... [INFO] [stdout] 109 | } [INFO] [stdout] 110 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/render.rs:94:17 [INFO] [stdout] | [INFO] [stdout] 94 | / if let Some(old_per) = old_c.per_msg_lines.get(idx) { [INFO] [stdout] 95 | | if old_per.msg_index == idx [INFO] [stdout] 96 | | && old_per.content_len == m.content.len() [INFO] [stdout] 97 | | && old_per.is_selected == is_selected [INFO] [stdout] ... | [INFO] [stdout] 110 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 94 ~ if let Some(old_per) = old_c.per_msg_lines.get(idx) [INFO] [stdout] 95 ~ && old_per.msg_index == idx [INFO] [stdout] 96 | && old_per.content_len == m.content.len() [INFO] [stdout] ... [INFO] [stdout] 108 | continue; [INFO] [stdout] 109 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/tools/task.rs:48:17 [INFO] [stdout] | [INFO] [stdout] 48 | / if let Some(rest) = name.strip_prefix("task_") { [INFO] [stdout] 49 | | if let Some(id_str) = rest.strip_suffix(".json") { [INFO] [stdout] 50 | | if let Ok(id) = id_str.parse::() { [INFO] [stdout] 51 | | max_id = max_id.max(id); [INFO] [stdout] ... | [INFO] [stdout] 54 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 48 ~ if let Some(rest) = name.strip_prefix("task_") [INFO] [stdout] 49 ~ && let Some(id_str) = rest.strip_suffix(".json") { [INFO] [stdout] 50 | if let Ok(id) = id_str.parse::() { [INFO] [stdout] 51 | max_id = max_id.max(id); [INFO] [stdout] 52 | } [INFO] [stdout] 53 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/tools/task.rs:49:21 [INFO] [stdout] | [INFO] [stdout] 49 | / if let Some(id_str) = rest.strip_suffix(".json") { [INFO] [stdout] 50 | | if let Ok(id) = id_str.parse::() { [INFO] [stdout] 51 | | max_id = max_id.max(id); [INFO] [stdout] 52 | | } [INFO] [stdout] 53 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information 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(id_str) = rest.strip_suffix(".json") [INFO] [stdout] 50 ~ && let Ok(id) = id_str.parse::() { [INFO] [stdout] 51 | max_id = max_id.max(id); [INFO] [stdout] 52 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/tools/task.rs:93:17 [INFO] [stdout] | [INFO] [stdout] 93 | / if path.extension().is_some_and(|e| e == "json") { [INFO] [stdout] 94 | | if let Ok(data) = fs::read_to_string(&path) { [INFO] [stdout] 95 | | if let Ok(task) = serde_json::from_str::(&data) { [INFO] [stdout] 96 | | tasks.push(task); [INFO] [stdout] ... | [INFO] [stdout] 99 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 93 ~ if path.extension().is_some_and(|e| e == "json") [INFO] [stdout] 94 ~ && let Ok(data) = fs::read_to_string(&path) { [INFO] [stdout] 95 | if let Ok(task) = serde_json::from_str::(&data) { [INFO] [stdout] 96 | tasks.push(task); [INFO] [stdout] 97 | } [INFO] [stdout] 98 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/tools/task.rs:94:21 [INFO] [stdout] | [INFO] [stdout] 94 | / if let Ok(data) = fs::read_to_string(&path) { [INFO] [stdout] 95 | | if let Ok(task) = serde_json::from_str::(&data) { [INFO] [stdout] 96 | | tasks.push(task); [INFO] [stdout] 97 | | } [INFO] [stdout] 98 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 94 ~ if let Ok(data) = fs::read_to_string(&path) [INFO] [stdout] 95 ~ && let Ok(task) = serde_json::from_str::(&data) { [INFO] [stdout] 96 | tasks.push(task); [INFO] [stdout] 97 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/tools/task.rs:144:17 [INFO] [stdout] | [INFO] [stdout] 144 | / if let Some(dep_id) = id_val.as_u64() { [INFO] [stdout] 145 | | if !task.blocked_by.contains(&dep_id) { [INFO] [stdout] 146 | | task.blocked_by.push(dep_id); [INFO] [stdout] 147 | | } [INFO] [stdout] 148 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 144 ~ if let Some(dep_id) = id_val.as_u64() [INFO] [stdout] 145 ~ && !task.blocked_by.contains(&dep_id) { [INFO] [stdout] 146 | task.blocked_by.push(dep_id); [INFO] [stdout] 147 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/tools/task.rs:158:21 [INFO] [stdout] | [INFO] [stdout] 158 | / if let Ok(mut target) = self.get_task(dep_id) { [INFO] [stdout] 159 | | if !target.blocked_by.contains(&id) { [INFO] [stdout] 160 | | target.blocked_by.push(id); [INFO] [stdout] 161 | | let _ = self.save_task(&target); [INFO] [stdout] 162 | | } [INFO] [stdout] 163 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 158 ~ if let Ok(mut target) = self.get_task(dep_id) [INFO] [stdout] 159 ~ && !target.blocked_by.contains(&id) { [INFO] [stdout] 160 | target.blocked_by.push(id); [INFO] [stdout] 161 | let _ = self.save_task(&target); [INFO] [stdout] 162 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/app.rs:648:17 [INFO] [stdout] | [INFO] [stdout] 648 | / if let ToolExecStatus::Failed(ref msg) = tc.status { [INFO] [stdout] 649 | | if let Some(ref tx) = self.tool_result_tx { [INFO] [stdout] 650 | | let _ = tx.send(ToolResultMsg { [INFO] [stdout] 651 | | tool_call_id: tc.tool_call_id.clone(), [INFO] [stdout] ... | [INFO] [stdout] 656 | | } [INFO] [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] 648 ~ if let ToolExecStatus::Failed(ref msg) = tc.status [INFO] [stdout] 649 ~ && let Some(ref tx) = self.tool_result_tx { [INFO] [stdout] 650 | let _ = tx.send(ToolResultMsg { [INFO] [stdout] ... [INFO] [stdout] 654 | }); [INFO] [stdout] 655 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/archive.rs:33:17 [INFO] [stdout] | [INFO] [stdout] 33 | / if app.archive_edit_cursor > 0 { [INFO] [stdout] 34 | | let chars: Vec = app.archive_custom_name.chars().collect(); [INFO] [stdout] 35 | | app.archive_custom_name = chars[..app.archive_edit_cursor - 1] [INFO] [stdout] 36 | | .iter() [INFO] [stdout] ... | [INFO] [stdout] 39 | | app.archive_edit_cursor -= 1; [INFO] [stdout] 40 | | } [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] 32 ~ KeyCode::Backspace [INFO] [stdout] 33 ~ if app.archive_edit_cursor > 0 => { [INFO] [stdout] 34 | let chars: Vec = app.archive_custom_name.chars().collect(); [INFO] [stdout] ... [INFO] [stdout] 39 | app.archive_edit_cursor -= 1; [INFO] [stdout] 40 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/archive.rs:116:13 [INFO] [stdout] | [INFO] [stdout] 116 | / if count > 0 { [INFO] [stdout] 117 | | app.archive_list_index = if app.archive_list_index == 0 { [INFO] [stdout] 118 | | count - 1 [INFO] [stdout] 119 | | } else { [INFO] [stdout] 120 | | app.archive_list_index - 1 [INFO] [stdout] 121 | | }; [INFO] [stdout] 122 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 115 ~ KeyCode::Up | KeyCode::Char('k') [INFO] [stdout] 116 ~ if count > 0 => { [INFO] [stdout] 117 | app.archive_list_index = if app.archive_list_index == 0 { [INFO] [stdout] ... [INFO] [stdout] 121 | }; [INFO] [stdout] 122 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/archive.rs:125:13 [INFO] [stdout] | [INFO] [stdout] 125 | / if count > 0 { [INFO] [stdout] 126 | | app.archive_list_index = if app.archive_list_index >= count - 1 { [INFO] [stdout] 127 | | 0 [INFO] [stdout] 128 | | } else { [INFO] [stdout] 129 | | app.archive_list_index + 1 [INFO] [stdout] 130 | | }; [INFO] [stdout] 131 | | } [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] 124 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 125 ~ if count > 0 => { [INFO] [stdout] 126 | app.archive_list_index = if app.archive_list_index >= count - 1 { [INFO] [stdout] ... [INFO] [stdout] 130 | }; [INFO] [stdout] 131 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/archive.rs:134:13 [INFO] [stdout] | [INFO] [stdout] 134 | / if count > 0 { [INFO] [stdout] 135 | | // 如果当前会话有消息,需要确认 [INFO] [stdout] 136 | | if !app.session.messages.is_empty() { [INFO] [stdout] 137 | | app.restore_confirm_needed = true; [INFO] [stdout] ... | [INFO] [stdout] 141 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 133 ~ KeyCode::Enter [INFO] [stdout] 134 ~ if count > 0 => { [INFO] [stdout] 135 | // 如果当前会话有消息,需要确认 [INFO] [stdout] ... [INFO] [stdout] 140 | } [INFO] [stdout] 141 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/archive.rs:145:13 [INFO] [stdout] | [INFO] [stdout] 145 | / if count > 0 { [INFO] [stdout] 146 | | app.do_delete_archive(); [INFO] [stdout] 147 | | } [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] 143 ~ KeyCode::Char('d') | KeyCode::Char('D') [INFO] [stdout] 144 | // 删除选中的归档 [INFO] [stdout] 145 ~ if count > 0 => { [INFO] [stdout] 146 | app.do_delete_archive(); [INFO] [stdout] 147 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/browse.rs:20:13 [INFO] [stdout] | [INFO] [stdout] 20 | / if app.browse_msg_index > 0 { [INFO] [stdout] 21 | | app.browse_msg_index -= 1; [INFO] [stdout] 22 | | app.browse_scroll_offset = 0; // 切换消息时从头显示 [INFO] [stdout] 23 | | app.msg_lines_cache = None; // 选中变化时清缓存 [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 19 ~ KeyCode::Up | KeyCode::Char('k') [INFO] [stdout] 20 ~ if app.browse_msg_index > 0 => { [INFO] [stdout] 21 | app.browse_msg_index -= 1; [INFO] [stdout] 22 | app.browse_scroll_offset = 0; // 切换消息时从头显示 [INFO] [stdout] 23 | app.msg_lines_cache = None; // 选中变化时清缓存 [INFO] [stdout] 24 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/browse.rs:27:13 [INFO] [stdout] | [INFO] [stdout] 27 | / if app.browse_msg_index < msg_count - 1 { [INFO] [stdout] 28 | | app.browse_msg_index += 1; [INFO] [stdout] 29 | | app.browse_scroll_offset = 0; // 切换消息时从头显示 [INFO] [stdout] 30 | | app.msg_lines_cache = None; // 选中变化时清缓存 [INFO] [stdout] 31 | | } [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] 26 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 27 ~ if app.browse_msg_index < msg_count - 1 => { [INFO] [stdout] 28 | app.browse_msg_index += 1; [INFO] [stdout] 29 | app.browse_scroll_offset = 0; // 切换消息时从头显示 [INFO] [stdout] 30 | app.msg_lines_cache = None; // 选中变化时清缓存 [INFO] [stdout] 31 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/chat.rs:388:13 [INFO] [stdout] | [INFO] [stdout] 388 | / if app.cursor_pos > 0 { [INFO] [stdout] 389 | | app.cursor_pos -= 1; [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 387 ~ KeyCode::Left [INFO] [stdout] 388 ~ if app.cursor_pos > 0 => { [INFO] [stdout] 389 | app.cursor_pos -= 1; [INFO] [stdout] 390 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/chat.rs:393:13 [INFO] [stdout] | [INFO] [stdout] 393 | / if app.cursor_pos < char_count { [INFO] [stdout] 394 | | app.cursor_pos += 1; [INFO] [stdout] 395 | | } [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] 392 ~ KeyCode::Right [INFO] [stdout] 393 ~ if app.cursor_pos < char_count => { [INFO] [stdout] 394 | app.cursor_pos += 1; [INFO] [stdout] 395 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/chat.rs:402:13 [INFO] [stdout] | [INFO] [stdout] 402 | / if app.cursor_pos > 0 { [INFO] [stdout] 403 | | let start = app [INFO] [stdout] 404 | | .input [INFO] [stdout] 405 | | .char_indices() [INFO] [stdout] ... | [INFO] [stdout] 416 | | app.cursor_pos -= 1; [INFO] [stdout] 417 | | } [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] 401 ~ KeyCode::Backspace [INFO] [stdout] 402 ~ if app.cursor_pos > 0 => { [INFO] [stdout] 403 | let start = app [INFO] [stdout] ... [INFO] [stdout] 416 | app.cursor_pos -= 1; [INFO] [stdout] 417 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/chat.rs:420:13 [INFO] [stdout] | [INFO] [stdout] 420 | / if app.cursor_pos < char_count { [INFO] [stdout] 421 | | let start = app [INFO] [stdout] 422 | | .input [INFO] [stdout] 423 | | .char_indices() [INFO] [stdout] ... | [INFO] [stdout] 433 | | app.input.drain(start..end); [INFO] [stdout] 434 | | } [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] 419 ~ KeyCode::Delete [INFO] [stdout] 420 ~ if app.cursor_pos < char_count => { [INFO] [stdout] 421 | let start = app [INFO] [stdout] ... [INFO] [stdout] 433 | app.input.drain(start..end); [INFO] [stdout] 434 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/config.rs:27:17 [INFO] [stdout] | [INFO] [stdout] 27 | / if app.config_edit_cursor > 0 { [INFO] [stdout] 28 | | let idx = app [INFO] [stdout] 29 | | .config_edit_buf [INFO] [stdout] 30 | | .char_indices() [INFO] [stdout] ... | [INFO] [stdout] 45 | | app.config_edit_cursor -= 1; [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 26 ~ KeyCode::Backspace [INFO] [stdout] 27 ~ if app.config_edit_cursor > 0 => { [INFO] [stdout] 28 | let idx = app [INFO] [stdout] ... [INFO] [stdout] 45 | app.config_edit_cursor -= 1; [INFO] [stdout] 46 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/config.rs:79:13 [INFO] [stdout] | [INFO] [stdout] 79 | / if app.config_field_idx > 0 { [INFO] [stdout] 80 | | app.config_field_idx -= 1; [INFO] [stdout] 81 | | } [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] 78 ~ KeyCode::Up | KeyCode::Char('k') [INFO] [stdout] 79 ~ if app.config_field_idx > 0 => { [INFO] [stdout] 80 | app.config_field_idx -= 1; [INFO] [stdout] 81 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/config.rs:84:13 [INFO] [stdout] | [INFO] [stdout] 84 | / if app.config_field_idx < total_fields - 1 { [INFO] [stdout] 85 | | app.config_field_idx += 1; [INFO] [stdout] 86 | | } [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] 83 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 84 ~ if app.config_field_idx < total_fields - 1 => { [INFO] [stdout] 85 | app.config_field_idx += 1; [INFO] [stdout] 86 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/config.rs:193:13 [INFO] [stdout] | [INFO] [stdout] 193 | / if !app.agent_config.providers.is_empty() { [INFO] [stdout] 194 | | app.agent_config.active_index = app.config_provider_idx; [INFO] [stdout] 195 | | let name = app.agent_config.providers[app.config_provider_idx] [INFO] [stdout] 196 | | .name [INFO] [stdout] 197 | | .clone(); [INFO] [stdout] 198 | | app.show_toast(format!("已设为活跃模型: {}", name), false); [INFO] [stdout] 199 | | } [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] 191 ~ KeyCode::Char('s') [INFO] [stdout] 192 | // 将当前 provider 设为活跃 [INFO] [stdout] 193 ~ if !app.agent_config.providers.is_empty() => { [INFO] [stdout] 194 | app.agent_config.active_index = app.config_provider_idx; [INFO] [stdout] ... [INFO] [stdout] 198 | app.show_toast(format!("已设为活跃模型: {}", name), false); [INFO] [stdout] 199 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/config.rs:330:13 [INFO] [stdout] | [INFO] [stdout] 330 | / if count > 0 { [INFO] [stdout] 331 | | let i = app [INFO] [stdout] 332 | | .model_list_state [INFO] [stdout] 333 | | .selected() [INFO] [stdout] ... | [INFO] [stdout] 336 | | app.model_list_state.select(Some(i)); [INFO] [stdout] 337 | | } [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] 329 ~ KeyCode::Up | KeyCode::Char('k') [INFO] [stdout] 330 ~ if count > 0 => { [INFO] [stdout] 331 | let i = app [INFO] [stdout] ... [INFO] [stdout] 336 | app.model_list_state.select(Some(i)); [INFO] [stdout] 337 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/config.rs:340:13 [INFO] [stdout] | [INFO] [stdout] 340 | / if count > 0 { [INFO] [stdout] 341 | | let i = app [INFO] [stdout] 342 | | .model_list_state [INFO] [stdout] 343 | | .selected() [INFO] [stdout] ... | [INFO] [stdout] 346 | | app.model_list_state.select(Some(i)); [INFO] [stdout] 347 | | } [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] 339 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 340 ~ if count > 0 => { [INFO] [stdout] 341 | let i = app [INFO] [stdout] ... [INFO] [stdout] 346 | app.model_list_state.select(Some(i)); [INFO] [stdout] 347 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:29:17 [INFO] [stdout] | [INFO] [stdout] 29 | / if app.tool_interact_cursor > 0 { [INFO] [stdout] 30 | | let start = app [INFO] [stdout] 31 | | .tool_interact_input [INFO] [stdout] 32 | | .char_indices() [INFO] [stdout] ... | [INFO] [stdout] 43 | | app.tool_interact_cursor -= 1; [INFO] [stdout] 44 | | } [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] 28 ~ KeyCode::Backspace [INFO] [stdout] 29 ~ if app.tool_interact_cursor > 0 => { [INFO] [stdout] 30 | let start = app [INFO] [stdout] ... [INFO] [stdout] 43 | app.tool_interact_cursor -= 1; [INFO] [stdout] 44 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:47:17 [INFO] [stdout] | [INFO] [stdout] 47 | / if app.tool_interact_cursor > 0 { [INFO] [stdout] 48 | | app.tool_interact_cursor -= 1; [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 46 ~ KeyCode::Left [INFO] [stdout] 47 ~ if app.tool_interact_cursor > 0 => { [INFO] [stdout] 48 | app.tool_interact_cursor -= 1; [INFO] [stdout] 49 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:76:13 [INFO] [stdout] | [INFO] [stdout] 76 | / if app.tool_interact_selected > 0 { [INFO] [stdout] 77 | | app.tool_interact_selected -= 1; [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 75 ~ KeyCode::Up [INFO] [stdout] 76 ~ if app.tool_interact_selected > 0 => { [INFO] [stdout] 77 | app.tool_interact_selected -= 1; [INFO] [stdout] 78 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:81:13 [INFO] [stdout] | [INFO] [stdout] 81 | / if app.tool_interact_selected < 3 { [INFO] [stdout] 82 | | app.tool_interact_selected += 1; [INFO] [stdout] 83 | | } [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] 80 ~ KeyCode::Down [INFO] [stdout] 81 ~ if app.tool_interact_selected < 3 => { [INFO] [stdout] 82 | app.tool_interact_selected += 1; [INFO] [stdout] 83 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:132:17 [INFO] [stdout] | [INFO] [stdout] 132 | / if app.tool_interact_cursor > 0 { [INFO] [stdout] 133 | | let start = app [INFO] [stdout] 134 | | .tool_interact_input [INFO] [stdout] 135 | | .char_indices() [INFO] [stdout] ... | [INFO] [stdout] 146 | | app.tool_interact_cursor -= 1; [INFO] [stdout] 147 | | } [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] 131 ~ KeyCode::Backspace [INFO] [stdout] 132 ~ if app.tool_interact_cursor > 0 => { [INFO] [stdout] 133 | let start = app [INFO] [stdout] ... [INFO] [stdout] 146 | app.tool_interact_cursor -= 1; [INFO] [stdout] 147 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:150:17 [INFO] [stdout] | [INFO] [stdout] 150 | / if app.tool_interact_cursor > 0 { [INFO] [stdout] 151 | | app.tool_interact_cursor -= 1; [INFO] [stdout] 152 | | } [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] 149 ~ KeyCode::Left [INFO] [stdout] 150 ~ if app.tool_interact_cursor > 0 => { [INFO] [stdout] 151 | app.tool_interact_cursor -= 1; [INFO] [stdout] 152 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:181:13 [INFO] [stdout] | [INFO] [stdout] 181 | / if app.tool_ask_cursor > 0 { [INFO] [stdout] 182 | | app.tool_ask_cursor -= 1; [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 180 ~ KeyCode::Up [INFO] [stdout] 181 ~ if app.tool_ask_cursor > 0 => { [INFO] [stdout] 182 | app.tool_ask_cursor -= 1; [INFO] [stdout] 183 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:186:13 [INFO] [stdout] | [INFO] [stdout] 186 | / if app.tool_ask_cursor < option_count - 1 { [INFO] [stdout] 187 | | app.tool_ask_cursor += 1; [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 185 ~ KeyCode::Down [INFO] [stdout] 186 ~ if app.tool_ask_cursor < option_count - 1 => { [INFO] [stdout] 187 | app.tool_ask_cursor += 1; [INFO] [stdout] 188 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:192:13 [INFO] [stdout] | [INFO] [stdout] 192 | / if app.tool_ask_cursor < cur_q.options.len() { [INFO] [stdout] 193 | | let idx = app.tool_ask_cursor; [INFO] [stdout] 194 | | if idx < app.tool_ask_selections.len() { [INFO] [stdout] 195 | | app.tool_ask_selections[idx] = !app.tool_ask_selections[idx]; [INFO] [stdout] 196 | | } [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 190 ~ KeyCode::Char(' ') if is_multi [INFO] [stdout] 191 | // 多选 toggle(不对"自由输入"选项 toggle) [INFO] [stdout] 192 ~ && app.tool_ask_cursor < cur_q.options.len() => { [INFO] [stdout] 193 | let idx = app.tool_ask_cursor; [INFO] [stdout] ... [INFO] [stdout] 196 | } [INFO] [stdout] 197 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:228:13 [INFO] [stdout] | [INFO] [stdout] 228 | / if app.tool_ask_current_idx > 0 { [INFO] [stdout] 229 | | app.tool_ask_current_idx -= 1; [INFO] [stdout] 230 | | // 恢复上一题的状态 [INFO] [stdout] 231 | | if app.tool_ask_answers.len() > app.tool_ask_current_idx { [INFO] [stdout] ... | [INFO] [stdout] 234 | | app.init_ask_question_state(); [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_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 227 ~ KeyCode::Left | KeyCode::BackTab [INFO] [stdout] 228 ~ if app.tool_ask_current_idx > 0 => { [INFO] [stdout] 229 | app.tool_ask_current_idx -= 1; [INFO] [stdout] ... [INFO] [stdout] 234 | app.init_ask_question_state(); [INFO] [stdout] 235 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/handler/tool_confirm.rs:239:13 [INFO] [stdout] | [INFO] [stdout] 239 | / if app.tool_ask_current_idx < total_questions - 1 [INFO] [stdout] 240 | | && app.tool_ask_current_idx < app.tool_ask_answers.len() [INFO] [stdout] 241 | | { [INFO] [stdout] 242 | | app.tool_ask_current_idx += 1; [INFO] [stdout] 243 | | app.init_ask_question_state(); [INFO] [stdout] 244 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 238 ~ KeyCode::Right | KeyCode::Tab [INFO] [stdout] 239 | if app.tool_ask_current_idx < total_questions - 1 [INFO] [stdout] 240 | && app.tool_ask_current_idx < app.tool_ask_answers.len() [INFO] [stdout] 241 ~ => { [INFO] [stdout] 242 | app.tool_ask_current_idx += 1; [INFO] [stdout] 243 | app.init_ask_question_state(); [INFO] [stdout] 244 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/chat/markdown/parser.rs:271:17 [INFO] [stdout] | [INFO] [stdout] 271 | / if !lines.is_empty() && !in_code_block && heading_level.is_none() { [INFO] [stdout] 272 | | let last_empty = lines.last().map(|l| l.spans.is_empty()).unwrap_or(false); [INFO] [stdout] 273 | | if !last_empty { [INFO] [stdout] 274 | | lines.push(Line::from("")); [INFO] [stdout] 275 | | } [INFO] [stdout] 276 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 270 ~ Event::Start(Tag::Paragraph) [INFO] [stdout] 271 ~ if !lines.is_empty() && !in_code_block && heading_level.is_none() => { [INFO] [stdout] 272 | let last_empty = lines.last().map(|l| l.spans.is_empty()).unwrap_or(false); [INFO] [stdout] ... [INFO] [stdout] 275 | } [INFO] [stdout] 276 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/todo/app.rs:415:13 [INFO] [stdout] | [INFO] [stdout] 415 | / if app.selected_real_index().is_some() { [INFO] [stdout] 416 | | app.mode = AppMode::ConfirmDelete; [INFO] [stdout] 417 | | } [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] 414 ~ KeyCode::Char('d') [INFO] [stdout] 415 ~ if app.selected_real_index().is_some() => { [INFO] [stdout] 416 | app.mode = AppMode::ConfirmDelete; [INFO] [stdout] 417 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/todo/app.rs:484:13 [INFO] [stdout] | [INFO] [stdout] 484 | / if app.cursor_pos > 0 { [INFO] [stdout] 485 | | app.cursor_pos -= 1; [INFO] [stdout] 486 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 483 ~ KeyCode::Left [INFO] [stdout] 484 ~ if app.cursor_pos > 0 => { [INFO] [stdout] 485 | app.cursor_pos -= 1; [INFO] [stdout] 486 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/todo/app.rs:489:13 [INFO] [stdout] | [INFO] [stdout] 489 | / if app.cursor_pos < char_count { [INFO] [stdout] 490 | | app.cursor_pos += 1; [INFO] [stdout] 491 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 488 ~ KeyCode::Right [INFO] [stdout] 489 ~ if app.cursor_pos < char_count => { [INFO] [stdout] 490 | app.cursor_pos += 1; [INFO] [stdout] 491 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/todo/app.rs:500:13 [INFO] [stdout] | [INFO] [stdout] 500 | / if app.cursor_pos > 0 { [INFO] [stdout] 501 | | let start = app [INFO] [stdout] 502 | | .input [INFO] [stdout] 503 | | .char_indices() [INFO] [stdout] ... | [INFO] [stdout] 514 | | app.cursor_pos -= 1; [INFO] [stdout] 515 | | } [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] 499 ~ KeyCode::Backspace [INFO] [stdout] 500 ~ if app.cursor_pos > 0 => { [INFO] [stdout] 501 | let start = app [INFO] [stdout] ... [INFO] [stdout] 514 | app.cursor_pos -= 1; [INFO] [stdout] 515 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/todo/app.rs:518:13 [INFO] [stdout] | [INFO] [stdout] 518 | / if app.cursor_pos < char_count { [INFO] [stdout] 519 | | let start = app [INFO] [stdout] 520 | | .input [INFO] [stdout] 521 | | .char_indices() [INFO] [stdout] ... | [INFO] [stdout] 531 | | app.input.drain(start..end); [INFO] [stdout] 532 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 517 ~ KeyCode::Delete [INFO] [stdout] 518 ~ if app.cursor_pos < char_count => { [INFO] [stdout] 519 | let start = app [INFO] [stdout] ... [INFO] [stdout] 531 | app.input.drain(start..end); [INFO] [stdout] 532 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/update.rs:140:21 [INFO] [stdout] | [INFO] [stdout] 140 | / if cursor_pos < OPTIONAL_FEATURES.len() { [INFO] [stdout] 141 | | cursor_pos += 1; [INFO] [stdout] 142 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 139 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 140 ~ if cursor_pos < OPTIONAL_FEATURES.len() => { [INFO] [stdout] 141 | cursor_pos += 1; [INFO] [stdout] 142 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/update.rs:146:21 [INFO] [stdout] | [INFO] [stdout] 146 | / if cursor_pos < OPTIONAL_FEATURES.len() { [INFO] [stdout] 147 | | selected[cursor_pos] = !selected[cursor_pos]; [INFO] [stdout] 148 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 144 ~ KeyCode::Char(' ') [INFO] [stdout] 145 | // 空格切换选中状态(仅在 feature 行上有效) [INFO] [stdout] 146 ~ if cursor_pos < OPTIONAL_FEATURES.len() => { [INFO] [stdout] 147 | selected[cursor_pos] = !selected[cursor_pos]; [INFO] [stdout] 148 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: match can be simplified with `.unwrap_or_default()` [INFO] [stdout] --> src/command/chat/permission.rs:31:32 [INFO] [stdout] | [INFO] [stdout] 31 | Ok(content) => match serde_yaml::from_str::(&content) { [INFO] [stdout] | ________________________________^ [INFO] [stdout] 32 | | Ok(config) => config, [INFO] [stdout] 33 | | Err(_) => Self::default(), [INFO] [stdout] 34 | | }, [INFO] [stdout] | |_________________^ help: replace it with: `serde_yaml::from_str::(&content).unwrap_or_default()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_unwrap_or_default [INFO] [stdout] = note: `#[warn(clippy::manual_unwrap_or_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: stripping a prefix manually [INFO] [stdout] --> src/command/chat/permission.rs:213:20 [INFO] [stdout] | [INFO] [stdout] 213 | let rest = &command[prefix.len()..]; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: the prefix was tested here [INFO] [stdout] --> src/command/chat/permission.rs:212:5 [INFO] [stdout] | [INFO] [stdout] 212 | if command.starts_with(prefix) { [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] 212 ~ if let Some(rest) = command.strip_prefix(prefix) { [INFO] [stdout] 213 ~ return rest.starts_with(' ') || rest.starts_with('\t'); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `m.tool_calls` after checking its variant with `is_some` [INFO] [stdout] --> src/command/chat/render.rs:130:25 [INFO] [stdout] | [INFO] [stdout] 128 | if m.tool_calls.is_some() { [INFO] [stdout] | ------------------------- help: try: `if let Some() = &m.tool_calls` [INFO] [stdout] 129 | render_tool_call_request_msg( [INFO] [stdout] 130 | m.tool_calls.as_ref().unwrap(), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/render.rs:92:9 [INFO] [stdout] | [INFO] [stdout] 92 | / if can_reuse_per_msg { [INFO] [stdout] 93 | | if let Some(old_c) = old_cache { [INFO] [stdout] 94 | | if let Some(old_per) = old_c.per_msg_lines.get(idx) { [INFO] [stdout] 95 | | if old_per.msg_index == idx [INFO] [stdout] ... | [INFO] [stdout] 112 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information 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 can_reuse_per_msg [INFO] [stdout] 93 ~ && let Some(old_c) = old_cache { [INFO] [stdout] 94 | if let Some(old_per) = old_c.per_msg_lines.get(idx) { [INFO] [stdout] ... [INFO] [stdout] 110 | } [INFO] [stdout] 111 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/render.rs:93:13 [INFO] [stdout] | [INFO] [stdout] 93 | / if let Some(old_c) = old_cache { [INFO] [stdout] 94 | | if let Some(old_per) = old_c.per_msg_lines.get(idx) { [INFO] [stdout] 95 | | if old_per.msg_index == idx [INFO] [stdout] 96 | | && old_per.content_len == m.content.len() [INFO] [stdout] ... | [INFO] [stdout] 111 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 93 ~ if let Some(old_c) = old_cache [INFO] [stdout] 94 ~ && let Some(old_per) = old_c.per_msg_lines.get(idx) { [INFO] [stdout] 95 | if old_per.msg_index == idx [INFO] [stdout] ... [INFO] [stdout] 109 | } [INFO] [stdout] 110 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/render.rs:94:17 [INFO] [stdout] | [INFO] [stdout] 94 | / if let Some(old_per) = old_c.per_msg_lines.get(idx) { [INFO] [stdout] 95 | | if old_per.msg_index == idx [INFO] [stdout] 96 | | && old_per.content_len == m.content.len() [INFO] [stdout] 97 | | && old_per.is_selected == is_selected [INFO] [stdout] ... | [INFO] [stdout] 110 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 94 ~ if let Some(old_per) = old_c.per_msg_lines.get(idx) [INFO] [stdout] 95 ~ && old_per.msg_index == idx [INFO] [stdout] 96 | && old_per.content_len == m.content.len() [INFO] [stdout] ... [INFO] [stdout] 108 | continue; [INFO] [stdout] 109 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/tools/task.rs:48:17 [INFO] [stdout] | [INFO] [stdout] 48 | / if let Some(rest) = name.strip_prefix("task_") { [INFO] [stdout] 49 | | if let Some(id_str) = rest.strip_suffix(".json") { [INFO] [stdout] 50 | | if let Ok(id) = id_str.parse::() { [INFO] [stdout] 51 | | max_id = max_id.max(id); [INFO] [stdout] ... | [INFO] [stdout] 54 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 48 ~ if let Some(rest) = name.strip_prefix("task_") [INFO] [stdout] 49 ~ && let Some(id_str) = rest.strip_suffix(".json") { [INFO] [stdout] 50 | if let Ok(id) = id_str.parse::() { [INFO] [stdout] 51 | max_id = max_id.max(id); [INFO] [stdout] 52 | } [INFO] [stdout] 53 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/tools/task.rs:49:21 [INFO] [stdout] | [INFO] [stdout] 49 | / if let Some(id_str) = rest.strip_suffix(".json") { [INFO] [stdout] 50 | | if let Ok(id) = id_str.parse::() { [INFO] [stdout] 51 | | max_id = max_id.max(id); [INFO] [stdout] 52 | | } [INFO] [stdout] 53 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information 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(id_str) = rest.strip_suffix(".json") [INFO] [stdout] 50 ~ && let Ok(id) = id_str.parse::() { [INFO] [stdout] 51 | max_id = max_id.max(id); [INFO] [stdout] 52 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/tools/task.rs:93:17 [INFO] [stdout] | [INFO] [stdout] 93 | / if path.extension().is_some_and(|e| e == "json") { [INFO] [stdout] 94 | | if let Ok(data) = fs::read_to_string(&path) { [INFO] [stdout] 95 | | if let Ok(task) = serde_json::from_str::(&data) { [INFO] [stdout] 96 | | tasks.push(task); [INFO] [stdout] ... | [INFO] [stdout] 99 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 93 ~ if path.extension().is_some_and(|e| e == "json") [INFO] [stdout] 94 ~ && let Ok(data) = fs::read_to_string(&path) { [INFO] [stdout] 95 | if let Ok(task) = serde_json::from_str::(&data) { [INFO] [stdout] 96 | tasks.push(task); [INFO] [stdout] 97 | } [INFO] [stdout] 98 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/tools/task.rs:94:21 [INFO] [stdout] | [INFO] [stdout] 94 | / if let Ok(data) = fs::read_to_string(&path) { [INFO] [stdout] 95 | | if let Ok(task) = serde_json::from_str::(&data) { [INFO] [stdout] 96 | | tasks.push(task); [INFO] [stdout] 97 | | } [INFO] [stdout] 98 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 94 ~ if let Ok(data) = fs::read_to_string(&path) [INFO] [stdout] 95 ~ && let Ok(task) = serde_json::from_str::(&data) { [INFO] [stdout] 96 | tasks.push(task); [INFO] [stdout] 97 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/tools/task.rs:144:17 [INFO] [stdout] | [INFO] [stdout] 144 | / if let Some(dep_id) = id_val.as_u64() { [INFO] [stdout] 145 | | if !task.blocked_by.contains(&dep_id) { [INFO] [stdout] 146 | | task.blocked_by.push(dep_id); [INFO] [stdout] 147 | | } [INFO] [stdout] 148 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 144 ~ if let Some(dep_id) = id_val.as_u64() [INFO] [stdout] 145 ~ && !task.blocked_by.contains(&dep_id) { [INFO] [stdout] 146 | task.blocked_by.push(dep_id); [INFO] [stdout] 147 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/command/chat/tools/task.rs:158:21 [INFO] [stdout] | [INFO] [stdout] 158 | / if let Ok(mut target) = self.get_task(dep_id) { [INFO] [stdout] 159 | | if !target.blocked_by.contains(&id) { [INFO] [stdout] 160 | | target.blocked_by.push(id); [INFO] [stdout] 161 | | let _ = self.save_task(&target); [INFO] [stdout] 162 | | } [INFO] [stdout] 163 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 158 ~ if let Ok(mut target) = self.get_task(dep_id) [INFO] [stdout] 159 ~ && !target.blocked_by.contains(&id) { [INFO] [stdout] 160 | target.blocked_by.push(id); [INFO] [stdout] 161 | let _ = self.save_task(&target); [INFO] [stdout] 162 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/todo/app.rs:415:13 [INFO] [stdout] | [INFO] [stdout] 415 | / if app.selected_real_index().is_some() { [INFO] [stdout] 416 | | app.mode = AppMode::ConfirmDelete; [INFO] [stdout] 417 | | } [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] 414 ~ KeyCode::Char('d') [INFO] [stdout] 415 ~ if app.selected_real_index().is_some() => { [INFO] [stdout] 416 | app.mode = AppMode::ConfirmDelete; [INFO] [stdout] 417 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/todo/app.rs:484:13 [INFO] [stdout] | [INFO] [stdout] 484 | / if app.cursor_pos > 0 { [INFO] [stdout] 485 | | app.cursor_pos -= 1; [INFO] [stdout] 486 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 483 ~ KeyCode::Left [INFO] [stdout] 484 ~ if app.cursor_pos > 0 => { [INFO] [stdout] 485 | app.cursor_pos -= 1; [INFO] [stdout] 486 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/todo/app.rs:489:13 [INFO] [stdout] | [INFO] [stdout] 489 | / if app.cursor_pos < char_count { [INFO] [stdout] 490 | | app.cursor_pos += 1; [INFO] [stdout] 491 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 488 ~ KeyCode::Right [INFO] [stdout] 489 ~ if app.cursor_pos < char_count => { [INFO] [stdout] 490 | app.cursor_pos += 1; [INFO] [stdout] 491 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/todo/app.rs:500:13 [INFO] [stdout] | [INFO] [stdout] 500 | / if app.cursor_pos > 0 { [INFO] [stdout] 501 | | let start = app [INFO] [stdout] 502 | | .input [INFO] [stdout] 503 | | .char_indices() [INFO] [stdout] ... | [INFO] [stdout] 514 | | app.cursor_pos -= 1; [INFO] [stdout] 515 | | } [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] 499 ~ KeyCode::Backspace [INFO] [stdout] 500 ~ if app.cursor_pos > 0 => { [INFO] [stdout] 501 | let start = app [INFO] [stdout] ... [INFO] [stdout] 514 | app.cursor_pos -= 1; [INFO] [stdout] 515 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/todo/app.rs:518:13 [INFO] [stdout] | [INFO] [stdout] 518 | / if app.cursor_pos < char_count { [INFO] [stdout] 519 | | let start = app [INFO] [stdout] 520 | | .input [INFO] [stdout] 521 | | .char_indices() [INFO] [stdout] ... | [INFO] [stdout] 531 | | app.input.drain(start..end); [INFO] [stdout] 532 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 517 ~ KeyCode::Delete [INFO] [stdout] 518 ~ if app.cursor_pos < char_count => { [INFO] [stdout] 519 | let start = app [INFO] [stdout] ... [INFO] [stdout] 531 | app.input.drain(start..end); [INFO] [stdout] 532 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/update.rs:140:21 [INFO] [stdout] | [INFO] [stdout] 140 | / if cursor_pos < OPTIONAL_FEATURES.len() { [INFO] [stdout] 141 | | cursor_pos += 1; [INFO] [stdout] 142 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 139 ~ KeyCode::Down | KeyCode::Char('j') [INFO] [stdout] 140 ~ if cursor_pos < OPTIONAL_FEATURES.len() => { [INFO] [stdout] 141 | cursor_pos += 1; [INFO] [stdout] 142 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/command/update.rs:146:21 [INFO] [stdout] | [INFO] [stdout] 146 | / if cursor_pos < OPTIONAL_FEATURES.len() { [INFO] [stdout] 147 | | selected[cursor_pos] = !selected[cursor_pos]; [INFO] [stdout] 148 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 144 ~ KeyCode::Char(' ') [INFO] [stdout] 145 | // 空格切换选中状态(仅在 feature 行上有效) [INFO] [stdout] 146 ~ if cursor_pos < OPTIONAL_FEATURES.len() => { [INFO] [stdout] 147 | selected[cursor_pos] = !selected[cursor_pos]; [INFO] [stdout] 148 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 1m 34s [INFO] running `Command { std: "docker" "inspect" "e8140f5b031ab9e930606279686202f0f3a58b668efe2b5a3e8f0ba3f3331493", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "e8140f5b031ab9e930606279686202f0f3a58b668efe2b5a3e8f0ba3f3331493", kill_on_drop: false }` [INFO] [stdout] e8140f5b031ab9e930606279686202f0f3a58b668efe2b5a3e8f0ba3f3331493