diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-29 22:46:54 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-29 22:46:54 +0000 |
commit | 748fbb5371b4ec1b2413dde057c3ae6e050481b7 (patch) | |
tree | 7faaff4e5e54baeeabd614e363c8f59ab33b66ae /crates/ra_vfs/src/io.rs | |
parent | 7fe32938b672d1fb9668b29061ac47b90f1ba599 (diff) | |
parent | 5dd602f90162cc3ec89751d76265c761b5aa2797 (diff) |
Merge #360
360: Improve comments and code in ra_vfs r=DJMcNab a=DJMcNab
Some random code/comment improvements I saw whilst trying to understand `ra_vfs`.
Let's see if this works:
bors r+
Co-authored-by: DJMcNab <[email protected]>
Diffstat (limited to 'crates/ra_vfs/src/io.rs')
-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) { |