From 3ad5d0de2149a15faf08781d607abc123233f5e1 Mon Sep 17 00:00:00 2001 From: SalOne22 <111443297+SalOne22@users.noreply.github.com> Date: Tue, 11 Jul 2023 17:44:43 +0200 Subject: [PATCH] Make code more readable --- src/main.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2ae6ff57..d8d14e9e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -391,18 +391,14 @@ fn collect_files( in_out_pairs } -#[cfg(target_os = "windows")] +#[cfg(windows)] fn apply_glob_pattern(path: PathBuf) -> Vec { - let mut paths = vec![]; let input_path = path.to_str().unwrap(); + glob::glob(input_path) .expect("Failed to read glob pattern") - .for_each(|path| { - let path = path.unwrap(); - paths.push(path) - }); - - paths + .map(|path| path.unwrap()) + .collect() } fn parse_opts_into_struct(