[INFO] cloning repository https://github.com/kuv2707/shell_codecrafters [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/kuv2707/shell_codecrafters" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fkuv2707%2Fshell_codecrafters", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fkuv2707%2Fshell_codecrafters'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 5908d6dd2b96348d13ae3439991a183b662aa450 [INFO] linting kuv2707/shell_codecrafters against nightly for clippy-nonminimal_bool-denied [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fkuv2707%2Fshell_codecrafters" "/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/kuv2707/shell_codecrafters [INFO] finished tweaking git repo https://github.com/kuv2707/shell_codecrafters [INFO] tweaked toml for git repo https://github.com/kuv2707/shell_codecrafters written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/kuv2707/shell_codecrafters 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/kuv2707/shell_codecrafters 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 syn v2.0.75 [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] 243478127aee9f13810aa34826bcc26af287cd3bf1d85bb099847f8430e27a5c [INFO] running `Command { std: "docker" "start" "-a" "243478127aee9f13810aa34826bcc26af287cd3bf1d85bb099847f8430e27a5c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "243478127aee9f13810aa34826bcc26af287cd3bf1d85bb099847f8430e27a5c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "243478127aee9f13810aa34826bcc26af287cd3bf1d85bb099847f8430e27a5c", kill_on_drop: false }` [INFO] [stdout] 243478127aee9f13810aa34826bcc26af287cd3bf1d85bb099847f8430e27a5c [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] 78c5d75457477e94acdbe66dc0cdded345dd602776d94b59e2f3dc44de6474e1 [INFO] running `Command { std: "docker" "start" "-a" "78c5d75457477e94acdbe66dc0cdded345dd602776d94b59e2f3dc44de6474e1", kill_on_drop: false }` [INFO] [stderr] Compiling thiserror v1.0.63 [INFO] [stderr] Checking bytes v1.7.1 [INFO] [stderr] Compiling syn v2.0.75 [INFO] [stderr] Compiling thiserror-impl v1.0.63 [INFO] [stderr] Checking codecrafters-shell v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utils.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | return input; [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] 19 - return input; [INFO] [stdout] 19 + input [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/utils.rs:26:20 [INFO] [stdout] | [INFO] [stdout] 26 | if !entry.is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `entry.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: binary comparison to literal `Option::None` [INFO] [stdout] --> src/utils.rs:106:20 [INFO] [stdout] | [INFO] [stdout] 106 | if newpath_parts.pop_back() == None || newpath_parts.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `newpath_parts.pop_back().is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils.rs:106:56 [INFO] [stdout] | [INFO] [stdout] 106 | if newpath_parts.pop_back() == None || newpath_parts.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `newpath_parts.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: comparison to empty slice [INFO] [stdout] --> src/utils.rs:111:20 [INFO] [stdout] | [INFO] [stdout] 111 | if dir != "" { [INFO] [stdout] | ^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!dir.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils.rs:206:20 [INFO] [stdout] | [INFO] [stdout] 206 | if temp.len() > 0 { [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: length comparison to zero [INFO] [stdout] --> src/utils.rs:214:21 [INFO] [stdout] | [INFO] [stdout] 214 | .filter(|s| s.trim().len() > 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.trim().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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/main.rs:10:15 [INFO] [stdout] | [INFO] [stdout] 10 | builtins: HashMap) -> ()>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [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:35:48 [INFO] [stdout] | [INFO] [stdout] 35 | fn echo_builtin(_ctx: &mut ShellContext, toks: &Vec<&str>) { [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] 35 - fn echo_builtin(_ctx: &mut ShellContext, toks: &Vec<&str>) { [INFO] [stdout] 35 + fn echo_builtin(_ctx: &mut ShellContext, toks: &[&str]) { [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:43:47 [INFO] [stdout] | [INFO] [stdout] 43 | fn type_builtin(ctx: &mut ShellContext, toks: &Vec<&str>) { [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] 43 - fn type_builtin(ctx: &mut ShellContext, toks: &Vec<&str>) { [INFO] [stdout] 43 + fn type_builtin(ctx: &mut ShellContext, toks: &[&str]) { [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:57:45 [INFO] [stdout] | [INFO] [stdout] 57 | fn cd_builtin(ctx: &mut ShellContext, toks: &Vec<&str>) { [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] 57 - fn cd_builtin(ctx: &mut ShellContext, toks: &Vec<&str>) { [INFO] [stdout] 57 + fn cd_builtin(ctx: &mut ShellContext, toks: &[&str]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `exec` after checking its variant with `is_none` [INFO] [stdout] --> src/main.rs:77:20 [INFO] [stdout] | [INFO] [stdout] 74 | if exec.is_none() { [INFO] [stdout] | ----------------- help: try: `if let Some() = exec` [INFO] [stdout] ... [INFO] [stdout] 77 | let exec = exec.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/main.rs:66:8 [INFO] [stdout] | [INFO] [stdout] 66 | if input.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `input.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/main.rs:83:23 [INFO] [stdout] | [INFO] [stdout] 83 | fn exec_command(toks: &Vec<&str>, input: &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] 83 - fn exec_command(toks: &Vec<&str>, input: &String) { [INFO] [stdout] 83 + fn exec_command(toks: &[&str], input: &String) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/main.rs:83:42 [INFO] [stdout] | [INFO] [stdout] 83 | fn exec_command(toks: &Vec<&str>, input: &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] 83 - fn exec_command(toks: &Vec<&str>, input: &String) { [INFO] [stdout] 83 + fn exec_command(toks: &Vec<&str>, input: &str) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unneeded `return` statement [INFO] [stdout] --> src/utils.rs:19:5 [INFO] [stdout] | [INFO] [stdout] 19 | return input; [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] 19 - return input; [INFO] [stdout] 19 + input [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/utils.rs:26:20 [INFO] [stdout] | [INFO] [stdout] 26 | if !entry.is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^^^ help: try: `entry.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 expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:90:43 [INFO] [stdout] | [INFO] [stdout] 90 | let out = String::from_utf8_lossy(&output.stdout.as_slice()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `output.stdout.as_slice()` [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 `get(s).is_some()` [INFO] [stdout] --> src/main.rs:98:18 [INFO] [stdout] | [INFO] [stdout] 98 | ctx.builtins.get(s).is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(s)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:103:8 [INFO] [stdout] | [INFO] [stdout] 103 | if !new.is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `new.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: called `unwrap_err` on `new` after checking its variant with `is_ok` [INFO] [stdout] --> src/main.rs:104:25 [INFO] [stdout] | [INFO] [stdout] 103 | if !new.is_ok() { [INFO] [stdout] | ----------- the check is happening here [INFO] [stdout] 104 | eprintln!("{}", new.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: binary comparison to literal `Option::None` [INFO] [stdout] --> src/utils.rs:106:20 [INFO] [stdout] | [INFO] [stdout] 106 | if newpath_parts.pop_back() == None || newpath_parts.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `Option::is_none()` instead: `newpath_parts.pop_back().is_none()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#partialeq_to_none [INFO] [stdout] = note: `#[warn(clippy::partialeq_to_none)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils.rs:106:56 [INFO] [stdout] | [INFO] [stdout] 106 | if newpath_parts.pop_back() == None || newpath_parts.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `newpath_parts.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: comparison to empty slice [INFO] [stdout] --> src/utils.rs:111:20 [INFO] [stdout] | [INFO] [stdout] 111 | if dir != "" { [INFO] [stdout] | ^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!dir.is_empty()` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty [INFO] [stdout] = note: `#[warn(clippy::comparison_to_empty)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/utils.rs:206:20 [INFO] [stdout] | [INFO] [stdout] 206 | if temp.len() > 0 { [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: length comparison to zero [INFO] [stdout] --> src/utils.rs:214:21 [INFO] [stdout] | [INFO] [stdout] 214 | .filter(|s| s.trim().len() > 0) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ help: using `!is_empty` is clearer and more explicit: `!s.trim().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: very complex type used. Consider factoring parts into `type` definitions [INFO] [stdout] --> src/main.rs:10:15 [INFO] [stdout] | [INFO] [stdout] 10 | builtins: HashMap) -> ()>, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity [INFO] [stdout] = note: `#[warn(clippy::type_complexity)]` on by default [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:35:48 [INFO] [stdout] | [INFO] [stdout] 35 | fn echo_builtin(_ctx: &mut ShellContext, toks: &Vec<&str>) { [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] 35 - fn echo_builtin(_ctx: &mut ShellContext, toks: &Vec<&str>) { [INFO] [stdout] 35 + fn echo_builtin(_ctx: &mut ShellContext, toks: &[&str]) { [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:43:47 [INFO] [stdout] | [INFO] [stdout] 43 | fn type_builtin(ctx: &mut ShellContext, toks: &Vec<&str>) { [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] 43 - fn type_builtin(ctx: &mut ShellContext, toks: &Vec<&str>) { [INFO] [stdout] 43 + fn type_builtin(ctx: &mut ShellContext, toks: &[&str]) { [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:57:45 [INFO] [stdout] | [INFO] [stdout] 57 | fn cd_builtin(ctx: &mut ShellContext, toks: &Vec<&str>) { [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] 57 - fn cd_builtin(ctx: &mut ShellContext, toks: &Vec<&str>) { [INFO] [stdout] 57 + fn cd_builtin(ctx: &mut ShellContext, toks: &[&str]) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: called `unwrap` on `exec` after checking its variant with `is_none` [INFO] [stdout] --> src/main.rs:77:20 [INFO] [stdout] | [INFO] [stdout] 74 | if exec.is_none() { [INFO] [stdout] | ----------------- help: try: `if let Some() = exec` [INFO] [stdout] ... [INFO] [stdout] 77 | let exec = exec.unwrap(); [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] = note: `#[warn(clippy::unnecessary_unwrap)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: length comparison to zero [INFO] [stdout] --> src/main.rs:66:8 [INFO] [stdout] | [INFO] [stdout] 66 | if input.len() == 0 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: using `is_empty` is clearer and more explicit: `input.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: writing `&Vec` instead of `&[_]` involves a new object where a slice will do [INFO] [stdout] --> src/main.rs:83:23 [INFO] [stdout] | [INFO] [stdout] 83 | fn exec_command(toks: &Vec<&str>, input: &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] 83 - fn exec_command(toks: &Vec<&str>, input: &String) { [INFO] [stdout] 83 + fn exec_command(toks: &[&str], input: &String) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: writing `&String` instead of `&str` involves a new object where a slice will do [INFO] [stdout] --> src/main.rs:83:42 [INFO] [stdout] | [INFO] [stdout] 83 | fn exec_command(toks: &Vec<&str>, input: &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] 83 - fn exec_command(toks: &Vec<&str>, input: &String) { [INFO] [stdout] 83 + fn exec_command(toks: &Vec<&str>, input: &str) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this expression creates a reference which is immediately dereferenced by the compiler [INFO] [stdout] --> src/main.rs:90:43 [INFO] [stdout] | [INFO] [stdout] 90 | let out = String::from_utf8_lossy(&output.stdout.as_slice()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: change this to: `output.stdout.as_slice()` [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 `get(s).is_some()` [INFO] [stdout] --> src/main.rs:98:18 [INFO] [stdout] | [INFO] [stdout] 98 | ctx.builtins.get(s).is_some() [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: replace it with: `contains_key(s)` [INFO] [stdout] | [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check [INFO] [stdout] = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: this boolean expression can be simplified [INFO] [stdout] --> src/main.rs:103:8 [INFO] [stdout] | [INFO] [stdout] 103 | if !new.is_ok() { [INFO] [stdout] | ^^^^^^^^^^^^ help: try: `new.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: called `unwrap_err` on `new` after checking its variant with `is_ok` [INFO] [stdout] --> src/main.rs:104:25 [INFO] [stdout] | [INFO] [stdout] 103 | if !new.is_ok() { [INFO] [stdout] | ----------- the check is happening here [INFO] [stdout] 104 | eprintln!("{}", new.unwrap_err()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: try using `match` [INFO] [stdout] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 4.46s [INFO] running `Command { std: "docker" "inspect" "78c5d75457477e94acdbe66dc0cdded345dd602776d94b59e2f3dc44de6474e1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "78c5d75457477e94acdbe66dc0cdded345dd602776d94b59e2f3dc44de6474e1", kill_on_drop: false }` [INFO] [stdout] 78c5d75457477e94acdbe66dc0cdded345dd602776d94b59e2f3dc44de6474e1