diff options
author | DJMcNab <[email protected]> | 2018-12-29 22:45:01 +0000 |
---|---|---|
committer | DJMcNab <[email protected]> | 2018-12-29 22:45:01 +0000 |
commit | 5dd602f90162cc3ec89751d76265c761b5aa2797 (patch) | |
tree | 7faaff4e5e54baeeabd614e363c8f59ab33b66ae /crates/ra_vfs/src | |
parent | 07202f944c556ef71f6d6676189db73ed5980992 (diff) |
Reuse has_rs_extension in io.rs
Diffstat (limited to 'crates/ra_vfs/src')
-rw-r--r-- | crates/ra_vfs/src/io.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_vfs/src/io.rs b/crates/ra_vfs/src/io.rs index be400bae9..4cfdb83da 100644 --- a/crates/ra_vfs/src/io.rs +++ b/crates/ra_vfs/src/io.rs | |||
@@ -8,7 +8,7 @@ use walkdir::{DirEntry, WalkDir}; | |||
8 | use thread_worker::{WorkerHandle}; | 8 | use thread_worker::{WorkerHandle}; |
9 | use relative_path::RelativePathBuf; | 9 | use relative_path::RelativePathBuf; |
10 | 10 | ||
11 | use crate::VfsRoot; | 11 | use crate::{VfsRoot, has_rs_extension}; |
12 | 12 | ||
13 | pub(crate) struct Task { | 13 | pub(crate) struct Task { |
14 | pub(crate) root: VfsRoot, | 14 | pub(crate) root: VfsRoot, |
@@ -59,7 +59,7 @@ fn load_root(root: &Path, filter: &dyn Fn(&DirEntry) -> bool) -> Vec<(RelativePa | |||
59 | continue; | 59 | continue; |
60 | } | 60 | } |
61 | let path = entry.path(); | 61 | let path = entry.path(); |
62 | if path.extension().and_then(|os| os.to_str()) != Some("rs") { | 62 | if !has_rs_extension(path) { |
63 | continue; | 63 | continue; |
64 | } | 64 | } |
65 | let text = match fs::read_to_string(path) { | 65 | let text = match fs::read_to_string(path) { |