run cargo fmt

This commit is contained in:
Braden Godley 2024-05-02 00:36:21 -07:00
parent aefd6ac7af
commit 8360c9eaf4
3 changed files with 9 additions and 11 deletions

View File

@ -907,4 +907,3 @@ fn ensure_current_directory_exists(current_directory: &Path) -> anyhow::Result<(
))
}
}

View File

@ -70,7 +70,7 @@ pub fn execute_commands<I: Iterator<Item = io::Result<Command>>>(
cmd.output()
} else {
// If running on only one thread, don't buffer output; instead just
// write directly to stdout. Allows for viewing and interacting with
// write directly to stdout. Allows for viewing and interacting with
// intermediate command output
cmd.spawn().and_then(|c| c.wait_with_output())
};
@ -96,7 +96,7 @@ pub fn execute_commands<I: Iterator<Item = io::Result<Command>>>(
ExitCode::Success
}
/// Executes a command and pushes the path to the buffer if it succeeded with a
/// Executes a command and pushes the path to the buffer if it succeeded with a
/// non-zero exit code.
pub fn execute_commands_filtering<I: Iterator<Item = io::Result<Command>>>(
path: &std::path::Path,
@ -137,10 +137,10 @@ pub fn execute_commands_filtering<I: Iterator<Item = io::Result<Command>>>(
} else {
return ExitCode::GeneralError;
}
},
}
Err(why) => {
return handle_cmd_error(Some(&cmd), why);
},
}
}
}
output_buffer.write();

View File

@ -409,9 +409,7 @@ impl WorkerState {
// This will be set to `Some` if the `--exec` argument was supplied.
if let Some(ref cmd) = config.command {
match cmd.get_mode() {
exec::ExecutionMode::Batch => {
exec::batch(rx.into_iter().flatten(), cmd, config)
},
exec::ExecutionMode::Batch => exec::batch(rx.into_iter().flatten(), cmd, config),
exec::ExecutionMode::OneByOne | exec::ExecutionMode::FilterResults => {
let out_perm = Mutex::new(());
let filter = cmd.get_mode() == exec::ExecutionMode::FilterResults;
@ -424,8 +422,9 @@ impl WorkerState {
let rx = rx.clone();
// Spawn a job thread that will listen for and execute inputs.
let handle = scope
.spawn(|| exec::job(rx.into_iter().flatten(), cmd, &out_perm, config, filter));
let handle = scope.spawn(|| {
exec::job(rx.into_iter().flatten(), cmd, &out_perm, config, filter)
});
// Push the handle of the spawned thread into the vector for later joining.
handles.push(handle);
@ -433,7 +432,7 @@ impl WorkerState {
let exit_codes = handles.into_iter().map(|handle| handle.join().unwrap());
merge_exitcodes(exit_codes)
})
},
}
}
} else {
let stdout = io::stdout().lock();