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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/// Generates a list of file paths from the specified root directory, excluding
/// paths that match any of the specified exclude patterns.
///
/// # Arguments
///
/// * `Option` - A reference to an `Option` struct containing the following
/// fields:
/// - `Exclude`: A vector of strings representing patterns to exclude.
/// - `Pattern`: A string pattern to match against the last element of each
/// entry.
/// - `Root`: The root directory to start the walk from.
/// - `Separator`: The separator used for splitting file paths.
///
/// # Returns
///
/// Returns a vector of vectors, where each inner vector contains the components
/// of a file path split by the specified separator.
///
/// # Panics
///
/// This function will panic if it encounters an error while reading a directory
/// entry.
///
/// # Example
///
/// ```
/// let options = Option {
/// Exclude:vec!["node_modules".to_string(), "target".to_string()],
/// Pattern:".git".to_string(),
/// Root:".".to_string(),
/// Separator:'/',
/// };
/// let paths = Fn(&options);
/// for path in paths {
/// println!("{:?}", path);
/// }
/// ```
use WalkDir;
use crate;