diff options
author | Bernardo <[email protected]> | 2019-01-25 21:13:55 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-26 08:46:37 +0000 |
commit | 410a3ae6e847b59f9930ce4d6bf9f3c5f1d72167 (patch) | |
tree | 5717d124c71de13412f61a8584b119da378828ae /crates/ra_vfs/src/io | |
parent | d63e1cebff771621b90bdce25ac013eecb415e1e (diff) |
use entry file_type, improve test
Diffstat (limited to 'crates/ra_vfs/src/io')
-rw-r--r-- | crates/ra_vfs/src/io/watcher.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_vfs/src/io/watcher.rs b/crates/ra_vfs/src/io/watcher.rs index 1d7ce2136..ff6775f59 100644 --- a/crates/ra_vfs/src/io/watcher.rs +++ b/crates/ra_vfs/src/io/watcher.rs | |||
@@ -65,7 +65,7 @@ impl Watcher { | |||
65 | { | 65 | { |
66 | match res { | 66 | match res { |
67 | Ok(entry) => { | 67 | Ok(entry) => { |
68 | if entry.path().is_dir() { | 68 | if entry.file_type().is_dir() { |
69 | watch_one(self.watcher.as_ref(), entry.path()); | 69 | watch_one(self.watcher.as_ref(), entry.path()); |
70 | } | 70 | } |
71 | } | 71 | } |
@@ -172,11 +172,11 @@ impl WatcherWorker { | |||
172 | let filter = &self.roots[root]; | 172 | let filter = &self.roots[root]; |
173 | for res in WalkDir::new(dir) | 173 | for res in WalkDir::new(dir) |
174 | .into_iter() | 174 | .into_iter() |
175 | .filter_entry(|entry| filter.can_contain(entry.path()).is_some()) | 175 | .filter_entry(filter.entry_filter()) |
176 | { | 176 | { |
177 | match res { | 177 | match res { |
178 | Ok(entry) => { | 178 | Ok(entry) => { |
179 | if entry.path().is_dir() { | 179 | if entry.file_type().is_dir() { |
180 | watch_one(self.watcher.as_ref(), entry.path()); | 180 | watch_one(self.watcher.as_ref(), entry.path()); |
181 | } else { | 181 | } else { |
182 | // emit only for files otherwise we will cause watch_recursive to be called again with a dir that we are already watching | 182 | // emit only for files otherwise we will cause watch_recursive to be called again with a dir that we are already watching |