about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/bootstrap/src/utils/execution_context.rs26
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();