diff options
| author | bit-aloo <sshourya17@gmail.com> | 2025-06-17 18:13:34 +0530 |
|---|---|---|
| committer | bit-aloo <sshourya17@gmail.com> | 2025-06-17 20:49:19 +0530 |
| commit | 0c60856ed19acd0786bac3543dab42e7253bda31 (patch) | |
| tree | 0abecf86cc6866bdab5a57d21054cb87b20c60be | |
| parent | b16ba4d3ee8c783cf33fb31a8c8a40d81a5316c2 (diff) | |
remove new method from command execution
| -rw-r--r-- | src/bootstrap/src/utils/execution_context.rs | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/bootstrap/src/utils/execution_context.rs b/src/bootstrap/src/utils/execution_context.rs index 778ef1b0fc1..c0544afc5ec 100644 --- a/src/bootstrap/src/utils/execution_context.rs +++ b/src/bootstrap/src/utils/execution_context.rs @@ -90,7 +90,13 @@ impl ExecutionContext { command.mark_as_executed(); if self.dry_run() && !command.run_always { - return DeferredCommand::new(None, stdout, stderr, command, Arc::new(self.clone())); + return DeferredCommand { + process: None, + stdout, + stderr, + command, + exec_ctx: Arc::new(self.clone()), + }; } #[cfg(feature = "tracing")] @@ -109,7 +115,13 @@ impl ExecutionContext { let child = cmd.spawn().unwrap(); - DeferredCommand::new(Some(child), stdout, stderr, command, Arc::new(self.clone())) + DeferredCommand { + process: Some(child), + stdout, + stderr, + command, + exec_ctx: Arc::new(self.clone()), + } } /// Execute a command and return its output. @@ -158,16 +170,6 @@ pub struct DeferredCommand<'a> { } impl<'a> DeferredCommand<'a> { - pub fn new( - child: Option<Child>, - stdout: OutputMode, - stderr: OutputMode, - command: &'a mut BootstrapCommand, - exec_ctx: Arc<ExecutionContext>, - ) -> Self { - DeferredCommand { process: child, stdout, stderr, command, exec_ctx } - } - pub fn wait_for_output(mut self) -> CommandOutput { if self.process.is_none() { return CommandOutput::default(); |
