From 91860bf68205f1fbd41e6c01a5bf0decbbbfe0c4 Mon Sep 17 00:00:00 2001 From: Jonah Caplan Date: Sat, 16 Oct 2021 00:02:37 -0400 Subject: [PATCH] fmt --- src/exec/job.rs | 36 +++++++++++++++++++----------------- src/exec/mod.rs | 1 - src/main.rs | 2 +- src/walk.rs | 8 +++++++- tests/tests.rs | 2 +- 5 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/exec/job.rs b/src/exec/job.rs index 0cc70ad..d940707 100644 --- a/src/exec/job.rs +++ b/src/exec/job.rs @@ -2,11 +2,11 @@ use std::path::PathBuf; use std::sync::mpsc::Receiver; use std::sync::{Arc, Mutex}; +use crate::config::Config; use crate::error::print_error; use crate::exit_codes::{merge_exitcodes, ExitCode}; -use crate::walk::WorkerResult; use crate::filesystem::strip_current_dir; -use crate::config::Config; +use crate::walk::WorkerResult; use super::CommandTemplate; @@ -60,21 +60,23 @@ pub fn batch( buffer_output: bool, config: &Arc, ) -> ExitCode { - let paths = rx.iter().filter_map(|value| match value { - WorkerResult::Entry(val) => Some(val), - WorkerResult::Error(err) => { - if show_filesystem_errors { - print_error(err.to_string()); + let paths = rx + .iter() + .filter_map(|value| match value { + WorkerResult::Entry(val) => Some(val), + WorkerResult::Error(err) => { + if show_filesystem_errors { + print_error(err.to_string()); + } + None } - None - } - }) - .map(|m| { - if config.no_strip { - m - } else { - strip_current_dir(&m).to_path_buf() - } - }); + }) + .map(|m| { + if config.no_strip { + m + } else { + strip_current_dir(&m).to_path_buf() + } + }); cmd.generate_and_execute_batch(paths, buffer_output) } diff --git a/src/exec/mod.rs b/src/exec/mod.rs index ad3b4c5..15e1ae5 100644 --- a/src/exec/mod.rs +++ b/src/exec/mod.rs @@ -144,7 +144,6 @@ impl CommandTemplate { out_perm: Arc>, buffer_output: bool, ) -> ExitCode { - let mut cmd = Command::new(self.args[0].generate(&input, self.path_separator.as_deref())); for arg in &self.args[1..] { cmd.arg(arg.generate(&input, self.path_separator.as_deref())); diff --git a/src/main.rs b/src/main.rs index 47e68bd..e9ad6f7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -376,7 +376,7 @@ fn construct_config(matches: clap::ArgMatches, pattern_regex: &str) -> Result