From 8360c9eaf493f5781222a84f89f1f6e7b693354e Mon Sep 17 00:00:00 2001 From: Braden Godley Date: Thu, 2 May 2024 00:36:21 -0700 Subject: [PATCH] run cargo fmt --- src/cli.rs | 1 - src/exec/command.rs | 8 ++++---- src/walk.rs | 11 +++++------ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index 4f22ccb..df955d9 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -907,4 +907,3 @@ fn ensure_current_directory_exists(current_directory: &Path) -> anyhow::Result<( )) } } - diff --git a/src/exec/command.rs b/src/exec/command.rs index f67f837..bc173a3 100644 --- a/src/exec/command.rs +++ b/src/exec/command.rs @@ -70,7 +70,7 @@ pub fn execute_commands>>( 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>>( 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>>( path: &std::path::Path, @@ -137,10 +137,10 @@ pub fn execute_commands_filtering>>( } else { return ExitCode::GeneralError; } - }, + } Err(why) => { return handle_cmd_error(Some(&cmd), why); - }, + } } } output_buffer.write(); diff --git a/src/walk.rs b/src/walk.rs index 3a8167b..d4b50de 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -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();