From 5a12a5e421d5ffcec145fb2a7b0fbfa7250c129f Mon Sep 17 00:00:00 2001 From: Thayne McCombs Date: Sun, 6 Mar 2022 23:41:03 -0700 Subject: [PATCH] Use full names in command.rs --- src/exec/command.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/exec/command.rs b/src/exec/command.rs index b373ca2..935b6f4 100644 --- a/src/exec/command.rs +++ b/src/exec/command.rs @@ -10,15 +10,15 @@ struct Outputs { stdout: Vec, stderr: Vec, } -struct OutputBuf<'a> { - out_perm: &'a Mutex<()>, +struct OutputBuffer<'a> { + output_permission: &'a Mutex<()>, outputs: Vec, } -impl<'a> OutputBuf<'a> { - fn new(out_perm: &'a Mutex<()>) -> Self { +impl<'a> OutputBuffer<'a> { + fn new(output_permission: &'a Mutex<()>) -> Self { Self { - out_perm, + output_permission, outputs: Vec::new(), } } @@ -34,7 +34,7 @@ impl<'a> OutputBuf<'a> { } // While this lock is active, this thread will be the only thread allowed // to write its outputs. - let _lock = self.out_perm.lock().unwrap(); + let _lock = self.output_permission.lock().unwrap(); let stdout = io::stdout(); let stderr = io::stderr(); @@ -55,7 +55,7 @@ pub fn execute_commands>( out_perm: &Mutex<()>, enable_output_buffering: bool, ) -> ExitCode { - let mut out_buf = OutputBuf::new(out_perm); + let mut output_buffer = OutputBuffer::new(out_perm); for mut cmd in cmds { // Spawn the supplied command. let output = if enable_output_buffering { @@ -70,20 +70,20 @@ pub fn execute_commands>( match output { Ok(output) => { if enable_output_buffering { - out_buf.push(output.stdout, output.stderr); + output_buffer.push(output.stdout, output.stderr); } if output.status.code() != Some(0) { - out_buf.write(); + output_buffer.write(); return ExitCode::GeneralError; } } Err(why) => { - out_buf.write(); + output_buffer.write(); return handle_cmd_error(&cmd, why); } } } - out_buf.write(); + output_buffer.write(); ExitCode::Success }