summaryrefslogtreecommitdiffstats
path: root/src/common.rs
diff options
context:
space:
mode:
authorSebastian Thiel <sebastian.thiel@icloud.com>2020-03-15 20:23:10 +0800
committerSebastian Thiel <sebastian.thiel@icloud.com>2020-03-15 20:24:30 +0800
commit4990fa4202f2b687ee2476efe0a406fdfe23fd96 (patch)
tree79ad1e0379c2e233e4e416aafbc32e24bb0352ce /src/common.rs
parente873656d53d4071f70e73514a96eaa4cbfd23fc4 (diff)
Upgrade to jwalk 0.5; stop following symlinks during traversalv2.3.4
Diffstat (limited to 'src/common.rs')
-rw-r--r--src/common.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common.rs b/src/common.rs
index a1551b8..c4a71df 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -161,13 +161,17 @@ pub struct WalkOptions {
impl WalkOptions {
pub(crate) fn iter_from_path(&self, path: &Path) -> WalkDir {
WalkDir::new(path)
- .preload_metadata(true)
+ .follow_links(false)
.sort(match self.sorting {
TraversalSorting::None => false,
TraversalSorting::AlphabeticalByFileName => true,
})
.skip_hidden(false)
- .num_threads(self.threads)
+ .parallelism(if self.threads == 0 {
+ jwalk::Parallelism::RayonDefaultPool
+ } else {
+ jwalk::Parallelism::RayonNewPool(self.threads)
+ })
}
}