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
26
27
28
29
30
31
32
33
pub fn exclude_unwanted_search_objects(paths: Vec<String>, exclude: &str) -> Vec<String> {
    let mut new_paths = Vec::new();
    for mut path in paths {
        let actual_path: String = path.clone();
        path = path.to_lowercase();
        let breakers: Vec<&str> = path.split("\\").collect();
        if !breakers[breakers.len() - 1].contains(exclude) {
            new_paths.push(actual_path);
        }
    }
    new_paths
} 

pub fn include_only_wanted_search_objects(paths: Vec<String>, include_only: &str) -> Vec<String> {
    let mut new_paths: Vec<String> = Vec::new();
    for mut path in paths {
        let actual_path: String = path.clone();
        path = path.to_lowercase();
        let breakers: Vec<&str> = path.split("\\").collect();
        if breakers[breakers.len() - 1].contains(include_only) {
            new_paths.push(actual_path);
        }
    }
    new_paths
}

pub(crate) fn print(paths: Vec<String>) {
    println!("The paths are:");
    for i in &paths {
        println!("{}", i);
    }
    println!("Number of paths: {}", paths.len());
}