1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
pub fn Fn(Option { Exclude, File, Pattern, Root, Separator, .. }: &Option) -> Return {
	WalkDir::new(Root)
		.into_iter()
		.filter_map(|Entry| {
			let Path = Entry.expect("Cannot Entry.").path().display().to_string();

			if !Exclude.clone().into_iter().filter(|Exclude| *Pattern != *Exclude).any(|Exclude| {
				let Match = Path.contains(&Exclude);

				match File {
					true => std::fs::metadata(&Path).expect("Cannot Metadata.").is_dir() && Match,
					false => Match,
				}
			}) {
				Some(Path.split(*Separator).map(|Entry| Entry.to_string()).collect())
			} else {
				None
			}
		})
		.collect::<Vec<_>>()
}

use crate::Struct::Binary::Command::{Entry::Type as Return, Option::Struct as Option};

use walkdir::WalkDir;