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
#[cfg(feature = "parallel")]
pub mod walkdir {
pub use jwalk::{DirEntry as DirEntryGeneric, DirEntryIter as DirEntryIterGeneric, Error, WalkDir};
use std::path::Path;
pub type DirEntry = DirEntryGeneric<((), ())>;
pub fn walkdir_new(root: impl AsRef<Path>) -> WalkDir {
WalkDir::new(root).skip_hidden(false)
}
pub fn walkdir_sorted_new(root: impl AsRef<Path>) -> WalkDir {
WalkDir::new(root).sort(true)
}
pub type DirEntryIter = DirEntryIterGeneric<((), ())>;
}
#[cfg(all(feature = "walkdir", not(feature = "parallel")))]
pub mod walkdir {
use std::path::Path;
pub use walkdir::{DirEntry, Error, WalkDir};
pub fn walkdir_new(root: impl AsRef<Path>) -> WalkDir {
WalkDir::new(root)
}
pub fn walkdir_sorted_new(root: impl AsRef<Path>) -> WalkDir {
WalkDir::new(root).sort_by_file_name()
}
pub type DirEntryIter = walkdir::IntoIter;
}
#[cfg(any(feature = "walkdir", feature = "jwalk"))]
pub use self::walkdir::{walkdir_new, walkdir_sorted_new, WalkDir};