[INFO] cloning repository https://github.com/jcfromsiberia/codecrafters-shell-rust [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/jcfromsiberia/codecrafters-shell-rust" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjcfromsiberia%2Fcodecrafters-shell-rust", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjcfromsiberia%2Fcodecrafters-shell-rust'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 16eddf223e15dc746be0ca16962a5279ff1db5f8 [INFO] linting jcfromsiberia/codecrafters-shell-rust against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fjcfromsiberia%2Fcodecrafters-shell-rust" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/jcfromsiberia/codecrafters-shell-rust [INFO] finished tweaking git repo https://github.com/jcfromsiberia/codecrafters-shell-rust [INFO] tweaked toml for git repo https://github.com/jcfromsiberia/codecrafters-shell-rust written to /workspace/builds/worker-0-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/jcfromsiberia/codecrafters-shell-rust 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/jcfromsiberia/codecrafters-shell-rust already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+nightly" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded is_executable v1.0.5 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 7af219fa711eb5168fb38bf522452d9faca85c1c055b8dc82c32fad614ac94dd [INFO] running `Command { std: "docker" "start" "-a" "7af219fa711eb5168fb38bf522452d9faca85c1c055b8dc82c32fad614ac94dd", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "7af219fa711eb5168fb38bf522452d9faca85c1c055b8dc82c32fad614ac94dd", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "7af219fa711eb5168fb38bf522452d9faca85c1c055b8dc82c32fad614ac94dd", kill_on_drop: false }` [INFO] [stdout] 7af219fa711eb5168fb38bf522452d9faca85c1c055b8dc82c32fad614ac94dd [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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] 185596a3dd86c60c1e323922221c5c86c798966590abb87fa39df747e41335dc [INFO] running `Command { std: "docker" "start" "-a" "185596a3dd86c60c1e323922221c5c86c798966590abb87fa39df747e41335dc", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.179 [INFO] [stderr] Compiling rustix v1.1.3 [INFO] [stderr] Compiling anyhow v1.0.86 [INFO] [stderr] Checking bitflags v2.10.0 [INFO] [stderr] Checking is_executable v1.0.5 [INFO] [stderr] Checking shlex v1.3.0 [INFO] [stderr] Compiling syn v2.0.75 [INFO] [stderr] Checking errno v0.3.14 [INFO] [stderr] Checking mio v1.1.1 [INFO] [stderr] Checking parking_lot_core v0.9.12 [INFO] [stderr] Checking parking_lot v0.12.5 [INFO] [stderr] Checking signal-hook-registry v1.4.8 [INFO] [stderr] Checking signal-hook v0.3.18 [INFO] [stderr] Checking signal-hook-mio v0.2.5 [INFO] [stderr] Compiling derive_more-impl v2.1.1 [INFO] [stderr] Checking derive_more v2.1.1 [INFO] [stderr] Checking crossterm v0.29.0 [INFO] [stderr] Checking codecrafters-shell v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/builtin.rs:120:28 [INFO] [stdout] | [INFO] [stdout] 120 | if !history.append_from_file(arg1).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `history.append_from_file(arg1).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/builtin.rs:128:28 [INFO] [stdout] | [INFO] [stdout] 128 | if !history.write_to_file(arg1).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `history.write_to_file(arg1).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/builtin.rs:136:28 [INFO] [stdout] | [INFO] [stdout] 136 | if !history.append_to_file(arg1).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `history.append_to_file(arg1).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/builtin.rs:38:31 [INFO] [stdout] | [INFO] [stdout] 38 | if is_builtin(&cmd.as_str()) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `cmd.as_str()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `first().is_none()` to check if slice is empty [INFO] [stdout] --> src/builtin.rs:101:21 [INFO] [stdout] | [INFO] [stdout] 101 | if args.first().is_none() || args.first().unwrap().parse::().is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace this with: `is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_first_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_first_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/builtin.rs:120:25 [INFO] [stdout] | [INFO] [stdout] 120 | / if !history.append_from_file(arg1).is_ok() { [INFO] [stdout] 121 | | let _ = stdout.write_fmt(format_args!( [INFO] [stdout] 122 | | "history: failed to read history from {arg1}" [INFO] [stdout] 123 | | )); [INFO] [stdout] 124 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 119 ~ "-r" [INFO] [stdout] 120 ~ if !history.append_from_file(arg1).is_ok() => { [INFO] [stdout] 121 | let _ = stdout.write_fmt(format_args!( [INFO] [stdout] 122 | "history: failed to read history from {arg1}" [INFO] [stdout] 123 | )); [INFO] [stdout] 124 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/builtin.rs:128:25 [INFO] [stdout] | [INFO] [stdout] 128 | / if !history.write_to_file(arg1).is_ok() { [INFO] [stdout] 129 | | let _ = stdout.write_fmt(format_args!( [INFO] [stdout] 130 | | "history: failed to write history to {arg1}" [INFO] [stdout] 131 | | )); [INFO] [stdout] 132 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 127 ~ "-w" [INFO] [stdout] 128 ~ if !history.write_to_file(arg1).is_ok() => { [INFO] [stdout] 129 | let _ = stdout.write_fmt(format_args!( [INFO] [stdout] 130 | "history: failed to write history to {arg1}" [INFO] [stdout] 131 | )); [INFO] [stdout] 132 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/builtin.rs:136:25 [INFO] [stdout] | [INFO] [stdout] 136 | / if !history.append_to_file(arg1).is_ok() { [INFO] [stdout] 137 | | let _ = stdout.write_fmt(format_args!( [INFO] [stdout] 138 | | "history: failed to append history to {arg1}" [INFO] [stdout] 139 | | )); [INFO] [stdout] 140 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 135 ~ "-a" [INFO] [stdout] 136 ~ if !history.append_to_file(arg1).is_ok() => { [INFO] [stdout] 137 | let _ = stdout.write_fmt(format_args!( [INFO] [stdout] 138 | "history: failed to append history to {arg1}" [INFO] [stdout] 139 | )); [INFO] [stdout] 140 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/command.rs:24:20 [INFO] [stdout] | [INFO] [stdout] 24 | context_chain: &Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 24 - context_chain: &Vec, [INFO] [stdout] 24 + context_chain: &[EvalContext], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/command.rs:37:44 [INFO] [stdout] | [INFO] [stdout] 37 | let _ = create_output_file(&file_name, context.append_stderr)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `file_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/command.rs:41:47 [INFO] [stdout] | [INFO] [stdout] 41 | let file = create_output_file(&file_name, context.append_stdout)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `file_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/command.rs:42:30 [INFO] [stdout] | [INFO] [stdout] 42 | eval_builtin(&context, file, history) [INFO] [stdout] | ^^^^^^^^ help: change this to: `context` [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/command.rs:45:34 [INFO] [stdout] | [INFO] [stdout] 45 | eval_builtin(&context, &std::io::stdout(), history) [INFO] [stdout] | ^^^^^^^^ help: change this to: `context` [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/command.rs:48:47 [INFO] [stdout] | [INFO] [stdout] 48 | let result = eval_builtin(&context, writer, history); [INFO] [stdout] | ^^^^^^^^ help: change this to: `context` [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/command.rs:72:43 [INFO] [stdout] | [INFO] [stdout] 72 | let file = create_output_file(&file_name, context.append_stdout)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `file_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/command.rs:85:43 [INFO] [stdout] | [INFO] [stdout] 85 | let file = create_output_file(&file_name, context.append_stderr)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `file_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `.write(true)` because there is `.append(true)` [INFO] [stdout] --> src/history.rs:69:13 [INFO] [stdout] | [INFO] [stdout] 69 | .write(true) [INFO] [stdout] | ^^^^^^^^^^^^ help: remove `.write(true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ineffective_open_options [INFO] [stdout] = note: `#[warn(clippy::ineffective_open_options)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 23 | if !history.append_from_file(histfile.to_str().unwrap()).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `history.append_from_file(histfile.to_str().unwrap()).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:199:12 [INFO] [stdout] | [INFO] [stdout] 199 | if !history.append_to_file(histfile.to_str().unwrap()).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `history.append_to_file(histfile.to_str().unwrap()).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | / if let Some(histfile) = std::env::var_os("HISTFILE") { [INFO] [stdout] 23 | | if !history.append_from_file(histfile.to_str().unwrap()).is_ok() { [INFO] [stdout] 24 | | eprintln!("Failed to read history file {}", histfile.to_str().unwrap()); [INFO] [stdout] 25 | | } [INFO] [stdout] 26 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 22 ~ if let Some(histfile) = std::env::var_os("HISTFILE") [INFO] [stdout] 23 ~ && !history.append_from_file(histfile.to_str().unwrap()).is_ok() { [INFO] [stdout] 24 | eprintln!("Failed to read history file {}", histfile.to_str().unwrap()); [INFO] [stdout] 25 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:59:25 [INFO] [stdout] | [INFO] [stdout] 59 | / if !input.is_empty() { [INFO] [stdout] 60 | | input.pop(); [INFO] [stdout] 61 | | // erase last char in raw mode [INFO] [stdout] 62 | | print!("\x08 \x08"); [INFO] [stdout] 63 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 58 ~ KeyCode::Backspace [INFO] [stdout] 59 ~ if !input.is_empty() => { [INFO] [stdout] 60 | input.pop(); [INFO] [stdout] 61 | // erase last char in raw mode [INFO] [stdout] 62 | print!("\x08 \x08"); [INFO] [stdout] 63 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:198:5 [INFO] [stdout] | [INFO] [stdout] 198 | / if let Some(histfile) = std::env::var_os("HISTFILE") { [INFO] [stdout] 199 | | if !history.append_to_file(histfile.to_str().unwrap()).is_ok() { [INFO] [stdout] 200 | | eprintln!( [INFO] [stdout] 201 | | "Failed to write history file {}", [INFO] [stdout] ... | [INFO] [stdout] 205 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 198 ~ if let Some(histfile) = std::env::var_os("HISTFILE") [INFO] [stdout] 199 ~ && !history.append_to_file(histfile.to_str().unwrap()).is_ok() { [INFO] [stdout] 200 | eprintln!( [INFO] [stdout] ... [INFO] [stdout] 203 | ); [INFO] [stdout] 204 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/main.rs:210:34 [INFO] [stdout] | [INFO] [stdout] 210 | fn longest_common_prefix(tokens: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 210 - fn longest_common_prefix(tokens: &Vec) -> String { [INFO] [stdout] 210 + fn longest_common_prefix(tokens: &[String]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/builtin.rs:120:28 [INFO] [stdout] | [INFO] [stdout] 120 | if !history.append_from_file(arg1).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `history.append_from_file(arg1).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] = note: `#[warn(clippy::nonminimal_bool)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/builtin.rs:128:28 [INFO] [stdout] | [INFO] [stdout] 128 | if !history.write_to_file(arg1).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `history.write_to_file(arg1).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/builtin.rs:136:28 [INFO] [stdout] | [INFO] [stdout] 136 | if !history.append_to_file(arg1).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `history.append_to_file(arg1).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/builtin.rs:38:31 [INFO] [stdout] | [INFO] [stdout] 38 | if is_builtin(&cmd.as_str()) { [INFO] [stdout] | ^^^^^^^^^^^^^ help: change this to: `cmd.as_str()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] = note: `#[warn(clippy::needless_borrow)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `first().is_none()` to check if slice is empty [INFO] [stdout] --> src/builtin.rs:101:21 [INFO] [stdout] | [INFO] [stdout] 101 | if args.first().is_none() || args.first().unwrap().parse::().is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ help: replace this with: `is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_first_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_first_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/builtin.rs:120:25 [INFO] [stdout] | [INFO] [stdout] 120 | / if !history.append_from_file(arg1).is_ok() { [INFO] [stdout] 121 | | let _ = stdout.write_fmt(format_args!( [INFO] [stdout] 122 | | "history: failed to read history from {arg1}" [INFO] [stdout] 123 | | )); [INFO] [stdout] 124 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] = note: `#[warn(clippy::collapsible_match)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 119 ~ "-r" [INFO] [stdout] 120 ~ if !history.append_from_file(arg1).is_ok() => { [INFO] [stdout] 121 | let _ = stdout.write_fmt(format_args!( [INFO] [stdout] 122 | "history: failed to read history from {arg1}" [INFO] [stdout] 123 | )); [INFO] [stdout] 124 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/builtin.rs:128:25 [INFO] [stdout] | [INFO] [stdout] 128 | / if !history.write_to_file(arg1).is_ok() { [INFO] [stdout] 129 | | let _ = stdout.write_fmt(format_args!( [INFO] [stdout] 130 | | "history: failed to write history to {arg1}" [INFO] [stdout] 131 | | )); [INFO] [stdout] 132 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 127 ~ "-w" [INFO] [stdout] 128 ~ if !history.write_to_file(arg1).is_ok() => { [INFO] [stdout] 129 | let _ = stdout.write_fmt(format_args!( [INFO] [stdout] 130 | "history: failed to write history to {arg1}" [INFO] [stdout] 131 | )); [INFO] [stdout] 132 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/builtin.rs:136:25 [INFO] [stdout] | [INFO] [stdout] 136 | / if !history.append_to_file(arg1).is_ok() { [INFO] [stdout] 137 | | let _ = stdout.write_fmt(format_args!( [INFO] [stdout] 138 | | "history: failed to append history to {arg1}" [INFO] [stdout] 139 | | )); [INFO] [stdout] 140 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 135 ~ "-a" [INFO] [stdout] 136 ~ if !history.append_to_file(arg1).is_ok() => { [INFO] [stdout] 137 | let _ = stdout.write_fmt(format_args!( [INFO] [stdout] 138 | "history: failed to append history to {arg1}" [INFO] [stdout] 139 | )); [INFO] [stdout] 140 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/command.rs:24:20 [INFO] [stdout] | [INFO] [stdout] 24 | context_chain: &Vec, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] = note: `#[warn(clippy::ptr_arg)]` on by default [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 24 - context_chain: &Vec, [INFO] [stdout] 24 + context_chain: &[EvalContext], [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/command.rs:37:44 [INFO] [stdout] | [INFO] [stdout] 37 | let _ = create_output_file(&file_name, context.append_stderr)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `file_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/command.rs:41:47 [INFO] [stdout] | [INFO] [stdout] 41 | let file = create_output_file(&file_name, context.append_stdout)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `file_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/command.rs:42:30 [INFO] [stdout] | [INFO] [stdout] 42 | eval_builtin(&context, file, history) [INFO] [stdout] | ^^^^^^^^ help: change this to: `context` [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/command.rs:45:34 [INFO] [stdout] | [INFO] [stdout] 45 | eval_builtin(&context, &std::io::stdout(), history) [INFO] [stdout] | ^^^^^^^^ help: change this to: `context` [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/command.rs:48:47 [INFO] [stdout] | [INFO] [stdout] 48 | let result = eval_builtin(&context, writer, history); [INFO] [stdout] | ^^^^^^^^ help: change this to: `context` [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/command.rs:72:43 [INFO] [stdout] | [INFO] [stdout] 72 | let file = create_output_file(&file_name, context.append_stdout)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `file_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/command.rs:85:43 [INFO] [stdout] | [INFO] [stdout] 85 | let file = create_output_file(&file_name, context.append_stderr)?; [INFO] [stdout] | ^^^^^^^^^^ help: change this to: `file_name` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary use of `.write(true)` because there is `.append(true)` [INFO] [stdout] --> src/history.rs:69:13 [INFO] [stdout] | [INFO] [stdout] 69 | .write(true) [INFO] [stdout] | ^^^^^^^^^^^^ help: remove `.write(true)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ineffective_open_options [INFO] [stdout] = note: `#[warn(clippy::ineffective_open_options)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:23:12 [INFO] [stdout] | [INFO] [stdout] 23 | if !history.append_from_file(histfile.to_str().unwrap()).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `history.append_from_file(histfile.to_str().unwrap()).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:199:12 [INFO] [stdout] | [INFO] [stdout] 199 | if !history.append_to_file(histfile.to_str().unwrap()).is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `history.append_to_file(histfile.to_str().unwrap()).is_err()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:22:5 [INFO] [stdout] | [INFO] [stdout] 22 | / if let Some(histfile) = std::env::var_os("HISTFILE") { [INFO] [stdout] 23 | | if !history.append_from_file(histfile.to_str().unwrap()).is_ok() { [INFO] [stdout] 24 | | eprintln!("Failed to read history file {}", histfile.to_str().unwrap()); [INFO] [stdout] 25 | | } [INFO] [stdout] 26 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] = note: `#[warn(clippy::collapsible_if)]` on by default [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 22 ~ if let Some(histfile) = std::env::var_os("HISTFILE") [INFO] [stdout] 23 ~ && !history.append_from_file(histfile.to_str().unwrap()).is_ok() { [INFO] [stdout] 24 | eprintln!("Failed to read history file {}", histfile.to_str().unwrap()); [INFO] [stdout] 25 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` can be collapsed into the outer `match` [INFO] [stdout] --> src/main.rs:59:25 [INFO] [stdout] | [INFO] [stdout] 59 | / if !input.is_empty() { [INFO] [stdout] 60 | | input.pop(); [INFO] [stdout] 61 | | // erase last char in raw mode [INFO] [stdout] 62 | | print!("\x08 \x08"); [INFO] [stdout] 63 | | } [INFO] [stdout] | |_________________________^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_match [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 58 ~ KeyCode::Backspace [INFO] [stdout] 59 ~ if !input.is_empty() => { [INFO] [stdout] 60 | input.pop(); [INFO] [stdout] 61 | // erase last char in raw mode [INFO] [stdout] 62 | print!("\x08 \x08"); [INFO] [stdout] 63 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this `if` statement can be collapsed [INFO] [stdout] --> src/main.rs:198:5 [INFO] [stdout] | [INFO] [stdout] 198 | / if let Some(histfile) = std::env::var_os("HISTFILE") { [INFO] [stdout] 199 | | if !history.append_to_file(histfile.to_str().unwrap()).is_ok() { [INFO] [stdout] 200 | | eprintln!( [INFO] [stdout] 201 | | "Failed to write history file {}", [INFO] [stdout] ... | [INFO] [stdout] 205 | | } [INFO] [stdout] | |_____^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stdout] help: collapse nested if block [INFO] [stdout] | [INFO] [stdout] 198 ~ if let Some(histfile) = std::env::var_os("HISTFILE") [INFO] [stdout] 199 ~ && !history.append_to_file(histfile.to_str().unwrap()).is_ok() { [INFO] [stdout] 200 | eprintln!( [INFO] [stdout] ... [INFO] [stdout] 203 | ); [INFO] [stdout] 204 ~ } [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/main.rs:210:34 [INFO] [stdout] | [INFO] [stdout] 210 | fn longest_common_prefix(tokens: &Vec) -> String { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stdout] help: change this to [INFO] [stdout] | [INFO] [stdout] 210 - fn longest_common_prefix(tokens: &Vec) -> String { [INFO] [stdout] 210 + fn longest_common_prefix(tokens: &[String]) -> String { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.08s [INFO] running `Command { std: "docker" "inspect" "185596a3dd86c60c1e323922221c5c86c798966590abb87fa39df747e41335dc", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "185596a3dd86c60c1e323922221c5c86c798966590abb87fa39df747e41335dc", kill_on_drop: false }` [INFO] [stdout] 185596a3dd86c60c1e323922221c5c86c798966590abb87fa39df747e41335dc