mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Reuse has_rs_extension in io.rs
This commit is contained in:
parent
07202f944c
commit
5dd602f901
1 changed files with 2 additions and 2 deletions
|
@ -8,7 +8,7 @@ use walkdir::{DirEntry, WalkDir};
|
||||||
use thread_worker::{WorkerHandle};
|
use thread_worker::{WorkerHandle};
|
||||||
use relative_path::RelativePathBuf;
|
use relative_path::RelativePathBuf;
|
||||||
|
|
||||||
use crate::VfsRoot;
|
use crate::{VfsRoot, has_rs_extension};
|
||||||
|
|
||||||
pub(crate) struct Task {
|
pub(crate) struct Task {
|
||||||
pub(crate) root: VfsRoot,
|
pub(crate) root: VfsRoot,
|
||||||
|
@ -59,7 +59,7 @@ fn load_root(root: &Path, filter: &dyn Fn(&DirEntry) -> bool) -> Vec<(RelativePa
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let path = entry.path();
|
let path = entry.path();
|
||||||
if path.extension().and_then(|os| os.to_str()) != Some("rs") {
|
if !has_rs_extension(path) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
let text = match fs::read_to_string(path) {
|
let text = match fs::read_to_string(path) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue