From 5dd602f90162cc3ec89751d76265c761b5aa2797 Mon Sep 17 00:00:00 2001 From: DJMcNab <36049421+DJMcNab@users.noreply.github.com> Date: Sat, 29 Dec 2018 22:45:01 +0000 Subject: Reuse has_rs_extension in io.rs --- crates/ra_vfs/src/io.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_vfs/src') 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}; use thread_worker::{WorkerHandle}; use relative_path::RelativePathBuf; -use crate::VfsRoot; +use crate::{VfsRoot, has_rs_extension}; pub(crate) struct Task { pub(crate) root: VfsRoot, @@ -59,7 +59,7 @@ fn load_root(root: &Path, filter: &dyn Fn(&DirEntry) -> bool) -> Vec<(RelativePa continue; } let path = entry.path(); - if path.extension().and_then(|os| os.to_str()) != Some("rs") { + if !has_rs_extension(path) { continue; } let text = match fs::read_to_string(path) { -- cgit v1.2.3