[INFO] cloning repository https://github.com/pneumaea/foil [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/pneumaea/foil" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpneumaea%2Ffoil", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpneumaea%2Ffoil'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 4f61a4916626a29f7f787155634e8790fc1e3e01 [INFO] linting pneumaea/foil against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fpneumaea%2Ffoil" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/pneumaea/foil [INFO] finished tweaking git repo https://github.com/pneumaea/foil [INFO] tweaked toml for git repo https://github.com/pneumaea/foil written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/pneumaea/foil 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/pneumaea/foil 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 lru v0.12.2 [INFO] [stderr] Downloaded custom_error v1.9.2 [INFO] [stderr] Downloaded syntect-tui v3.0.6 [INFO] [stderr] Downloaded indoc v2.0.4 [INFO] [stderr] Downloaded quick-xml v0.32.0 [INFO] [stderr] Downloaded plist v1.7.1 [INFO] [stderr] Downloaded rustix v0.38.39 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] b64aac2809594d53d7de40f81e6b726101714075ad25c6dff075a77b9004d12d [INFO] running `Command { std: "docker" "start" "-a" "b64aac2809594d53d7de40f81e6b726101714075ad25c6dff075a77b9004d12d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "b64aac2809594d53d7de40f81e6b726101714075ad25c6dff075a77b9004d12d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "b64aac2809594d53d7de40f81e6b726101714075ad25c6dff075a77b9004d12d", kill_on_drop: false }` [INFO] [stdout] b64aac2809594d53d7de40f81e6b726101714075ad25c6dff075a77b9004d12d [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:d429b63d4308055ea97f60fb1d3dfca48854a00942f1bd2ad806beaf015945ec" "/opt/rustwide/cargo-home/bin/cargo" "+nightly" "clippy" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 927de3e3e81f7c3f0affa997131969b38d9f4265130ef2f9ec6cc034499ff225 [INFO] running `Command { std: "docker" "start" "-a" "927de3e3e81f7c3f0affa997131969b38d9f4265130ef2f9ec6cc034499ff225", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.78 [INFO] [stderr] Compiling libc v0.2.161 [INFO] [stderr] Checking memchr v2.7.1 [INFO] [stderr] Compiling rustversion v1.0.14 [INFO] [stderr] Checking futures-core v0.3.31 [INFO] [stderr] Compiling serde v1.0.210 [INFO] [stderr] Checking itoa v1.0.10 [INFO] [stderr] Checking bitflags v2.4.2 [INFO] [stderr] Compiling ahash v0.8.7 [INFO] [stderr] Checking num_threads v0.1.7 [INFO] [stderr] Checking ryu v1.0.16 [INFO] [stderr] Checking deranged v0.4.0 [INFO] [stderr] Checking time-core v0.1.4 [INFO] [stderr] Compiling rustix v0.38.39 [INFO] [stderr] Compiling serde_json v1.0.140 [INFO] [stderr] Checking hashbrown v0.15.3 [INFO] [stderr] Checking either v1.9.0 [INFO] [stderr] Compiling thiserror v1.0.65 [INFO] [stderr] Checking futures-channel v0.3.31 [INFO] [stderr] Checking itertools v0.13.0 [INFO] [stderr] Checking miniz_oxide v0.8.8 [INFO] [stderr] Checking unicode-segmentation v1.10.1 [INFO] [stderr] Checking unicode-width v0.1.11 [INFO] [stderr] Checking hashbrown v0.14.3 [INFO] [stderr] Checking yaml-rust v0.4.5 [INFO] [stderr] Compiling indoc v2.0.4 [INFO] [stderr] Checking quick-xml v0.32.0 [INFO] [stderr] Checking aho-corasick v1.1.3 [INFO] [stderr] Checking custom_error v1.9.2 [INFO] [stderr] Checking flate2 v1.1.1 [INFO] [stderr] Compiling cc v1.0.83 [INFO] [stderr] Checking indexmap v2.9.0 [INFO] [stderr] Compiling quote v1.0.35 [INFO] [stderr] Checking lru v0.12.2 [INFO] [stderr] Checking castaway v0.2.3 [INFO] [stderr] Checking compact_str v0.8.0 [INFO] [stderr] Checking unicode-truncate v1.1.0 [INFO] [stderr] Compiling syn v2.0.58 [INFO] [stderr] Checking signal-hook-registry v1.4.1 [INFO] [stderr] Checking parking_lot_core v0.9.9 [INFO] [stderr] Checking mio v1.0.2 [INFO] [stderr] Checking time v0.3.41 [INFO] [stderr] Checking socket2 v0.5.5 [INFO] [stderr] Checking signal-hook v0.3.17 [INFO] [stderr] Checking parking_lot v0.12.1 [INFO] [stderr] Checking regex-automata v0.4.9 [INFO] [stderr] Checking signal-hook-mio v0.2.4 [INFO] [stderr] Checking crossterm v0.28.1 [INFO] [stderr] Compiling onig_sys v69.9.1 [INFO] [stderr] Checking plist v1.7.1 [INFO] [stderr] Checking bincode v1.3.3 [INFO] [stderr] Checking regex v1.11.1 [INFO] [stderr] Compiling strum_macros v0.26.4 [INFO] [stderr] Compiling thiserror-impl v1.0.65 [INFO] [stderr] Compiling futures-macro v0.3.31 [INFO] [stderr] Compiling serde_derive v1.0.210 [INFO] [stderr] Compiling instability v0.3.2 [INFO] [stderr] Compiling tokio-macros v2.4.0 [INFO] [stderr] Checking tokio v1.41.0 [INFO] [stderr] Checking onig v6.5.1 [INFO] [stderr] Checking futures-util v0.3.31 [INFO] [stderr] Checking strum v0.26.3 [INFO] [stderr] Checking ratatui v0.29.0 [INFO] [stderr] Checking syntect v5.2.0 [INFO] [stderr] Checking futures-executor v0.3.31 [INFO] [stderr] Checking futures v0.3.31 [INFO] [stderr] Checking syntect-tui v3.0.6 [INFO] [stderr] Checking foil v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/app.rs:78:13 [INFO] [stdout] | [INFO] [stdout] 78 | buffer_storage: buffer_storage, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `buffer_storage` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant field names in struct initialization [INFO] [stdout] --> src/app.rs:78:13 [INFO] [stdout] | [INFO] [stdout] 78 | buffer_storage: buffer_storage, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `buffer_storage` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stdout] = note: `#[warn(clippy::redundant_field_names)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/app.rs:146:9 [INFO] [stdout] | [INFO] [stdout] 146 | / match view { [INFO] [stdout] 147 | | Some(mut view) => { [INFO] [stdout] 148 | | if identifier.trim().is_empty() { [INFO] [stdout] 149 | | view.add_file(line, FileType::File); [INFO] [stdout] ... | [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#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 146 ~ if let Some(mut view) = view { [INFO] [stdout] 147 + if identifier.trim().is_empty() { [INFO] [stdout] 148 + view.add_file(line, FileType::File); [INFO] [stdout] 149 + } else { [INFO] [stdout] 150 + view.set_name(&identifier, line); [INFO] [stdout] 151 + } [INFO] [stdout] 152 + [INFO] [stdout] 153 + self.buffer_storage [INFO] [stdout] 154 + .update_view(&self.path.get_absolute_path(), view); [INFO] [stdout] 155 + } [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/app.rs:178:9 [INFO] [stdout] | [INFO] [stdout] 178 | / match view { [INFO] [stdout] 179 | | Some(mut view) => { [INFO] [stdout] 180 | | view.set_name(&identifier, line); [INFO] [stdout] 181 | | self.buffer_storage [INFO] [stdout] ... | [INFO] [stdout] 184 | | _ => {} [INFO] [stdout] 185 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 178 ~ if let Some(mut view) = view { [INFO] [stdout] 179 + view.set_name(&identifier, line); [INFO] [stdout] 180 + self.buffer_storage [INFO] [stdout] 181 + .update_view(&self.path.get_absolute_path(), view); [INFO] [stdout] 182 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/app.rs:296:18 [INFO] [stdout] | [INFO] [stdout] 296 | .map(|line| String::from(line)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `String::from` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/app.rs:333:13 [INFO] [stdout] | [INFO] [stdout] 333 | &line1, // idk why but this works [INFO] [stdout] | ^^^^^^ help: change this to: `line1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/app.rs:366:26 [INFO] [stdout] | [INFO] [stdout] 366 | let line = lines[y as usize]; [INFO] [stdout] | ^^^^^^^^^^ help: try: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/app.rs:372:30 [INFO] [stdout] | [INFO] [stdout] 372 | let filename = &line[0 as usize..]; [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/event.rs:90:29 [INFO] [stdout] | [INFO] [stdout] 90 | .ok_or(Box::new(std::io::Error::new( [INFO] [stdout] | _____________________________^ [INFO] [stdout] 91 | | std::io::ErrorKind::Other, [INFO] [stdout] 92 | | "This is an IO error", [INFO] [stdout] 93 | | ))) [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] = note: `#[warn(clippy::io_other_error)]` on by default [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 90 ~ .ok_or(Box::new(std::io::Error::other( [INFO] [stdout] 91 ~ "This is an IO error", [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/handler.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 18 | / let result = match app.mode { [INFO] [stdout] 19 | | Mode::Normal => handle_normal_mode(key_event, app), [INFO] [stdout] 20 | | Mode::Insert => handle_insert_mode(key_event, app), [INFO] [stdout] 21 | | Mode::Command => handle_command_mode(key_event, app), [INFO] [stdout] ... | [INFO] [stdout] 25 | | Mode::Pending => handle_pending_mode(key_event, app), [INFO] [stdout] 26 | | }; [INFO] [stdout] | |______- unnecessary `let` binding [INFO] [stdout] 27 | [INFO] [stdout] 28 | result [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 18 ~ [INFO] [stdout] 19 | [INFO] [stdout] 20 ~ match app.mode { [INFO] [stdout] 21 + Mode::Normal => handle_normal_mode(key_event, app), [INFO] [stdout] 22 + Mode::Insert => handle_insert_mode(key_event, app), [INFO] [stdout] 23 + Mode::Command => handle_command_mode(key_event, app), [INFO] [stdout] 24 + Mode::Visual => handle_visual_mode(key_event, app), [INFO] [stdout] 25 + Mode::VisualBlock => handle_visual_block_mode(key_event, app), [INFO] [stdout] 26 + Mode::VisualLine => handle_visual_line_mode(key_event, app), [INFO] [stdout] 27 + Mode::Pending => handle_pending_mode(key_event, app), [INFO] [stdout] 28 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/handler.rs:42:8 [INFO] [stdout] | [INFO] [stdout] 42 | if (buffer_empty && is_valid_init) || (!buffer_empty) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 42 - if (buffer_empty && is_valid_init) || (!buffer_empty) { [INFO] [stdout] 42 + if !(buffer_empty && !is_valid_init) { [INFO] [stdout] | [INFO] [stdout] 42 - if (buffer_empty && is_valid_init) || (!buffer_empty) { [INFO] [stdout] 42 + if !buffer_empty || is_valid_init { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/handler.rs:122:34 [INFO] [stdout] | [INFO] [stdout] 122 | app.cursor.y.try_into().unwrap_or(0) - 2, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `u16` to `usize` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fallible_conversions)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 122 - app.cursor.y.try_into().unwrap_or(0) - 2, [INFO] [stdout] 122 + app.cursor.y.into().unwrap_or(0) - 2, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/handler.rs:123:34 [INFO] [stdout] | [INFO] [stdout] 123 | app.cursor.y.try_into().unwrap_or(0) - 1, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `u16` to `usize` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 123 - app.cursor.y.try_into().unwrap_or(0) - 1, [INFO] [stdout] 123 + app.cursor.y.into().unwrap_or(0) - 1, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:167:21 [INFO] [stdout] | [INFO] [stdout] 167 | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] = note: `#[warn(clippy::let_unit_value)]` on by default [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 167 - let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 167 + app.set_mode(Mode::Normal)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/handler.rs:190:20 [INFO] [stdout] | [INFO] [stdout] 190 | if cmd.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!cmd.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/handler.rs:207:36 [INFO] [stdout] | [INFO] [stdout] 207 | if code.len() != 1 || !code.chars().nth(0).unwrap_or(' ').is_alphanumeric() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `code.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> src/handler.rs:217:5 [INFO] [stdout] | [INFO] [stdout] 217 | / match key_event.code { [INFO] [stdout] 218 | | _ => {} [INFO] [stdout] 219 | | }; [INFO] [stdout] | |_____^ help: consider using the match body instead: `{}` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/handler.rs:225:5 [INFO] [stdout] | [INFO] [stdout] 225 | / match key_event.code { [INFO] [stdout] 226 | | KeyCode::Esc => { [INFO] [stdout] 227 | | app.cursor.left(); [INFO] [stdout] 228 | | app.set_mode(Mode::Normal)?; [INFO] [stdout] ... | [INFO] [stdout] 231 | | _ => {} [INFO] [stdout] 232 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 225 ~ if key_event.code == KeyCode::Esc { [INFO] [stdout] 226 + app.cursor.left(); [INFO] [stdout] 227 + app.set_mode(Mode::Normal)?; [INFO] [stdout] 228 + let _ = execute!(std::io::stdout(), SetCursorStyle::SteadyBlock); [INFO] [stdout] 229 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/handler.rs:238:5 [INFO] [stdout] | [INFO] [stdout] 238 | / match key_event.code { [INFO] [stdout] 239 | | KeyCode::Esc => { [INFO] [stdout] 240 | | app.cursor.left(); [INFO] [stdout] 241 | | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 242 | | } [INFO] [stdout] 243 | | _ => {} [INFO] [stdout] 244 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 238 ~ if key_event.code == KeyCode::Esc { [INFO] [stdout] 239 + app.cursor.left(); [INFO] [stdout] 240 + let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 241 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:241:13 [INFO] [stdout] | [INFO] [stdout] 241 | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 241 - let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 241 + app.set_mode(Mode::Normal)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/handler.rs:250:5 [INFO] [stdout] | [INFO] [stdout] 250 | / match key_event.code { [INFO] [stdout] 251 | | KeyCode::Esc => { [INFO] [stdout] 252 | | app.cursor.left(); [INFO] [stdout] 253 | | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 254 | | } [INFO] [stdout] 255 | | _ => {} [INFO] [stdout] 256 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 250 ~ if key_event.code == KeyCode::Esc { [INFO] [stdout] 251 + app.cursor.left(); [INFO] [stdout] 252 + let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 253 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:253:13 [INFO] [stdout] | [INFO] [stdout] 253 | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 253 - let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 253 + app.set_mode(Mode::Normal)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:265:13 [INFO] [stdout] | [INFO] [stdout] 265 | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 265 - let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 265 + app.set_mode(Mode::Normal)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:282:5 [INFO] [stdout] | [INFO] [stdout] 282 | let _ = app.set_mode(Mode::Pending)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 282 - let _ = app.set_mode(Mode::Pending)?; [INFO] [stdout] 282 + app.set_mode(Mode::Pending)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:293:9 [INFO] [stdout] | [INFO] [stdout] 293 | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 293 - let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 293 + app.set_mode(Mode::Normal)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:358:13 [INFO] [stdout] | [INFO] [stdout] 358 | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 358 - let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 358 + app.set_mode(Mode::Normal)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:363:13 [INFO] [stdout] | [INFO] [stdout] 363 | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 363 - let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 363 + app.set_mode(Mode::Normal)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:369:13 [INFO] [stdout] | [INFO] [stdout] 369 | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 369 - let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 369 + app.set_mode(Mode::Normal)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/handler.rs:392:9 [INFO] [stdout] | [INFO] [stdout] 392 | name = name + "/"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `name += "/"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ui.rs:32:60 [INFO] [stdout] | [INFO] [stdout] 32 | let footer = render_utils::get_footer(&bordered_block, &app); [INFO] [stdout] | ^^^^ help: change this to: `app` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` [INFO] [stdout] --> src/app.rs:146:9 [INFO] [stdout] | [INFO] [stdout] 146 | / match view { [INFO] [stdout] 147 | | Some(mut view) => { [INFO] [stdout] 148 | | if identifier.trim().is_empty() { [INFO] [stdout] 149 | | view.add_file(line, FileType::File); [INFO] [stdout] ... | [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#single_match [INFO] [stdout] = note: `#[warn(clippy::single_match)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 146 ~ if let Some(mut view) = view { [INFO] [stdout] 147 + if identifier.trim().is_empty() { [INFO] [stdout] 148 + view.add_file(line, FileType::File); [INFO] [stdout] 149 + } else { [INFO] [stdout] 150 + view.set_name(&identifier, line); [INFO] [stdout] 151 + } [INFO] [stdout] 152 + [INFO] [stdout] 153 + self.buffer_storage [INFO] [stdout] 154 + .update_view(&self.path.get_absolute_path(), view); [INFO] [stdout] 155 + } [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/app.rs:178:9 [INFO] [stdout] | [INFO] [stdout] 178 | / match view { [INFO] [stdout] 179 | | Some(mut view) => { [INFO] [stdout] 180 | | view.set_name(&identifier, line); [INFO] [stdout] 181 | | self.buffer_storage [INFO] [stdout] ... | [INFO] [stdout] 184 | | _ => {} [INFO] [stdout] 185 | | } [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 178 ~ if let Some(mut view) = view { [INFO] [stdout] 179 + view.set_name(&identifier, line); [INFO] [stdout] 180 + self.buffer_storage [INFO] [stdout] 181 + .update_view(&self.path.get_absolute_path(), view); [INFO] [stdout] 182 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant closure [INFO] [stdout] --> src/app.rs:296:18 [INFO] [stdout] | [INFO] [stdout] 296 | .map(|line| String::from(line)) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the associated function itself: `String::from` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_closure [INFO] [stdout] = note: `#[warn(clippy::redundant_closure)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/utils/buffer_storage.rs:90:18 [INFO] [stdout] | [INFO] [stdout] 90 | dir: String::from(dir), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/app.rs:333:13 [INFO] [stdout] | [INFO] [stdout] 333 | &line1, // idk why but this works [INFO] [stdout] | ^^^^^^ help: change this to: `line1` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting to the same type is unnecessary (`usize` -> `usize`) [INFO] [stdout] --> src/app.rs:366:26 [INFO] [stdout] | [INFO] [stdout] 366 | let line = lines[y as usize]; [INFO] [stdout] | ^^^^^^^^^^ help: try: `y` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] = note: `#[warn(clippy::unnecessary_cast)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: casting integer literal to `usize` is unnecessary [INFO] [stdout] --> src/app.rs:372:30 [INFO] [stdout] | [INFO] [stdout] 372 | let filename = &line[0 as usize..]; [INFO] [stdout] | ^^^^^^^^^^ help: try: `0_usize` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/utils/buffer_storage.rs:209:9 [INFO] [stdout] | [INFO] [stdout] 209 | / if let Some(file) = self.files.get(name) { [INFO] [stdout] 210 | | Some((file.original_dir.clone(), file.dir.clone())) [INFO] [stdout] 211 | | } else { [INFO] [stdout] 212 | | None [INFO] [stdout] 213 | | } [INFO] [stdout] | |_________^ help: try: `self.files.get(name).map(|file| (file.original_dir.clone(), file.dir.clone()))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/utils/buffer_storage.rs:216:9 [INFO] [stdout] | [INFO] [stdout] 216 | / if let Some(file) = self.files.get(name) { [INFO] [stdout] 217 | | Some((file.original_name.clone(), file.name.clone())) [INFO] [stdout] 218 | | } else { [INFO] [stdout] 219 | | None [INFO] [stdout] 220 | | } [INFO] [stdout] | |_________^ help: try: `self.files.get(name).map(|file| (file.original_name.clone(), file.name.clone()))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `BufferStorage` [INFO] [stdout] --> src/utils/buffer_storage.rs:234:5 [INFO] [stdout] | [INFO] [stdout] 234 | / pub fn new() -> Self { [INFO] [stdout] 235 | | BufferStorage { [INFO] [stdout] 236 | | views: HashMap::new(), [INFO] [stdout] 237 | | } [INFO] [stdout] 238 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 233 + impl Default for BufferStorage { [INFO] [stdout] 234 + fn default() -> Self { [INFO] [stdout] 235 + Self::new() [INFO] [stdout] 236 + } [INFO] [stdout] 237 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/utils/buffer_storage.rs:241:16 [INFO] [stdout] | [INFO] [stdout] 241 | if let Some(_) = self.get_view(&dir) { [INFO] [stdout] | -------^^^^^^^---------------------- help: try: `if self.get_view(&dir).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `default` can be confused for the standard trait method `std::default::Default::default` [INFO] [stdout] --> src/utils/cursor.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | / pub fn default() -> Self { [INFO] [stdout] 23 | | Self { [INFO] [stdout] 24 | | container: None, [INFO] [stdout] 25 | | x: 1, [INFO] [stdout] ... | [INFO] [stdout] 28 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/event.rs:90:29 [INFO] [stdout] | [INFO] [stdout] 90 | .ok_or(Box::new(std::io::Error::new( [INFO] [stdout] | _____________________________^ [INFO] [stdout] 91 | | std::io::ErrorKind::Other, [INFO] [stdout] 92 | | "This is an IO error", [INFO] [stdout] 93 | | ))) [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] = note: `#[warn(clippy::io_other_error)]` on by default [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 90 ~ .ok_or(Box::new(std::io::Error::other( [INFO] [stdout] 91 ~ "This is an IO error", [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/utils/file_helper.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | / match name.path().into_os_string().into_string() { [INFO] [stdout] 50 | | Ok(mut pathname) => { [INFO] [stdout] 51 | | if pathname.starts_with("./") && trim_start { [INFO] [stdout] 52 | | pathname = pathname.trim_start_matches("./").to_string(); [INFO] [stdout] ... | [INFO] [stdout] 57 | | Err(_) => {} [INFO] [stdout] 58 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 49 ~ if let Ok(mut pathname) = name.path().into_os_string().into_string() { [INFO] [stdout] 50 + if pathname.starts_with("./") && trim_start { [INFO] [stdout] 51 + pathname = pathname.trim_start_matches("./").to_string(); [INFO] [stdout] 52 + } [INFO] [stdout] 53 + [INFO] [stdout] 54 + names.push(pathname); [INFO] [stdout] 55 + } [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/utils/file_helper.rs:68:13 [INFO] [stdout] | [INFO] [stdout] 68 | / match name.path().into_os_string().into_string() { [INFO] [stdout] 69 | | Ok(pathname) => { [INFO] [stdout] 70 | | let trimmed = pathname [INFO] [stdout] 71 | | .trim_start_matches("./") [INFO] [stdout] ... | [INFO] [stdout] 78 | | Err(_) => {} [INFO] [stdout] 79 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 68 ~ if let Ok(pathname) = name.path().into_os_string().into_string() { [INFO] [stdout] 69 + let trimmed = pathname [INFO] [stdout] 70 + .trim_start_matches("./") [INFO] [stdout] 71 + .to_string() [INFO] [stdout] 72 + .trim_start_matches("../") [INFO] [stdout] 73 + .to_string(); [INFO] [stdout] 74 + [INFO] [stdout] 75 + names.push(trimmed); [INFO] [stdout] 76 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/utils/file_helper.rs:86:17 [INFO] [stdout] | [INFO] [stdout] 86 | let n = match self.current_path.file_name() { [INFO] [stdout] | _________________^ [INFO] [stdout] 87 | | Some(n) => n, [INFO] [stdout] 88 | | None => return None, [INFO] [stdout] 89 | | }; [INFO] [stdout] | |_________^ help: try instead: `self.current_path.file_name()?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/utils/file_helper.rs:97:5 [INFO] [stdout] | [INFO] [stdout] 97 | pub fn get_parent(&mut self) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] = note: `#[warn(clippy::result_unit_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/utils/file_helper.rs:104:5 [INFO] [stdout] | [INFO] [stdout] 104 | pub fn cd(&mut self, path: &str) -> Result<(), ()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: returning the result of a `let` binding from a block [INFO] [stdout] --> src/handler.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 18 | / let result = match app.mode { [INFO] [stdout] 19 | | Mode::Normal => handle_normal_mode(key_event, app), [INFO] [stdout] 20 | | Mode::Insert => handle_insert_mode(key_event, app), [INFO] [stdout] 21 | | Mode::Command => handle_command_mode(key_event, app), [INFO] [stdout] ... | [INFO] [stdout] 25 | | Mode::Pending => handle_pending_mode(key_event, app), [INFO] [stdout] 26 | | }; [INFO] [stdout] | |______- unnecessary `let` binding [INFO] [stdout] 27 | [INFO] [stdout] 28 | result [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return [INFO] [stdout] = note: `#[warn(clippy::let_and_return)]` on by default [INFO] [stdout] help: return the expression directly [INFO] [stdout] | [INFO] [stdout] 18 ~ [INFO] [stdout] 19 | [INFO] [stdout] 20 ~ match app.mode { [INFO] [stdout] 21 + Mode::Normal => handle_normal_mode(key_event, app), [INFO] [stdout] 22 + Mode::Insert => handle_insert_mode(key_event, app), [INFO] [stdout] 23 + Mode::Command => handle_command_mode(key_event, app), [INFO] [stdout] 24 + Mode::Visual => handle_visual_mode(key_event, app), [INFO] [stdout] 25 + Mode::VisualBlock => handle_visual_block_mode(key_event, app), [INFO] [stdout] 26 + Mode::VisualLine => handle_visual_line_mode(key_event, app), [INFO] [stdout] 27 + Mode::Pending => handle_pending_mode(key_event, app), [INFO] [stdout] 28 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/handler.rs:42:8 [INFO] [stdout] | [INFO] [stdout] 42 | if (buffer_empty && is_valid_init) || (!buffer_empty) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 42 - if (buffer_empty && is_valid_init) || (!buffer_empty) { [INFO] [stdout] 42 + if !(buffer_empty && !is_valid_init) { [INFO] [stdout] | [INFO] [stdout] 42 - if (buffer_empty && is_valid_init) || (!buffer_empty) { [INFO] [stdout] 42 + if !buffer_empty || is_valid_init { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/utils/file_helper.rs:155:5 [INFO] [stdout] | [INFO] [stdout] 155 | pub fn sim_cd(&mut self, path: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/utils/file_helper.rs:176:5 [INFO] [stdout] | [INFO] [stdout] 176 | pub fn set_path(&mut self, path: &str) -> Result<(), ()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/handler.rs:122:34 [INFO] [stdout] | [INFO] [stdout] 122 | app.cursor.y.try_into().unwrap_or(0) - 2, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `u16` to `usize` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] = note: `#[warn(clippy::unnecessary_fallible_conversions)]` on by default [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 122 - app.cursor.y.try_into().unwrap_or(0) - 2, [INFO] [stdout] 122 + app.cursor.y.into().unwrap_or(0) - 2, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/handler.rs:123:34 [INFO] [stdout] | [INFO] [stdout] 123 | app.cursor.y.try_into().unwrap_or(0) - 1, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `u16` to `usize` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 123 - app.cursor.y.try_into().unwrap_or(0) - 1, [INFO] [stdout] 123 + app.cursor.y.into().unwrap_or(0) - 1, [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/file_helper.rs:235:15 [INFO] [stdout] | [INFO] [stdout] 235 | match temp.len() > 0 && temp != "." { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!temp.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:167:21 [INFO] [stdout] | [INFO] [stdout] 167 | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] = note: `#[warn(clippy::let_unit_value)]` on by default [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 167 - let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 167 + app.set_mode(Mode::Normal)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/handler.rs:190:20 [INFO] [stdout] | [INFO] [stdout] 190 | if cmd.len() > 0 { [INFO] [stdout] | ^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!cmd.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] = note: `#[warn(clippy::len_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `InputBuffer` [INFO] [stdout] --> src/utils/input_buffer.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | / pub fn new() -> Self { [INFO] [stdout] 12 | | InputBuffer { [INFO] [stdout] 13 | | initializers: vec![ [INFO] [stdout] 14 | | String::from("c"), [INFO] [stdout] ... | [INFO] [stdout] 24 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 10 + impl Default for InputBuffer { [INFO] [stdout] 11 + fn default() -> Self { [INFO] [stdout] 12 + Self::new() [INFO] [stdout] 13 + } [INFO] [stdout] 14 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `.nth(0)` on a `std::iter::Iterator`, when `.next()` is equivalent [INFO] [stdout] --> src/handler.rs:207:36 [INFO] [stdout] | [INFO] [stdout] 207 | if code.len() != 1 || !code.chars().nth(0).unwrap_or(' ').is_alphanumeric() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ help: try calling `.next()` instead of `.nth(0)`: `code.chars().next()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero [INFO] [stdout] = note: `#[warn(clippy::iter_nth_zero)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this match could be replaced by its body itself [INFO] [stdout] --> src/handler.rs:217:5 [INFO] [stdout] | [INFO] [stdout] 217 | / match key_event.code { [INFO] [stdout] 218 | | _ => {} [INFO] [stdout] 219 | | }; [INFO] [stdout] | |_____^ help: consider using the match body instead: `{}` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding [INFO] [stdout] = note: `#[warn(clippy::match_single_binding)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/handler.rs:225:5 [INFO] [stdout] | [INFO] [stdout] 225 | / match key_event.code { [INFO] [stdout] 226 | | KeyCode::Esc => { [INFO] [stdout] 227 | | app.cursor.left(); [INFO] [stdout] 228 | | app.set_mode(Mode::Normal)?; [INFO] [stdout] ... | [INFO] [stdout] 231 | | _ => {} [INFO] [stdout] 232 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 225 ~ if key_event.code == KeyCode::Esc { [INFO] [stdout] 226 + app.cursor.left(); [INFO] [stdout] 227 + app.set_mode(Mode::Normal)?; [INFO] [stdout] 228 + let _ = execute!(std::io::stdout(), SetCursorStyle::SteadyBlock); [INFO] [stdout] 229 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/handler.rs:238:5 [INFO] [stdout] | [INFO] [stdout] 238 | / match key_event.code { [INFO] [stdout] 239 | | KeyCode::Esc => { [INFO] [stdout] 240 | | app.cursor.left(); [INFO] [stdout] 241 | | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 242 | | } [INFO] [stdout] 243 | | _ => {} [INFO] [stdout] 244 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 238 ~ if key_event.code == KeyCode::Esc { [INFO] [stdout] 239 + app.cursor.left(); [INFO] [stdout] 240 + let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 241 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/motion_handler.rs:43:28 [INFO] [stdout] | [INFO] [stdout] 43 | view.set_state(&line.trim(), State::Deleted); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `line.trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/motion_handler.rs:68:28 [INFO] [stdout] | [INFO] [stdout] 68 | view.set_state(&line.trim(), State::Deleted); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `line.trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:241:13 [INFO] [stdout] | [INFO] [stdout] 241 | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 241 - let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 241 + app.set_mode(Mode::Normal)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you seem to be trying to use `match` for an equality check. Consider using `if` [INFO] [stdout] --> src/handler.rs:250:5 [INFO] [stdout] | [INFO] [stdout] 250 | / match key_event.code { [INFO] [stdout] 251 | | KeyCode::Esc => { [INFO] [stdout] 252 | | app.cursor.left(); [INFO] [stdout] 253 | | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 254 | | } [INFO] [stdout] 255 | | _ => {} [INFO] [stdout] 256 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 250 ~ if key_event.code == KeyCode::Esc { [INFO] [stdout] 251 + app.cursor.left(); [INFO] [stdout] 252 + let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 253 ~ }; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:253:13 [INFO] [stdout] | [INFO] [stdout] 253 | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 253 - let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 253 + app.set_mode(Mode::Normal)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:265:13 [INFO] [stdout] | [INFO] [stdout] 265 | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 265 - let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 265 + app.set_mode(Mode::Normal)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/motion_handler.rs:99:28 [INFO] [stdout] | [INFO] [stdout] 99 | view.set_state(&line.trim(), State::Deleted); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `line.trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:282:5 [INFO] [stdout] | [INFO] [stdout] 282 | let _ = app.set_mode(Mode::Pending)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 282 - let _ = app.set_mode(Mode::Pending)?; [INFO] [stdout] 282 + app.set_mode(Mode::Pending)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:293:9 [INFO] [stdout] | [INFO] [stdout] 293 | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 293 - let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 293 + app.set_mode(Mode::Normal)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:358:13 [INFO] [stdout] | [INFO] [stdout] 358 | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 358 - let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 358 + app.set_mode(Mode::Normal)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:363:13 [INFO] [stdout] | [INFO] [stdout] 363 | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 363 - let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 363 + app.set_mode(Mode::Normal)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/utils/motion_handler.rs:225:35 [INFO] [stdout] | [INFO] [stdout] 225 | let new_x = app.get_end_x(&line.to_string(), x, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this let-binding has unit value [INFO] [stdout] --> src/handler.rs:369:13 [INFO] [stdout] | [INFO] [stdout] 369 | let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_unit_value [INFO] [stdout] help: omit the `let` binding [INFO] [stdout] | [INFO] [stdout] 369 - let _ = app.set_mode(Mode::Normal)?; [INFO] [stdout] 369 + app.set_mode(Mode::Normal)?; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/utils/motion_handler.rs:228:30 [INFO] [stdout] | [INFO] [stdout] 228 | && (app.cursor.y.try_into().unwrap_or(0) < app.get_line_count()) [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `u16` to `usize` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 228 - && (app.cursor.y.try_into().unwrap_or(0) < app.get_line_count()) [INFO] [stdout] 228 + && (app.cursor.y.into().unwrap_or(0) < app.get_line_count()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/utils/motion_handler.rs:253:41 [INFO] [stdout] | [INFO] [stdout] 253 | let new_x = app.get_start_x(&line.to_string(), x); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of an assign operation [INFO] [stdout] --> src/handler.rs:392:9 [INFO] [stdout] | [INFO] [stdout] 392 | name = name + "/"; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace it with: `name += "/"` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stdout] = note: `#[warn(clippy::assign_op_pattern)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/motion_handler.rs:327:28 [INFO] [stdout] | [INFO] [stdout] 327 | view.set_state(&line.trim(), State::Deleted); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `line.trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/utils/motion_handler.rs:360:63 [INFO] [stdout] | [INFO] [stdout] 360 | let start_index = app.seek_special_character_backward(&line.to_string(), x); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/utils/motion_handler.rs:361:60 [INFO] [stdout] | [INFO] [stdout] 361 | let end_index = app.seek_special_character_forward(&line.to_string(), x); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/motion_handler.rs:388:36 [INFO] [stdout] | [INFO] [stdout] 388 | view.set_state(&content.trim(), State::Moved); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `content.trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/ui.rs:32:60 [INFO] [stdout] | [INFO] [stdout] 32 | let footer = render_utils::get_footer(&bordered_block, &app); [INFO] [stdout] | ^^^^ help: change this to: `app` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: useless conversion to the same type: `std::string::String` [INFO] [stdout] --> src/utils/buffer_storage.rs:90:18 [INFO] [stdout] | [INFO] [stdout] 90 | dir: String::from(dir), [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: consider removing `String::from()`: `dir` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion [INFO] [stdout] = note: `#[warn(clippy::useless_conversion)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/utils/render_utils.rs:326:34 [INFO] [stdout] | [INFO] [stdout] 326 | let file_extension = hovered_file.split('.').last().unwrap_or("txt").to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 326 - let file_extension = hovered_file.split('.').last().unwrap_or("txt").to_string(); [INFO] [stdout] 326 + let file_extension = hovered_file.split('.').next_back().unwrap_or("txt").to_string(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/utils/buffer_storage.rs:209:9 [INFO] [stdout] | [INFO] [stdout] 209 | / if let Some(file) = self.files.get(name) { [INFO] [stdout] 210 | | Some((file.original_dir.clone(), file.dir.clone())) [INFO] [stdout] 211 | | } else { [INFO] [stdout] 212 | | None [INFO] [stdout] 213 | | } [INFO] [stdout] | |_________^ help: try: `self.files.get(name).map(|file| (file.original_dir.clone(), file.dir.clone()))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] = note: `#[warn(clippy::manual_map)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: manual implementation of `Option::map` [INFO] [stdout] --> src/utils/buffer_storage.rs:216:9 [INFO] [stdout] | [INFO] [stdout] 216 | / if let Some(file) = self.files.get(name) { [INFO] [stdout] 217 | | Some((file.original_name.clone(), file.name.clone())) [INFO] [stdout] 218 | | } else { [INFO] [stdout] 219 | | None [INFO] [stdout] 220 | | } [INFO] [stdout] | |_________^ help: try: `self.files.get(name).map(|file| (file.original_name.clone(), file.name.clone()))` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_map [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utils/system.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | / return match output { [INFO] [stdout] 7 | | Ok(output) => { [INFO] [stdout] 8 | | let user = String::from_utf8_lossy(&output.stdout); [INFO] [stdout] ... | [INFO] [stdout] 15 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 6 ~ match output { [INFO] [stdout] 7 + Ok(output) => { [INFO] [stdout] 8 + let user = String::from_utf8_lossy(&output.stdout); [INFO] [stdout] 9 + [INFO] [stdout] 10 + String::from(user) [INFO] [stdout] 11 + } [INFO] [stdout] 12 + Err(_) => { [INFO] [stdout] 13 + process::exit(1); [INFO] [stdout] 14 + } [INFO] [stdout] 15 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utils/system.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | / return match output { [INFO] [stdout] 22 | | Ok(output) => String::from(String::from_utf8_lossy(&output.stdout)), [INFO] [stdout] 23 | | Err(_) => match try_get_hostnamectl() { [INFO] [stdout] 24 | | Some(hostname) => hostname, [INFO] [stdout] 25 | | None => process::exit(1), [INFO] [stdout] 26 | | }, [INFO] [stdout] 27 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 21 ~ match output { [INFO] [stdout] 22 + Ok(output) => String::from(String::from_utf8_lossy(&output.stdout)), [INFO] [stdout] 23 + Err(_) => match try_get_hostnamectl() { [INFO] [stdout] 24 + Some(hostname) => hostname, [INFO] [stdout] 25 + None => process::exit(1), [INFO] [stdout] 26 + }, [INFO] [stdout] 27 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `BufferStorage` [INFO] [stdout] --> src/utils/buffer_storage.rs:234:5 [INFO] [stdout] | [INFO] [stdout] 234 | / pub fn new() -> Self { [INFO] [stdout] 235 | | BufferStorage { [INFO] [stdout] 236 | | views: HashMap::new(), [INFO] [stdout] 237 | | } [INFO] [stdout] 238 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] = note: `#[warn(clippy::new_without_default)]` on by default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 233 + impl Default for BufferStorage { [INFO] [stdout] 234 + fn default() -> Self { [INFO] [stdout] 235 + Self::new() [INFO] [stdout] 236 + } [INFO] [stdout] 237 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: redundant pattern matching, consider using `is_some()` [INFO] [stdout] --> src/utils/buffer_storage.rs:241:16 [INFO] [stdout] | [INFO] [stdout] 241 | if let Some(_) = self.get_view(&dir) { [INFO] [stdout] | -------^^^^^^^---------------------- help: try: `if self.get_view(&dir).is_some()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pattern_matching [INFO] [stdout] = note: `#[warn(clippy::redundant_pattern_matching)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utils/system.rs:58:5 [INFO] [stdout] | [INFO] [stdout] 58 | / return match output { [INFO] [stdout] 59 | | Ok(output) => { [INFO] [stdout] 60 | | let path = String::from_utf8_lossy(&output.stdout); [INFO] [stdout] ... | [INFO] [stdout] 67 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 58 ~ match output { [INFO] [stdout] 59 + Ok(output) => { [INFO] [stdout] 60 + let path = String::from_utf8_lossy(&output.stdout); [INFO] [stdout] 61 + [INFO] [stdout] 62 + String::from(path.trim()) [INFO] [stdout] 63 + } [INFO] [stdout] 64 + Err(_) => { [INFO] [stdout] 65 + process::exit(1); [INFO] [stdout] 66 + } [INFO] [stdout] 67 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `default` can be confused for the standard trait method `std::default::Default::default` [INFO] [stdout] --> src/utils/cursor.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | / pub fn default() -> Self { [INFO] [stdout] 23 | | Self { [INFO] [stdout] 24 | | container: None, [INFO] [stdout] 25 | | x: 1, [INFO] [stdout] ... | [INFO] [stdout] 28 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: consider implementing the trait `std::default::Default` or choosing a less ambiguous method name [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#should_implement_trait [INFO] [stdout] = note: `#[warn(clippy::should_implement_trait)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/system.rs:184:8 [INFO] [stdout] | [INFO] [stdout] 184 | if result.len() == 0 || result.starts_with("head: error") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `result.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/utils/system.rs:185:20 [INFO] [stdout] | [INFO] [stdout] 185 | return Err(std::io::Error::new( [INFO] [stdout] | ____________________^ [INFO] [stdout] 186 | | std::io::ErrorKind::Other, [INFO] [stdout] 187 | | "File not found", [INFO] [stdout] 188 | | )); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 185 ~ return Err(std::io::Error::other( [INFO] [stdout] 186 ~ "File not found", [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `UndoStack` [INFO] [stdout] --> src/utils/undo_stack.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | / pub fn new() -> Self { [INFO] [stdout] 10 | | UndoStack { [INFO] [stdout] 11 | | stack: Vec::new(), [INFO] [stdout] 12 | | pointers: Vec::new(), [INFO] [stdout] ... | [INFO] [stdout] 15 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 8 + impl Default for UndoStack { [INFO] [stdout] 9 + fn default() -> Self { [INFO] [stdout] 10 + Self::new() [INFO] [stdout] 11 + } [INFO] [stdout] 12 + } [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/utils/file_helper.rs:49:13 [INFO] [stdout] | [INFO] [stdout] 49 | / match name.path().into_os_string().into_string() { [INFO] [stdout] 50 | | Ok(mut pathname) => { [INFO] [stdout] 51 | | if pathname.starts_with("./") && trim_start { [INFO] [stdout] 52 | | pathname = pathname.trim_start_matches("./").to_string(); [INFO] [stdout] ... | [INFO] [stdout] 57 | | Err(_) => {} [INFO] [stdout] 58 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 49 ~ if let Ok(mut pathname) = name.path().into_os_string().into_string() { [INFO] [stdout] 50 + if pathname.starts_with("./") && trim_start { [INFO] [stdout] 51 + pathname = pathname.trim_start_matches("./").to_string(); [INFO] [stdout] 52 + } [INFO] [stdout] 53 + [INFO] [stdout] 54 + names.push(pathname); [INFO] [stdout] 55 + } [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/utils/file_helper.rs:68:13 [INFO] [stdout] | [INFO] [stdout] 68 | / match name.path().into_os_string().into_string() { [INFO] [stdout] 69 | | Ok(pathname) => { [INFO] [stdout] 70 | | let trimmed = pathname [INFO] [stdout] 71 | | .trim_start_matches("./") [INFO] [stdout] ... | [INFO] [stdout] 78 | | Err(_) => {} [INFO] [stdout] 79 | | } [INFO] [stdout] | |_____________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 68 ~ if let Ok(pathname) = name.path().into_os_string().into_string() { [INFO] [stdout] 69 + let trimmed = pathname [INFO] [stdout] 70 + .trim_start_matches("./") [INFO] [stdout] 71 + .to_string() [INFO] [stdout] 72 + .trim_start_matches("../") [INFO] [stdout] 73 + .to_string(); [INFO] [stdout] 74 + [INFO] [stdout] 75 + names.push(trimmed); [INFO] [stdout] 76 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `match` expression can be replaced with `?` [INFO] [stdout] --> src/utils/file_helper.rs:86:17 [INFO] [stdout] | [INFO] [stdout] 86 | let n = match self.current_path.file_name() { [INFO] [stdout] | _________________^ [INFO] [stdout] 87 | | Some(n) => n, [INFO] [stdout] 88 | | None => return None, [INFO] [stdout] 89 | | }; [INFO] [stdout] | |_________^ help: try instead: `self.current_path.file_name()?` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark [INFO] [stdout] = note: `#[warn(clippy::question_mark)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `YankBuffer` [INFO] [stdout] --> src/utils/yank_buffer.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | / pub fn new() -> Self { [INFO] [stdout] 17 | | Self { [INFO] [stdout] 18 | | content: String::new(), [INFO] [stdout] 19 | | yank_type: YankType::Line, [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#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 15 + impl Default for YankBuffer { [INFO] [stdout] 16 + fn default() -> Self { [INFO] [stdout] 17 + Self::new() [INFO] [stdout] 18 + } [INFO] [stdout] 19 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/utils/file_helper.rs:97:5 [INFO] [stdout] | [INFO] [stdout] 97 | pub fn get_parent(&mut self) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] = note: `#[warn(clippy::result_unit_err)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/utils/file_helper.rs:104:5 [INFO] [stdout] | [INFO] [stdout] 104 | pub fn cd(&mut self, path: &str) -> Result<(), ()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/utils/file_helper.rs:155:5 [INFO] [stdout] | [INFO] [stdout] 155 | pub fn sim_cd(&mut self, path: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this returns a `Result<_, ()>` [INFO] [stdout] --> src/utils/file_helper.rs:176:5 [INFO] [stdout] | [INFO] [stdout] 176 | pub fn set_path(&mut self, path: &str) -> Result<(), ()> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: use a custom `Error` type instead [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#result_unit_err [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/file_helper.rs:235:15 [INFO] [stdout] | [INFO] [stdout] 235 | match temp.len() > 0 && temp != "." { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!temp.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `InputBuffer` [INFO] [stdout] --> src/utils/input_buffer.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | / pub fn new() -> Self { [INFO] [stdout] 12 | | InputBuffer { [INFO] [stdout] 13 | | initializers: vec![ [INFO] [stdout] 14 | | String::from("c"), [INFO] [stdout] ... | [INFO] [stdout] 24 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 10 + impl Default for InputBuffer { [INFO] [stdout] 11 + fn default() -> Self { [INFO] [stdout] 12 + Self::new() [INFO] [stdout] 13 + } [INFO] [stdout] 14 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/motion_handler.rs:43:28 [INFO] [stdout] | [INFO] [stdout] 43 | view.set_state(&line.trim(), State::Deleted); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `line.trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/motion_handler.rs:68:28 [INFO] [stdout] | [INFO] [stdout] 68 | view.set_state(&line.trim(), State::Deleted); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `line.trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/motion_handler.rs:99:28 [INFO] [stdout] | [INFO] [stdout] 99 | view.set_state(&line.trim(), State::Deleted); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `line.trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/utils/motion_handler.rs:225:35 [INFO] [stdout] | [INFO] [stdout] 225 | let new_x = app.get_end_x(&line.to_string(), x, true); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] = note: `#[warn(clippy::unnecessary_to_owned)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: use of a fallible conversion when an infallible one could be used [INFO] [stdout] --> src/utils/motion_handler.rs:228:30 [INFO] [stdout] | [INFO] [stdout] 228 | && (app.cursor.y.try_into().unwrap_or(0) < app.get_line_count()) [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: converting `u16` to `usize` cannot fail [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_fallible_conversions [INFO] [stdout] help: use [INFO] [stdout] | [INFO] [stdout] 228 - && (app.cursor.y.try_into().unwrap_or(0) < app.get_line_count()) [INFO] [stdout] 228 + && (app.cursor.y.into().unwrap_or(0) < app.get_line_count()) [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/utils/motion_handler.rs:253:41 [INFO] [stdout] | [INFO] [stdout] 253 | let new_x = app.get_start_x(&line.to_string(), x); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/motion_handler.rs:327:28 [INFO] [stdout] | [INFO] [stdout] 327 | view.set_state(&line.trim(), State::Deleted); [INFO] [stdout] | ^^^^^^^^^^^^ help: change this to: `line.trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/utils/motion_handler.rs:360:63 [INFO] [stdout] | [INFO] [stdout] 360 | let start_index = app.seek_special_character_backward(&line.to_string(), x); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `to_string` [INFO] [stdout] --> src/utils/motion_handler.rs:361:60 [INFO] [stdout] | [INFO] [stdout] 361 | let end_index = app.seek_special_character_forward(&line.to_string(), x); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: use: `line` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/utils/motion_handler.rs:388:36 [INFO] [stdout] | [INFO] [stdout] 388 | view.set_state(&content.trim(), State::Moved); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: change this to: `content.trim()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator [INFO] [stdout] --> src/utils/render_utils.rs:326:34 [INFO] [stdout] | [INFO] [stdout] 326 | let file_extension = hovered_file.split('.').last().unwrap_or("txt").to_string(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last [INFO] [stdout] = note: `#[warn(clippy::double_ended_iterator_last)]` on by default [INFO] [stdout] help: try [INFO] [stdout] | [INFO] [stdout] 326 - let file_extension = hovered_file.split('.').last().unwrap_or("txt").to_string(); [INFO] [stdout] 326 + let file_extension = hovered_file.split('.').next_back().unwrap_or("txt").to_string(); [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utils/system.rs:6:5 [INFO] [stdout] | [INFO] [stdout] 6 | / return match output { [INFO] [stdout] 7 | | Ok(output) => { [INFO] [stdout] 8 | | let user = String::from_utf8_lossy(&output.stdout); [INFO] [stdout] ... | [INFO] [stdout] 15 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] = note: `#[warn(clippy::needless_return)]` on by default [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 6 ~ match output { [INFO] [stdout] 7 + Ok(output) => { [INFO] [stdout] 8 + let user = String::from_utf8_lossy(&output.stdout); [INFO] [stdout] 9 + [INFO] [stdout] 10 + String::from(user) [INFO] [stdout] 11 + } [INFO] [stdout] 12 + Err(_) => { [INFO] [stdout] 13 + process::exit(1); [INFO] [stdout] 14 + } [INFO] [stdout] 15 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utils/system.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | / return match output { [INFO] [stdout] 22 | | Ok(output) => String::from(String::from_utf8_lossy(&output.stdout)), [INFO] [stdout] 23 | | Err(_) => match try_get_hostnamectl() { [INFO] [stdout] 24 | | Some(hostname) => hostname, [INFO] [stdout] 25 | | None => process::exit(1), [INFO] [stdout] 26 | | }, [INFO] [stdout] 27 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 21 ~ match output { [INFO] [stdout] 22 + Ok(output) => String::from(String::from_utf8_lossy(&output.stdout)), [INFO] [stdout] 23 + Err(_) => match try_get_hostnamectl() { [INFO] [stdout] 24 + Some(hostname) => hostname, [INFO] [stdout] 25 + None => process::exit(1), [INFO] [stdout] 26 + }, [INFO] [stdout] 27 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utils/system.rs:58:5 [INFO] [stdout] | [INFO] [stdout] 58 | / return match output { [INFO] [stdout] 59 | | Ok(output) => { [INFO] [stdout] 60 | | let path = String::from_utf8_lossy(&output.stdout); [INFO] [stdout] ... | [INFO] [stdout] 67 | | }; [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return [INFO] [stdout] help: remove `return` [INFO] [stdout] | [INFO] [stdout] 58 ~ match output { [INFO] [stdout] 59 + Ok(output) => { [INFO] [stdout] 60 + let path = String::from_utf8_lossy(&output.stdout); [INFO] [stdout] 61 + [INFO] [stdout] 62 + String::from(path.trim()) [INFO] [stdout] 63 + } [INFO] [stdout] 64 + Err(_) => { [INFO] [stdout] 65 + process::exit(1); [INFO] [stdout] 66 + } [INFO] [stdout] 67 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils/system.rs:184:8 [INFO] [stdout] | [INFO] [stdout] 184 | if result.len() == 0 || result.starts_with("head: error") { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `result.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#len_zero [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this can be `std::io::Error::other(_)` [INFO] [stdout] --> src/utils/system.rs:185:20 [INFO] [stdout] | [INFO] [stdout] 185 | return Err(std::io::Error::new( [INFO] [stdout] | ____________________^ [INFO] [stdout] 186 | | std::io::ErrorKind::Other, [INFO] [stdout] 187 | | "File not found", [INFO] [stdout] 188 | | )); [INFO] [stdout] | |_________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#io_other_error [INFO] [stdout] help: use `std::io::Error::other` [INFO] [stdout] | [INFO] [stdout] 185 ~ return Err(std::io::Error::other( [INFO] [stdout] 186 ~ "File not found", [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `UndoStack` [INFO] [stdout] --> src/utils/undo_stack.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | / pub fn new() -> Self { [INFO] [stdout] 10 | | UndoStack { [INFO] [stdout] 11 | | stack: Vec::new(), [INFO] [stdout] 12 | | pointers: Vec::new(), [INFO] [stdout] ... | [INFO] [stdout] 15 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 8 + impl Default for UndoStack { [INFO] [stdout] 9 + fn default() -> Self { [INFO] [stdout] 10 + Self::new() [INFO] [stdout] 11 + } [INFO] [stdout] 12 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: you should consider adding a `Default` implementation for `YankBuffer` [INFO] [stdout] --> src/utils/yank_buffer.rs:16:5 [INFO] [stdout] | [INFO] [stdout] 16 | / pub fn new() -> Self { [INFO] [stdout] 17 | | Self { [INFO] [stdout] 18 | | content: String::new(), [INFO] [stdout] 19 | | yank_type: YankType::Line, [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#new_without_default [INFO] [stdout] help: try adding this [INFO] [stdout] | [INFO] [stdout] 15 + impl Default for YankBuffer { [INFO] [stdout] 16 + fn default() -> Self { [INFO] [stdout] 17 + Self::new() [INFO] [stdout] 18 + } [INFO] [stdout] 19 + } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 29.87s [INFO] running `Command { std: "docker" "inspect" "927de3e3e81f7c3f0affa997131969b38d9f4265130ef2f9ec6cc034499ff225", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "927de3e3e81f7c3f0affa997131969b38d9f4265130ef2f9ec6cc034499ff225", kill_on_drop: false }` [INFO] [stdout] 927de3e3e81f7c3f0affa997131969b38d9f4265130ef2f9ec6cc034499ff225