From 99561cf2f20ad572c7149644a70cd7740c0f8b86 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 18 Dec 2018 13:23:23 +0300 Subject: Add type alias --- crates/ra_vfs/src/lib.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crates/ra_vfs/src/lib.rs') diff --git a/crates/ra_vfs/src/lib.rs b/crates/ra_vfs/src/lib.rs index b80c12058..d4ba2cb45 100644 --- a/crates/ra_vfs/src/lib.rs +++ b/crates/ra_vfs/src/lib.rs @@ -27,10 +27,11 @@ use thread_worker::{WorkerHandle, Worker}; use crate::{ arena::{ArenaId, Arena}, - io::FileEvent, + io::{FileEvent, FsWorker}, }; -/// `RootFilter` is a predicate that checks if a file can belong to a root +/// `RootFilter` is a predicate that checks if a file can belong to a root. If +/// several filters match a file (nested dirs), the most nested one wins. struct RootFilter { root: PathBuf, file_filter: fn(&Path) -> bool, @@ -86,7 +87,7 @@ struct Vfs { roots: Arena, files: Arena, // pending_changes: Vec, - worker: Worker)>, + worker: FsWorker, worker_handle: WorkerHandle, } @@ -101,6 +102,7 @@ impl Vfs { worker_handle, }; + // A hack to make nesting work. roots.sort_by_key(|it| Reverse(it.as_os_str().len())); for path in roots { -- cgit v1.2.3