summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2022-02-28 14:23:03 -0500
committerJesse Luehrs <doy@tozt.net>2022-02-28 14:23:03 -0500
commit02ce9453e9c7972d420eb0e1e2d7e99dc77c97f1 (patch)
tree447e2dc3ebc84cf97af407542bb476efc0f45b1b /src
parentbac051c01a83fff8411524ade8e9ae15245ac526 (diff)
downloadnbsh-02ce9453e9c7972d420eb0e1e2d7e99dc77c97f1.tar.gz
nbsh-02ce9453e9c7972d420eb0e1e2d7e99dc77c97f1.zip
clippy
Diffstat (limited to 'src')
-rw-r--r--src/runner/builtins/mod.rs2
-rw-r--r--src/runner/command.rs5
2 files changed, 3 insertions, 4 deletions
diff --git a/src/runner/builtins/mod.rs b/src/runner/builtins/mod.rs
index 862f5b0..b714c58 100644
--- a/src/runner/builtins/mod.rs
+++ b/src/runner/builtins/mod.rs
@@ -225,7 +225,7 @@ fn command(
cfg: command::Cfg,
) -> Result<command::Child> {
exe.shift();
- let mut cmd = crate::runner::Command::new_binary(exe);
+ let mut cmd = crate::runner::Command::new_binary(&exe);
cfg.setup_command(&mut cmd);
Ok(command::Child::new_wrapped(cmd.spawn(env)?))
}
diff --git a/src/runner/command.rs b/src/runner/command.rs
index 059b173..cbc8dee 100644
--- a/src/runner/command.rs
+++ b/src/runner/command.rs
@@ -15,7 +15,7 @@ impl Command {
let redirects = exe.redirects().to_vec();
Self {
inner: super::builtins::Command::new(exe, io).map_or_else(
- |exe| Self::new_binary(exe).inner,
+ |exe| Self::new_binary(&exe).inner,
Inner::Builtin,
),
exe: exe_path,
@@ -24,8 +24,7 @@ impl Command {
}
}
- #[allow(clippy::needless_pass_by_value)]
- pub fn new_binary(exe: crate::parse::Exe) -> Self {
+ pub fn new_binary(exe: &crate::parse::Exe) -> Self {
let exe_path = exe.exe().to_path_buf();
let redirects = exe.redirects().to_vec();
let mut cmd = tokio::process::Command::new(exe.exe());