diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/runner/builtins/mod.rs | 2 | ||||
-rw-r--r-- | src/runner/command.rs | 5 |
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()); |