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
//! Convenience functions for working with paths.
use ;
/// Recursively finds all of the descendants of a file.
///
/// ## Example:
/// ```no_run
/// let paths = vec![
/// Path::from("files/a.txt"),
/// Path::from("files/b.txt"),
/// Path::from("files/more_files/c.txt"),
/// Path::from("files/more_files/d.txt"),
/// Path::from("files/more_files/even_more_files/e.txt"),
/// Path::from("files/more_files/even_more_files/f.txt")
/// ];
///
/// let descendants = get_descendants(Path::from("files/more_files"));
/// let expected = vec![
/// Path::from("files/more_files/c.txt"),
/// Path::from("files/more_files/d.txt"),
/// Path::from("files/more_files/even_more_files/e.txt"),
/// Path::from("files/more_files/even_more_files/f.txt")
/// ];
/// assert!(descendants == expected);
///
/// let descendants = get_descendants(Path::from("files"));
/// assert!(descendants == paths);
/// ```