aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_batch/src/vfs_filter.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_batch/src/vfs_filter.rs')
-rw-r--r--crates/ra_batch/src/vfs_filter.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_batch/src/vfs_filter.rs b/crates/ra_batch/src/vfs_filter.rs
index 2f0d8cb8b..63bf77704 100644
--- a/crates/ra_batch/src/vfs_filter.rs
+++ b/crates/ra_batch/src/vfs_filter.rs
@@ -1,32 +1,32 @@
1use ra_project_model::ProjectRoot; 1use ra_project_model::PackageRoot;
2use ra_vfs::{Filter, RelativePath, RootEntry}; 2use ra_vfs::{Filter, RelativePath, RootEntry};
3use std::path::PathBuf; 3use std::path::PathBuf;
4 4
5/// `IncludeRustFiles` is used to convert 5/// `IncludeRustFiles` is used to convert
6/// from `ProjectRoot` to `RootEntry` for VFS 6/// from `PackageRoot` to `RootEntry` for VFS
7pub struct IncludeRustFiles { 7pub struct IncludeRustFiles {
8 root: ProjectRoot, 8 root: PackageRoot,
9} 9}
10 10
11impl IncludeRustFiles { 11impl IncludeRustFiles {
12 pub fn from_roots<R>(roots: R) -> impl Iterator<Item = RootEntry> 12 pub fn from_roots<R>(roots: R) -> impl Iterator<Item = RootEntry>
13 where 13 where
14 R: IntoIterator<Item = ProjectRoot>, 14 R: IntoIterator<Item = PackageRoot>,
15 { 15 {
16 roots.into_iter().map(IncludeRustFiles::from_root) 16 roots.into_iter().map(IncludeRustFiles::from_root)
17 } 17 }
18 18
19 pub fn from_root(root: ProjectRoot) -> RootEntry { 19 pub fn from_root(root: PackageRoot) -> RootEntry {
20 IncludeRustFiles::from(root).into() 20 IncludeRustFiles::from(root).into()
21 } 21 }
22 22
23 #[allow(unused)] 23 #[allow(unused)]
24 pub fn external(path: PathBuf) -> RootEntry { 24 pub fn external(path: PathBuf) -> RootEntry {
25 IncludeRustFiles::from_root(ProjectRoot::new(path, false)) 25 IncludeRustFiles::from_root(PackageRoot::new(path, false))
26 } 26 }
27 27
28 pub fn member(path: PathBuf) -> RootEntry { 28 pub fn member(path: PathBuf) -> RootEntry {
29 IncludeRustFiles::from_root(ProjectRoot::new(path, true)) 29 IncludeRustFiles::from_root(PackageRoot::new(path, true))
30 } 30 }
31} 31}
32 32
@@ -40,8 +40,8 @@ impl Filter for IncludeRustFiles {
40 } 40 }
41} 41}
42 42
43impl From<ProjectRoot> for IncludeRustFiles { 43impl From<PackageRoot> for IncludeRustFiles {
44 fn from(v: ProjectRoot) -> IncludeRustFiles { 44 fn from(v: PackageRoot) -> IncludeRustFiles {
45 IncludeRustFiles { root: v } 45 IncludeRustFiles { root: v }
46 } 46 }
47} 47}