simply mod by removing unnecessary function

This commit is contained in:
Braden Godley 2024-05-01 23:16:24 -07:00
parent d1b3bf41c1
commit aefd6ac7af
2 changed files with 13 additions and 29 deletions

View File

@ -35,21 +35,13 @@ pub fn job(
};
// Generate a command, execute it and store its exit code.
let code = if filter {
cmd.execute_filter(
dir_entry.stripped_path(config),
config.path_separator.as_deref(),
out_perm,
buffer_output,
)
} else {
cmd.execute(
dir_entry.stripped_path(config),
config.path_separator.as_deref(),
out_perm,
buffer_output,
)
};
let code = cmd.execute(
dir_entry.stripped_path(config),
config.path_separator.as_deref(),
out_perm,
buffer_output,
filter,
);
ret = merge_exitcodes([ret, code]);
}

View File

@ -107,26 +107,18 @@ impl CommandSet {
path_separator: Option<&str>,
out_perm: &Mutex<()>,
buffer_output: bool,
filter: bool,
) -> ExitCode {
let commands = self
.commands
.iter()
.map(|c| c.generate(input, path_separator));
execute_commands(commands, out_perm, buffer_output)
}
pub fn execute_filter(
&self,
input: &Path,
path_separator: Option<&str>,
out_perm: &Mutex<()>,
buffer_output: bool,
) -> ExitCode {
let commands = self
.commands
.iter()
.map(|c| c.generate(input, path_separator));
execute_commands_filtering(input, commands, out_perm, buffer_output)
if filter {
execute_commands_filtering(input, commands, out_perm, buffer_output)
} else {
execute_commands(commands, out_perm, buffer_output)
}
}
pub fn execute_batch<I>(&self, paths: I, limit: usize, path_separator: Option<&str>) -> ExitCode