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(); // TODO: Separate this into Entry/Exclude.rs if !Exclude.clone().into_iter().filter(|Exclude| *Pattern != *Exclude).any(|Exclude| { let Match = Path.contains(&Exclude); match File { true => { std::fs::metadata(std::path::PathBuf::from(&Path)) .expect("Cannot Metadata.") .is_dir() && Match } false => Match, } }) { Some(Path.split(*Separator).map(|Entry| Entry.to_string()).collect()) } else { None } }) .collect::>() } use crate::Struct::Binary::Command::{Entry::Type as Return, Option::Struct as Option}; use walkdir::WalkDir;