From 4095ee32f6a1cd4bc57084dfdf4ccc1ff650d135 Mon Sep 17 00:00:00 2001 From: Steppy Date: Wed, 5 Feb 2025 00:02:54 +0100 Subject: [PATCH] Make environment in EnvCommand mutable --- src/shell_interface.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/shell_interface.rs b/src/shell_interface.rs index 8487f50..a19d4a7 100644 --- a/src/shell_interface.rs +++ b/src/shell_interface.rs @@ -11,7 +11,7 @@ use std::process::Command; #[derive(Debug)] pub struct EnvCommand<'a, E> { command: ShellCommand, - environment: &'a E, + environment: &'a mut E, } #[derive(Debug, Clone)] @@ -34,7 +34,7 @@ pub enum ShellCommand { } impl ShellCommand { - pub fn at(self, environment: &E) -> EnvCommand { + pub fn at(self, environment: &mut E) -> EnvCommand { EnvCommand { command: self, environment, @@ -93,7 +93,7 @@ fn command_to_string(command: &Command) -> String { .join(" ") } -fn build_command_from_shell_command(shell_command: &ShellCommand) -> Command { +fn build_command_from_shell_command(_shell_command: &ShellCommand) -> Command { todo!() } @@ -123,6 +123,8 @@ pub trait ShellInterface { } } +//TODO implement shell interface for env command + pub trait MaybeCast { fn maybe_cast(&self) -> Option<&T>; }