[INFO] cloning repository https://github.com/McBrosa/youtui [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/McBrosa/youtui" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FMcBrosa%2Fyoutui", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FMcBrosa%2Fyoutui'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 181924792fdc93aa6c129b636df259e3e435355b [INFO] linting McBrosa/youtui against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FMcBrosa%2Fyoutui" "/workspace/builds/worker-5-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/McBrosa/youtui [INFO] finished tweaking git repo https://github.com/McBrosa/youtui [INFO] tweaked toml for git repo https://github.com/McBrosa/youtui written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/McBrosa/youtui 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/McBrosa/youtui already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded which v7.0.3 [INFO] [stderr] Downloaded zmij v1.0.20 [INFO] [stderr] Downloaded clap v4.5.57 [INFO] [stderr] Downloaded clap_builder v4.5.57 [INFO] [stderr] Downloaded ratatui v0.28.1 [INFO] [stderr] Downloaded libc v0.2.181 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 8ed1f2f555f53e29cccc0f5d5886e3e1b85c25cf769a8ebf5869991bb9f851b5 [INFO] running `Command { std: "docker" "start" "-a" "8ed1f2f555f53e29cccc0f5d5886e3e1b85c25cf769a8ebf5869991bb9f851b5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "8ed1f2f555f53e29cccc0f5d5886e3e1b85c25cf769a8ebf5869991bb9f851b5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "8ed1f2f555f53e29cccc0f5d5886e3e1b85c25cf769a8ebf5869991bb9f851b5", kill_on_drop: false }` [INFO] [stdout] 8ed1f2f555f53e29cccc0f5d5886e3e1b85c25cf769a8ebf5869991bb9f851b5 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 709f3f6ec9c4d496d840c7c8b33c437d86d92aee062d25e954a666626a873d5a [INFO] running `Command { std: "docker" "start" "-a" "709f3f6ec9c4d496d840c7c8b33c437d86d92aee062d25e954a666626a873d5a", kill_on_drop: false }` [INFO] [stderr] Compiling unicode-ident v1.0.23 [INFO] [stderr] Compiling libc v0.2.181 [INFO] [stderr] Checking either v1.15.0 [INFO] [stderr] Compiling rustix v0.38.44 [INFO] [stderr] Compiling nix v0.30.1 [INFO] [stderr] Compiling zmij v1.0.20 [INFO] [stderr] Compiling getrandom v0.4.1 [INFO] [stderr] Checking foldhash v0.1.5 [INFO] [stderr] Checking unicode-width v0.1.14 [INFO] [stderr] Compiling anyhow v1.0.101 [INFO] [stderr] Checking compact_str v0.8.1 [INFO] [stderr] Checking clap_builder v4.5.57 [INFO] [stderr] Checking once_cell v1.21.3 [INFO] [stderr] Checking cassowary v0.3.0 [INFO] [stderr] Checking colored v3.1.1 [INFO] [stderr] Compiling proc-macro2 v1.0.106 [INFO] [stderr] Checking hashbrown v0.15.5 [INFO] [stderr] Checking itertools v0.13.0 [INFO] [stderr] Checking which v7.0.3 [INFO] [stderr] Checking serde_json v1.0.149 [INFO] [stderr] Compiling quote v1.0.44 [INFO] [stderr] Compiling syn v2.0.114 [INFO] [stderr] Checking lru v0.12.5 [INFO] [stderr] Checking unicode-truncate v1.1.0 [INFO] [stderr] Checking errno v0.3.14 [INFO] [stderr] Checking parking_lot_core v0.9.12 [INFO] [stderr] Checking mio v1.1.1 [INFO] [stderr] Checking dirs-sys v0.4.1 [INFO] [stderr] Checking signal-hook-registry v1.4.8 [INFO] [stderr] Checking tempfile v3.25.0 [INFO] [stderr] Checking dirs v5.0.1 [INFO] [stderr] Checking parking_lot v0.12.5 [INFO] [stderr] Checking signal-hook v0.3.18 [INFO] [stderr] Checking signal-hook-mio v0.2.5 [INFO] [stderr] Checking crossterm v0.28.1 [INFO] [stderr] Checking ctrlc v3.5.1 [INFO] [stderr] Compiling darling_core v0.23.0 [INFO] [stderr] Compiling serde_derive v1.0.228 [INFO] [stderr] Compiling strum_macros v0.26.4 [INFO] [stderr] Compiling clap_derive v4.5.55 [INFO] [stderr] Compiling darling_macro v0.23.0 [INFO] [stderr] Checking clap v4.5.57 [INFO] [stderr] Checking strum v0.26.3 [INFO] [stderr] Compiling darling v0.23.0 [INFO] [stderr] Compiling instability v0.3.11 [INFO] [stderr] Checking ratatui v0.28.1 [INFO] [stderr] Checking serde v1.0.228 [INFO] [stderr] Checking serde_spanned v0.6.9 [INFO] [stderr] Checking toml_datetime v0.6.11 [INFO] [stderr] Checking toml_edit v0.22.27 [INFO] [stderr] Checking toml v0.8.23 [INFO] [stderr] Checking youtui v2.0.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/player.rs:17:1 [INFO] [stdout] | [INFO] [stdout] 17 | / impl Default for PlayerType { [INFO] [stdout] 18 | | fn default() -> Self { [INFO] [stdout] 19 | | PlayerType::Mpv [INFO] [stdout] 20 | | } [INFO] [stdout] 21 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 11 + #[derive(Default)] [INFO] [stdout] 12 | pub enum PlayerType { [INFO] [stdout] 13 ~ #[default] [INFO] [stdout] 14 ~ Mpv, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/player.rs:82:23 [INFO] [stdout] | [INFO] [stdout] 82 | cmd.arg("-f").arg(&config.format()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `config.format()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/player.rs:152:23 [INFO] [stdout] | [INFO] [stdout] 152 | cmd.arg("-f").arg(&config.format()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `config.format()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player.rs:217:13 [INFO] [stdout] | [INFO] [stdout] 217 | / if path.is_file() { [INFO] [stdout] 218 | | if let Some(ext) = path.extension().and_then(|e| e.to_str()) { [INFO] [stdout] 219 | | if ext != "part" && ext != "conf" { [INFO] [stdout] 220 | | best = Some(path); [INFO] [stdout] ... | [INFO] [stdout] 224 | | } [INFO] [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] 217 ~ if path.is_file() [INFO] [stdout] 218 ~ && let Some(ext) = path.extension().and_then(|e| e.to_str()) { [INFO] [stdout] 219 | if ext != "part" && ext != "conf" { [INFO] [stdout] ... [INFO] [stdout] 222 | } [INFO] [stdout] 223 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player.rs:218:17 [INFO] [stdout] | [INFO] [stdout] 218 | / if let Some(ext) = path.extension().and_then(|e| e.to_str()) { [INFO] [stdout] 219 | | if ext != "part" && ext != "conf" { [INFO] [stdout] 220 | | best = Some(path); [INFO] [stdout] 221 | | break; [INFO] [stdout] 222 | | } [INFO] [stdout] 223 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 218 ~ if let Some(ext) = path.extension().and_then(|e| e.to_str()) [INFO] [stdout] 219 ~ && ext != "part" && ext != "conf" { [INFO] [stdout] 220 | best = Some(path); [INFO] [stdout] 221 | break; [INFO] [stdout] 222 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player_manager.rs:154:13 [INFO] [stdout] | [INFO] [stdout] 154 | / if let Ok(val) = ipc.get_property("time-pos") { [INFO] [stdout] 155 | | if let Some(time) = val.as_f64() { [INFO] [stdout] 156 | | self.status.time_pos = time; [INFO] [stdout] 157 | | } [INFO] [stdout] 158 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 154 ~ if let Ok(val) = ipc.get_property("time-pos") [INFO] [stdout] 155 ~ && let Some(time) = val.as_f64() { [INFO] [stdout] 156 | self.status.time_pos = time; [INFO] [stdout] 157 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player_manager.rs:163:13 [INFO] [stdout] | [INFO] [stdout] 163 | / if let Ok(val) = ipc.get_property("duration") { [INFO] [stdout] 164 | | if let Some(dur) = val.as_f64() { [INFO] [stdout] ... | [INFO] [stdout] 172 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 163 ~ if let Ok(val) = ipc.get_property("duration") [INFO] [stdout] 164 ~ && let Some(dur) = val.as_f64() { [INFO] [stdout] 165 | // Only update if: [INFO] [stdout] ... [INFO] [stdout] 170 | } [INFO] [stdout] 171 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player_manager.rs:174:13 [INFO] [stdout] | [INFO] [stdout] 174 | / if let Ok(val) = ipc.get_property("pause") { [INFO] [stdout] 175 | | if let Some(paused) = val.as_bool() { [INFO] [stdout] 176 | | self.status.paused = paused; [INFO] [stdout] 177 | | } [INFO] [stdout] 178 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 174 ~ if let Ok(val) = ipc.get_property("pause") [INFO] [stdout] 175 ~ && let Some(paused) = val.as_bool() { [INFO] [stdout] 176 | self.status.paused = paused; [INFO] [stdout] 177 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player_manager.rs:180:13 [INFO] [stdout] | [INFO] [stdout] 180 | / if let Ok(val) = ipc.get_property("volume") { [INFO] [stdout] 181 | | if let Some(vol) = val.as_f64() { [INFO] [stdout] 182 | | self.status.volume = vol as i32; [INFO] [stdout] 183 | | } [INFO] [stdout] 184 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 180 ~ if let Ok(val) = ipc.get_property("volume") [INFO] [stdout] 181 ~ && let Some(vol) = val.as_f64() { [INFO] [stdout] 182 | self.status.volume = vol as i32; [INFO] [stdout] 183 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player_manager.rs:186:13 [INFO] [stdout] | [INFO] [stdout] 186 | / if let Ok(val) = ipc.get_property("eof-reached") { [INFO] [stdout] 187 | | if let Some(eof) = val.as_bool() { [INFO] [stdout] 188 | | self.status.eof_reached = eof; [INFO] [stdout] 189 | | } [INFO] [stdout] 190 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 186 ~ if let Ok(val) = ipc.get_property("eof-reached") [INFO] [stdout] 187 ~ && let Some(eof) = val.as_bool() { [INFO] [stdout] 188 | self.status.eof_reached = eof; [INFO] [stdout] 189 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `app.player_manager` after checking its variant with `is_some` [INFO] [stdout] --> src/ui/events.rs:104:31 [INFO] [stdout] | [INFO] [stdout] 83 | if app.player_manager.is_some() { [INFO] [stdout] | ------------------------------- help: try: `if let Some() = &app.player_manager` [INFO] [stdout] ... [INFO] [stdout] 104 | let new_vol = app.player_manager.as_ref().unwrap().status.volume + 5; [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: called `unwrap` on `app.player_manager` after checking its variant with `is_some` [INFO] [stdout] --> src/ui/events.rs:112:31 [INFO] [stdout] | [INFO] [stdout] 83 | if app.player_manager.is_some() { [INFO] [stdout] | ------------------------------- help: try: `if let Some() = &app.player_manager` [INFO] [stdout] ... [INFO] [stdout] 112 | let new_vol = app.player_manager.as_ref().unwrap().status.volume - 5; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `app.player_manager` after checking its variant with `is_some` [INFO] [stdout] --> src/ui/events.rs:120:35 [INFO] [stdout] | [INFO] [stdout] 83 | if app.player_manager.is_some() { [INFO] [stdout] | ------------------------------- help: try: `if let Some() = &app.player_manager` [INFO] [stdout] ... [INFO] [stdout] 120 | let current_vol = app.player_manager.as_ref().unwrap().status.volume; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/events.rs:141:13 [INFO] [stdout] | [INFO] [stdout] 141 | / if app.selected_index > 0 { [INFO] [stdout] 142 | | app.selected_index -= 1; [INFO] [stdout] 143 | | } [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] 140 ~ (KeyCode::Up, _) [INFO] [stdout] 141 ~ if app.selected_index > 0 => { [INFO] [stdout] 142 | app.selected_index -= 1; [INFO] [stdout] 143 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/events.rs:188:13 [INFO] [stdout] | [INFO] [stdout] 188 | / if let Some(idx) = idx { [INFO] [stdout] 189 | | if idx < app.results.len() { [INFO] [stdout] 190 | | app.pending_action = AppAction::Play(idx); [INFO] [stdout] 191 | | } [INFO] [stdout] 192 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 188 ~ if let Some(idx) = idx [INFO] [stdout] 189 ~ && idx < app.results.len() { [INFO] [stdout] 190 | app.pending_action = AppAction::Play(idx); [INFO] [stdout] 191 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/events.rs:210:13 [INFO] [stdout] | [INFO] [stdout] 210 | / if !app.search_input.is_empty() { [INFO] [stdout] 211 | | // Update query immediately so search bar shows new query [INFO] [stdout] 212 | | app.query = app.search_input.clone(); [INFO] [stdout] 213 | | app.loading = true; [INFO] [stdout] ... | [INFO] [stdout] 216 | | app.focused_panel = FocusedPanel::Results; [INFO] [stdout] 217 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 209 ~ KeyCode::Enter [INFO] [stdout] 210 ~ if !app.search_input.is_empty() => { [INFO] [stdout] 211 | // Update query immediately so search bar shows new query [INFO] [stdout] ... [INFO] [stdout] 216 | app.focused_panel = FocusedPanel::Results; [INFO] [stdout] 217 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/events.rs:230:13 [INFO] [stdout] | [INFO] [stdout] 230 | / if app.queue_selected_index > 0 { [INFO] [stdout] 231 | | app.queue_selected_index -= 1; [INFO] [stdout] 232 | | } [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] 229 ~ KeyCode::Up [INFO] [stdout] 230 ~ if app.queue_selected_index > 0 => { [INFO] [stdout] 231 | app.queue_selected_index -= 1; [INFO] [stdout] 232 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/events.rs:235:13 [INFO] [stdout] | [INFO] [stdout] 235 | / if app.queue_selected_index < app.queue.len().saturating_sub(1) { [INFO] [stdout] 236 | | app.queue_selected_index += 1; [INFO] [stdout] 237 | | } [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] 234 ~ KeyCode::Down [INFO] [stdout] 235 ~ if app.queue_selected_index < app.queue.len().saturating_sub(1) => { [INFO] [stdout] 236 | app.queue_selected_index += 1; [INFO] [stdout] 237 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/events.rs:240:13 [INFO] [stdout] | [INFO] [stdout] 240 | / if !app.queue.is_empty() && app.queue_selected_index < app.queue.len() { [INFO] [stdout] 241 | | if app.queue_selected_index > 0 { [INFO] [stdout] 242 | | app.queue.move_to_front(app.queue_selected_index); [INFO] [stdout] 243 | | app.queue_selected_index = 0; [INFO] [stdout] ... | [INFO] [stdout] 266 | | } [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] 239 ~ KeyCode::Enter [INFO] [stdout] 240 ~ if !app.queue.is_empty() && app.queue_selected_index < app.queue.len() => { [INFO] [stdout] 241 | if app.queue_selected_index > 0 { [INFO] [stdout] ... [INFO] [stdout] 265 | } [INFO] [stdout] 266 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/events.rs:269:13 [INFO] [stdout] | [INFO] [stdout] 269 | / if app.queue_selected_index < app.queue.len() { [INFO] [stdout] 270 | | let removed_video = app.queue.get(app.queue_selected_index).map(|v| v.id.clone()); [INFO] [stdout] 271 | | app.queue.remove(app.queue_selected_index); [INFO] [stdout] ... | [INFO] [stdout] 286 | | } [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] 268 ~ KeyCode::Delete | KeyCode::Backspace [INFO] [stdout] 269 ~ if app.queue_selected_index < app.queue.len() => { [INFO] [stdout] 270 | let removed_video = app.queue.get(app.queue_selected_index).map(|v| v.id.clone()); [INFO] [stdout] ... [INFO] [stdout] 285 | } [INFO] [stdout] 286 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/ui/events.rs:256:25 [INFO] [stdout] | [INFO] [stdout] 256 | / match PlayerManager::new() { [INFO] [stdout] 257 | | Ok(mut pm) => { [INFO] [stdout] 258 | | if pm.play(&url, &title, &video_id).is_ok() { [INFO] [stdout] 259 | | app.player_manager = Some(pm); [INFO] [stdout] ... | [INFO] [stdout] 262 | | Err(_) => {} [INFO] [stdout] 263 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 256 ~ if let Ok(mut pm) = PlayerManager::new() { [INFO] [stdout] 257 + if pm.play(&url, &title, &video_id).is_ok() { [INFO] [stdout] 258 + app.player_manager = Some(pm); [INFO] [stdout] 259 + } [INFO] [stdout] 260 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/events.rs:278:17 [INFO] [stdout] | [INFO] [stdout] 278 | / if let Some(removed_id) = removed_video { [INFO] [stdout] 279 | | if let Some(ref player) = app.player_manager { [INFO] [stdout] 280 | | if player.current_video_id.as_ref() == Some(&removed_id) { [INFO] [stdout] ... | [INFO] [stdout] 285 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 278 ~ if let Some(removed_id) = removed_video [INFO] [stdout] 279 ~ && let Some(ref player) = app.player_manager { [INFO] [stdout] 280 | if player.current_video_id.as_ref() == Some(&removed_id) { [INFO] [stdout] ... [INFO] [stdout] 283 | } [INFO] [stdout] 284 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/events.rs:279:21 [INFO] [stdout] | [INFO] [stdout] 279 | / if let Some(ref player) = app.player_manager { [INFO] [stdout] 280 | | if player.current_video_id.as_ref() == Some(&removed_id) { [INFO] [stdout] 281 | | // Currently playing video was removed, go to next (automatic) [INFO] [stdout] 282 | | app.handle_next_video(false); [INFO] [stdout] 283 | | } [INFO] [stdout] 284 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 279 ~ if let Some(ref player) = app.player_manager [INFO] [stdout] 280 ~ && player.current_video_id.as_ref() == Some(&removed_id) { [INFO] [stdout] 281 | // Currently playing video was removed, go to next (automatic) [INFO] [stdout] 282 | app.handle_next_video(false); [INFO] [stdout] 283 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/events.rs:329:25 [INFO] [stdout] | [INFO] [stdout] 329 | / if c.is_ascii_digit() { [INFO] [stdout] 330 | | if let Some(ref mut input) = app.results_per_page_input { [INFO] [stdout] 331 | | input.push(c); [INFO] [stdout] ... | [INFO] [stdout] 340 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 329 ~ if c.is_ascii_digit() [INFO] [stdout] 330 ~ && let Some(ref mut input) = app.results_per_page_input { [INFO] [stdout] 331 | input.push(c); [INFO] [stdout] ... [INFO] [stdout] 338 | } [INFO] [stdout] 339 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/events.rs:333:33 [INFO] [stdout] | [INFO] [stdout] 333 | / ... if let Ok(new_val) = input.parse::() { [INFO] [stdout] 334 | | ... if new_val <= 999 { // Reasonable upper bound [INFO] [stdout] 335 | | ... app.config.results_per_page = new_val; [INFO] [stdout] 336 | | ... let _ = app.config.save(); [INFO] [stdout] 337 | | ... } [INFO] [stdout] 338 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 333 ~ if let Ok(new_val) = input.parse::() [INFO] [stdout] 334 ~ && new_val <= 999 { // Reasonable upper bound [INFO] [stdout] 335 | app.config.results_per_page = new_val; [INFO] [stdout] 336 | let _ = app.config.save(); [INFO] [stdout] 337 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/events.rs:359:29 [INFO] [stdout] | [INFO] [stdout] 359 | / ... if !input.is_empty() { [INFO] [stdout] 360 | | ... if let Ok(new_val) = input.parse::() { [INFO] [stdout] 361 | | ... app.config.results_per_page = new_val; [INFO] [stdout] 362 | | ... let _ = app.config.save(); [INFO] [stdout] 363 | | ... } [INFO] [stdout] 364 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 359 ~ if !input.is_empty() [INFO] [stdout] 360 ~ && let Ok(new_val) = input.parse::() { [INFO] [stdout] 361 | app.config.results_per_page = new_val; [INFO] [stdout] 362 | let _ = app.config.save(); [INFO] [stdout] 363 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/events.rs:407:13 [INFO] [stdout] | [INFO] [stdout] 407 | / if let Some(pos) = pos { [INFO] [stdout] 408 | | if pos > 0 { [INFO] [stdout] 409 | | app.settings_selected_index = SELECTABLE_INDICES[pos - 1]; [INFO] [stdout] 410 | | } [INFO] [stdout] 411 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 407 ~ if let Some(pos) = pos [INFO] [stdout] 408 ~ && pos > 0 { [INFO] [stdout] 409 | app.settings_selected_index = SELECTABLE_INDICES[pos - 1]; [INFO] [stdout] 410 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/events.rs:418:13 [INFO] [stdout] | [INFO] [stdout] 418 | / if let Some(pos) = pos { [INFO] [stdout] 419 | | if pos < SELECTABLE_INDICES.len() - 1 { [INFO] [stdout] 420 | | app.settings_selected_index = SELECTABLE_INDICES[pos + 1]; [INFO] [stdout] 421 | | } [INFO] [stdout] 422 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 418 ~ if let Some(pos) = pos [INFO] [stdout] 419 ~ && pos < SELECTABLE_INDICES.len() - 1 { [INFO] [stdout] 420 | app.settings_selected_index = SELECTABLE_INDICES[pos + 1]; [INFO] [stdout] 421 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/ui/layout.rs:169:27 [INFO] [stdout] | [INFO] [stdout] 169 | let total_pages = (app.total_results + app.page_size - 1) / app.page_size; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `app.total_results.div_ceil(app.page_size)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/config.rs:136:9 [INFO] [stdout] | [INFO] [stdout] 136 | assert_eq!(config.audio_only, false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] = note: `#[warn(clippy::bool_assert_comparison)]` on by default [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 136 - assert_eq!(config.audio_only, false); [INFO] [stdout] 136 + assert!(!config.audio_only); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/config.rs:137:9 [INFO] [stdout] | [INFO] [stdout] 137 | assert_eq!(config.bandwidth_limit, false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 137 - assert_eq!(config.bandwidth_limit, false); [INFO] [stdout] 137 + assert!(!config.bandwidth_limit); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/config.rs:146:9 [INFO] [stdout] | [INFO] [stdout] 146 | config.audio_only = true; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `config::Config { audio_only: true, bandwidth_limit: false, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/config.rs:145:9 [INFO] [stdout] | [INFO] [stdout] 145 | let mut config = Config::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] = note: `#[warn(clippy::field_reassign_with_default)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/config.rs:155:9 [INFO] [stdout] | [INFO] [stdout] 155 | config.audio_only = false; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `config::Config { audio_only: false, bandwidth_limit: true, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/config.rs:154:9 [INFO] [stdout] | [INFO] [stdout] 154 | let mut config = Config::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/config.rs:164:9 [INFO] [stdout] | [INFO] [stdout] 164 | config.audio_only = true; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `config::Config { audio_only: true, bandwidth_limit: true, ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/config.rs:163:9 [INFO] [stdout] | [INFO] [stdout] 163 | let mut config = Config::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field assignment outside of initializer for an instance created with Default::default() [INFO] [stdout] --> src/config.rs:173:9 [INFO] [stdout] | [INFO] [stdout] 173 | config.custom_format = "custom/format".to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] note: consider initializing the variable with `config::Config { custom_format: "custom/format".to_string(), ..Default::default() }` and removing relevant reassignments [INFO] [stdout] --> src/config.rs:172:9 [INFO] [stdout] | [INFO] [stdout] 172 | let mut config = Config::default(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/config.rs:182:9 [INFO] [stdout] | [INFO] [stdout] 182 | assert_eq!(config.audio_only, false); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 182 - assert_eq!(config.audio_only, false); [INFO] [stdout] 182 + assert!(!config.audio_only); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: used `assert_eq!` with a literal bool [INFO] [stdout] --> src/config.rs:184:9 [INFO] [stdout] | [INFO] [stdout] 184 | assert_eq!(config.audio_only, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_assert_comparison [INFO] [stdout] help: replace it with `assert!(..)` [INFO] [stdout] | [INFO] [stdout] 184 - assert_eq!(config.audio_only, true); [INFO] [stdout] 184 + assert!(config.audio_only); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/ui/layout.rs:779:22 [INFO] [stdout] | [INFO] [stdout] 779 | let is_editing = editing.as_ref().map_or(false, |f| *f == field && is_selected); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 779 - let is_editing = editing.as_ref().map_or(false, |f| *f == field && is_selected); [INFO] [stdout] 779 + let is_editing = editing.as_ref().is_some_and(|f| *f == field && is_selected); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/ui/runner.rs:122:12 [INFO] [stdout] | [INFO] [stdout] 122 | if search.filter_shorts != !app.config.include_shorts { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `search.filter_shorts == app.config.include_shorts` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/runner.rs:130:9 [INFO] [stdout] | [INFO] [stdout] 130 | / if event::poll(timeout)? { [INFO] [stdout] 131 | | if let Event::Key(key) = event::read()? { [INFO] [stdout] 132 | | handle_key_event(&mut app, key); [INFO] [stdout] 133 | | } [INFO] [stdout] 134 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 130 ~ if event::poll(timeout)? [INFO] [stdout] 131 ~ && let Event::Key(key) = event::read()? { [INFO] [stdout] 132 | handle_key_event(&mut app, key); [INFO] [stdout] 133 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `impl` can be derived [INFO] [stdout] --> src/player.rs:17:1 [INFO] [stdout] | [INFO] [stdout] 17 | / impl Default for PlayerType { [INFO] [stdout] 18 | | fn default() -> Self { [INFO] [stdout] 19 | | PlayerType::Mpv [INFO] [stdout] 20 | | } [INFO] [stdout] 21 | | } [INFO] [stdout] | |_^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derivable_impls [INFO] [stdout] = note: `#[warn(clippy::derivable_impls)]` on by default [INFO] [stdout] help: replace the manual implementation with a derive attribute and mark the default variant [INFO] [stdout] | [INFO] [stdout] 11 + #[derive(Default)] [INFO] [stdout] 12 | pub enum PlayerType { [INFO] [stdout] 13 ~ #[default] [INFO] [stdout] 14 ~ Mpv, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/player.rs:82:23 [INFO] [stdout] | [INFO] [stdout] 82 | cmd.arg("-f").arg(&config.format()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `config.format()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: the borrowed expression implements the required traits [INFO] [stdout] --> src/player.rs:152:23 [INFO] [stdout] | [INFO] [stdout] 152 | cmd.arg("-f").arg(&config.format()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: change this to: `config.format()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player.rs:217:13 [INFO] [stdout] | [INFO] [stdout] 217 | / if path.is_file() { [INFO] [stdout] 218 | | if let Some(ext) = path.extension().and_then(|e| e.to_str()) { [INFO] [stdout] 219 | | if ext != "part" && ext != "conf" { [INFO] [stdout] 220 | | best = Some(path); [INFO] [stdout] ... | [INFO] [stdout] 224 | | } [INFO] [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] 217 ~ if path.is_file() [INFO] [stdout] 218 ~ && let Some(ext) = path.extension().and_then(|e| e.to_str()) { [INFO] [stdout] 219 | if ext != "part" && ext != "conf" { [INFO] [stdout] ... [INFO] [stdout] 222 | } [INFO] [stdout] 223 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player.rs:218:17 [INFO] [stdout] | [INFO] [stdout] 218 | / if let Some(ext) = path.extension().and_then(|e| e.to_str()) { [INFO] [stdout] 219 | | if ext != "part" && ext != "conf" { [INFO] [stdout] 220 | | best = Some(path); [INFO] [stdout] 221 | | break; [INFO] [stdout] 222 | | } [INFO] [stdout] 223 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 218 ~ if let Some(ext) = path.extension().and_then(|e| e.to_str()) [INFO] [stdout] 219 ~ && ext != "part" && ext != "conf" { [INFO] [stdout] 220 | best = Some(path); [INFO] [stdout] 221 | break; [INFO] [stdout] 222 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player_manager.rs:154:13 [INFO] [stdout] | [INFO] [stdout] 154 | / if let Ok(val) = ipc.get_property("time-pos") { [INFO] [stdout] 155 | | if let Some(time) = val.as_f64() { [INFO] [stdout] 156 | | self.status.time_pos = time; [INFO] [stdout] 157 | | } [INFO] [stdout] 158 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 154 ~ if let Ok(val) = ipc.get_property("time-pos") [INFO] [stdout] 155 ~ && let Some(time) = val.as_f64() { [INFO] [stdout] 156 | self.status.time_pos = time; [INFO] [stdout] 157 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player_manager.rs:163:13 [INFO] [stdout] | [INFO] [stdout] 163 | / if let Ok(val) = ipc.get_property("duration") { [INFO] [stdout] 164 | | if let Some(dur) = val.as_f64() { [INFO] [stdout] ... | [INFO] [stdout] 172 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 163 ~ if let Ok(val) = ipc.get_property("duration") [INFO] [stdout] 164 ~ && let Some(dur) = val.as_f64() { [INFO] [stdout] 165 | // Only update if: [INFO] [stdout] ... [INFO] [stdout] 170 | } [INFO] [stdout] 171 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player_manager.rs:174:13 [INFO] [stdout] | [INFO] [stdout] 174 | / if let Ok(val) = ipc.get_property("pause") { [INFO] [stdout] 175 | | if let Some(paused) = val.as_bool() { [INFO] [stdout] 176 | | self.status.paused = paused; [INFO] [stdout] 177 | | } [INFO] [stdout] 178 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 174 ~ if let Ok(val) = ipc.get_property("pause") [INFO] [stdout] 175 ~ && let Some(paused) = val.as_bool() { [INFO] [stdout] 176 | self.status.paused = paused; [INFO] [stdout] 177 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player_manager.rs:180:13 [INFO] [stdout] | [INFO] [stdout] 180 | / if let Ok(val) = ipc.get_property("volume") { [INFO] [stdout] 181 | | if let Some(vol) = val.as_f64() { [INFO] [stdout] 182 | | self.status.volume = vol as i32; [INFO] [stdout] 183 | | } [INFO] [stdout] 184 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 180 ~ if let Ok(val) = ipc.get_property("volume") [INFO] [stdout] 181 ~ && let Some(vol) = val.as_f64() { [INFO] [stdout] 182 | self.status.volume = vol as i32; [INFO] [stdout] 183 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/player_manager.rs:186:13 [INFO] [stdout] | [INFO] [stdout] 186 | / if let Ok(val) = ipc.get_property("eof-reached") { [INFO] [stdout] 187 | | if let Some(eof) = val.as_bool() { [INFO] [stdout] 188 | | self.status.eof_reached = eof; [INFO] [stdout] 189 | | } [INFO] [stdout] 190 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 186 ~ if let Ok(val) = ipc.get_property("eof-reached") [INFO] [stdout] 187 ~ && let Some(eof) = val.as_bool() { [INFO] [stdout] 188 | self.status.eof_reached = eof; [INFO] [stdout] 189 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `app.player_manager` after checking its variant with `is_some` [INFO] [stdout] --> src/ui/events.rs:104:31 [INFO] [stdout] | [INFO] [stdout] 83 | if app.player_manager.is_some() { [INFO] [stdout] | ------------------------------- help: try: `if let Some() = &app.player_manager` [INFO] [stdout] ... [INFO] [stdout] 104 | let new_vol = app.player_manager.as_ref().unwrap().status.volume + 5; [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: called `unwrap` on `app.player_manager` after checking its variant with `is_some` [INFO] [stdout] --> src/ui/events.rs:112:31 [INFO] [stdout] | [INFO] [stdout] 83 | if app.player_manager.is_some() { [INFO] [stdout] | ------------------------------- help: try: `if let Some() = &app.player_manager` [INFO] [stdout] ... [INFO] [stdout] 112 | let new_vol = app.player_manager.as_ref().unwrap().status.volume - 5; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `app.player_manager` after checking its variant with `is_some` [INFO] [stdout] --> src/ui/events.rs:120:35 [INFO] [stdout] | [INFO] [stdout] 83 | if app.player_manager.is_some() { [INFO] [stdout] | ------------------------------- help: try: `if let Some() = &app.player_manager` [INFO] [stdout] ... [INFO] [stdout] 120 | let current_vol = app.player_manager.as_ref().unwrap().status.volume; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/events.rs:141:13 [INFO] [stdout] | [INFO] [stdout] 141 | / if app.selected_index > 0 { [INFO] [stdout] 142 | | app.selected_index -= 1; [INFO] [stdout] 143 | | } [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] 140 ~ (KeyCode::Up, _) [INFO] [stdout] 141 ~ if app.selected_index > 0 => { [INFO] [stdout] 142 | app.selected_index -= 1; [INFO] [stdout] 143 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/events.rs:188:13 [INFO] [stdout] | [INFO] [stdout] 188 | / if let Some(idx) = idx { [INFO] [stdout] 189 | | if idx < app.results.len() { [INFO] [stdout] 190 | | app.pending_action = AppAction::Play(idx); [INFO] [stdout] 191 | | } [INFO] [stdout] 192 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 188 ~ if let Some(idx) = idx [INFO] [stdout] 189 ~ && idx < app.results.len() { [INFO] [stdout] 190 | app.pending_action = AppAction::Play(idx); [INFO] [stdout] 191 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/events.rs:210:13 [INFO] [stdout] | [INFO] [stdout] 210 | / if !app.search_input.is_empty() { [INFO] [stdout] 211 | | // Update query immediately so search bar shows new query [INFO] [stdout] 212 | | app.query = app.search_input.clone(); [INFO] [stdout] 213 | | app.loading = true; [INFO] [stdout] ... | [INFO] [stdout] 216 | | app.focused_panel = FocusedPanel::Results; [INFO] [stdout] 217 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 209 ~ KeyCode::Enter [INFO] [stdout] 210 ~ if !app.search_input.is_empty() => { [INFO] [stdout] 211 | // Update query immediately so search bar shows new query [INFO] [stdout] ... [INFO] [stdout] 216 | app.focused_panel = FocusedPanel::Results; [INFO] [stdout] 217 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/events.rs:230:13 [INFO] [stdout] | [INFO] [stdout] 230 | / if app.queue_selected_index > 0 { [INFO] [stdout] 231 | | app.queue_selected_index -= 1; [INFO] [stdout] 232 | | } [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] 229 ~ KeyCode::Up [INFO] [stdout] 230 ~ if app.queue_selected_index > 0 => { [INFO] [stdout] 231 | app.queue_selected_index -= 1; [INFO] [stdout] 232 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/events.rs:235:13 [INFO] [stdout] | [INFO] [stdout] 235 | / if app.queue_selected_index < app.queue.len().saturating_sub(1) { [INFO] [stdout] 236 | | app.queue_selected_index += 1; [INFO] [stdout] 237 | | } [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] 234 ~ KeyCode::Down [INFO] [stdout] 235 ~ if app.queue_selected_index < app.queue.len().saturating_sub(1) => { [INFO] [stdout] 236 | app.queue_selected_index += 1; [INFO] [stdout] 237 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/events.rs:240:13 [INFO] [stdout] | [INFO] [stdout] 240 | / if !app.queue.is_empty() && app.queue_selected_index < app.queue.len() { [INFO] [stdout] 241 | | if app.queue_selected_index > 0 { [INFO] [stdout] 242 | | app.queue.move_to_front(app.queue_selected_index); [INFO] [stdout] 243 | | app.queue_selected_index = 0; [INFO] [stdout] ... | [INFO] [stdout] 266 | | } [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] 239 ~ KeyCode::Enter [INFO] [stdout] 240 ~ if !app.queue.is_empty() && app.queue_selected_index < app.queue.len() => { [INFO] [stdout] 241 | if app.queue_selected_index > 0 { [INFO] [stdout] ... [INFO] [stdout] 265 | } [INFO] [stdout] 266 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/ui/events.rs:269:13 [INFO] [stdout] | [INFO] [stdout] 269 | / if app.queue_selected_index < app.queue.len() { [INFO] [stdout] 270 | | let removed_video = app.queue.get(app.queue_selected_index).map(|v| v.id.clone()); [INFO] [stdout] 271 | | app.queue.remove(app.queue_selected_index); [INFO] [stdout] ... | [INFO] [stdout] 286 | | } [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] 268 ~ KeyCode::Delete | KeyCode::Backspace [INFO] [stdout] 269 ~ if app.queue_selected_index < app.queue.len() => { [INFO] [stdout] 270 | let removed_video = app.queue.get(app.queue_selected_index).map(|v| v.id.clone()); [INFO] [stdout] ... [INFO] [stdout] 285 | } [INFO] [stdout] 286 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/ui/events.rs:256:25 [INFO] [stdout] | [INFO] [stdout] 256 | / match PlayerManager::new() { [INFO] [stdout] 257 | | Ok(mut pm) => { [INFO] [stdout] 258 | | if pm.play(&url, &title, &video_id).is_ok() { [INFO] [stdout] 259 | | app.player_manager = Some(pm); [INFO] [stdout] ... | [INFO] [stdout] 262 | | Err(_) => {} [INFO] [stdout] 263 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 256 ~ if let Ok(mut pm) = PlayerManager::new() { [INFO] [stdout] 257 + if pm.play(&url, &title, &video_id).is_ok() { [INFO] [stdout] 258 + app.player_manager = Some(pm); [INFO] [stdout] 259 + } [INFO] [stdout] 260 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/events.rs:278:17 [INFO] [stdout] | [INFO] [stdout] 278 | / if let Some(removed_id) = removed_video { [INFO] [stdout] 279 | | if let Some(ref player) = app.player_manager { [INFO] [stdout] 280 | | if player.current_video_id.as_ref() == Some(&removed_id) { [INFO] [stdout] ... | [INFO] [stdout] 285 | | } [INFO] [stdout] | |_________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 278 ~ if let Some(removed_id) = removed_video [INFO] [stdout] 279 ~ && let Some(ref player) = app.player_manager { [INFO] [stdout] 280 | if player.current_video_id.as_ref() == Some(&removed_id) { [INFO] [stdout] ... [INFO] [stdout] 283 | } [INFO] [stdout] 284 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/events.rs:279:21 [INFO] [stdout] | [INFO] [stdout] 279 | / if let Some(ref player) = app.player_manager { [INFO] [stdout] 280 | | if player.current_video_id.as_ref() == Some(&removed_id) { [INFO] [stdout] 281 | | // Currently playing video was removed, go to next (automatic) [INFO] [stdout] 282 | | app.handle_next_video(false); [INFO] [stdout] 283 | | } [INFO] [stdout] 284 | | } [INFO] [stdout] | |_____________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 279 ~ if let Some(ref player) = app.player_manager [INFO] [stdout] 280 ~ && player.current_video_id.as_ref() == Some(&removed_id) { [INFO] [stdout] 281 | // Currently playing video was removed, go to next (automatic) [INFO] [stdout] 282 | app.handle_next_video(false); [INFO] [stdout] 283 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/events.rs:329:25 [INFO] [stdout] | [INFO] [stdout] 329 | / if c.is_ascii_digit() { [INFO] [stdout] 330 | | if let Some(ref mut input) = app.results_per_page_input { [INFO] [stdout] 331 | | input.push(c); [INFO] [stdout] ... | [INFO] [stdout] 340 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 329 ~ if c.is_ascii_digit() [INFO] [stdout] 330 ~ && let Some(ref mut input) = app.results_per_page_input { [INFO] [stdout] 331 | input.push(c); [INFO] [stdout] ... [INFO] [stdout] 338 | } [INFO] [stdout] 339 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/events.rs:333:33 [INFO] [stdout] | [INFO] [stdout] 333 | / ... if let Ok(new_val) = input.parse::() { [INFO] [stdout] 334 | | ... if new_val <= 999 { // Reasonable upper bound [INFO] [stdout] 335 | | ... app.config.results_per_page = new_val; [INFO] [stdout] 336 | | ... let _ = app.config.save(); [INFO] [stdout] 337 | | ... } [INFO] [stdout] 338 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 333 ~ if let Ok(new_val) = input.parse::() [INFO] [stdout] 334 ~ && new_val <= 999 { // Reasonable upper bound [INFO] [stdout] 335 | app.config.results_per_page = new_val; [INFO] [stdout] 336 | let _ = app.config.save(); [INFO] [stdout] 337 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/events.rs:359:29 [INFO] [stdout] | [INFO] [stdout] 359 | / ... if !input.is_empty() { [INFO] [stdout] 360 | | ... if let Ok(new_val) = input.parse::() { [INFO] [stdout] 361 | | ... app.config.results_per_page = new_val; [INFO] [stdout] 362 | | ... let _ = app.config.save(); [INFO] [stdout] 363 | | ... } [INFO] [stdout] 364 | | ... } [INFO] [stdout] | |_______________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 359 ~ if !input.is_empty() [INFO] [stdout] 360 ~ && let Ok(new_val) = input.parse::() { [INFO] [stdout] 361 | app.config.results_per_page = new_val; [INFO] [stdout] 362 | let _ = app.config.save(); [INFO] [stdout] 363 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/events.rs:407:13 [INFO] [stdout] | [INFO] [stdout] 407 | / if let Some(pos) = pos { [INFO] [stdout] 408 | | if pos > 0 { [INFO] [stdout] 409 | | app.settings_selected_index = SELECTABLE_INDICES[pos - 1]; [INFO] [stdout] 410 | | } [INFO] [stdout] 411 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 407 ~ if let Some(pos) = pos [INFO] [stdout] 408 ~ && pos > 0 { [INFO] [stdout] 409 | app.settings_selected_index = SELECTABLE_INDICES[pos - 1]; [INFO] [stdout] 410 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/events.rs:418:13 [INFO] [stdout] | [INFO] [stdout] 418 | / if let Some(pos) = pos { [INFO] [stdout] 419 | | if pos < SELECTABLE_INDICES.len() - 1 { [INFO] [stdout] 420 | | app.settings_selected_index = SELECTABLE_INDICES[pos + 1]; [INFO] [stdout] 421 | | } [INFO] [stdout] 422 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 418 ~ if let Some(pos) = pos [INFO] [stdout] 419 ~ && pos < SELECTABLE_INDICES.len() - 1 { [INFO] [stdout] 420 | app.settings_selected_index = SELECTABLE_INDICES[pos + 1]; [INFO] [stdout] 421 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manually reimplementing `div_ceil` [INFO] [stdout] --> src/ui/layout.rs:169:27 [INFO] [stdout] | [INFO] [stdout] 169 | let total_pages = (app.total_results + app.page_size - 1) / app.page_size; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using `.div_ceil()`: `app.total_results.div_ceil(app.page_size)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_div_ceil [INFO] [stdout] = note: `#[warn(clippy::manual_div_ceil)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `map_or` can be simplified [INFO] [stdout] --> src/ui/layout.rs:779:22 [INFO] [stdout] | [INFO] [stdout] 779 | let is_editing = editing.as_ref().map_or(false, |f| *f == field && is_selected); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or [INFO] [stdout] = note: `#[warn(clippy::unnecessary_map_or)]` on by default [INFO] [stdout] help: use `is_some_and` instead [INFO] [stdout] | [INFO] [stdout] 779 - let is_editing = editing.as_ref().map_or(false, |f| *f == field && is_selected); [INFO] [stdout] 779 + let is_editing = editing.as_ref().is_some_and(|f| *f == field && is_selected); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/ui/runner.rs:122:12 [INFO] [stdout] | [INFO] [stdout] 122 | if search.filter_shorts != !app.config.include_shorts { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `search.filter_shorts == app.config.include_shorts` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/ui/runner.rs:130:9 [INFO] [stdout] | [INFO] [stdout] 130 | / if event::poll(timeout)? { [INFO] [stdout] 131 | | if let Event::Key(key) = event::read()? { [INFO] [stdout] 132 | | handle_key_event(&mut app, key); [INFO] [stdout] 133 | | } [INFO] [stdout] 134 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 130 ~ if event::poll(timeout)? [INFO] [stdout] 131 ~ && let Event::Key(key) = event::read()? { [INFO] [stdout] 132 | handle_key_event(&mut app, key); [INFO] [stdout] 133 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 19.74s [INFO] running `Command { std: "docker" "inspect" "709f3f6ec9c4d496d840c7c8b33c437d86d92aee062d25e954a666626a873d5a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "709f3f6ec9c4d496d840c7c8b33c437d86d92aee062d25e954a666626a873d5a", kill_on_drop: false }` [INFO] [stdout] 709f3f6ec9c4d496d840c7c8b33c437d86d92aee062d25e954a666626a873d5a