mirror of https://github.com/sharkdp/fd.git
simply mod by removing unnecessary function
This commit is contained in:
parent
d1b3bf41c1
commit
aefd6ac7af
|
@ -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]);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue