Skip to content

Commit 3e688d2

Browse files
committed
Simplify
1 parent bc4d047 commit 3e688d2

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

crates/vfs/src/loader.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ impl Directories {
8383
self.includes_path(path)
8484
}
8585
fn includes_path(&self, path: &AbsPath) -> bool {
86-
let mut include = None;
86+
let mut include: Option<&AbsPathBuf> = None;
8787
for incl in &self.include {
88-
if is_prefix(incl, path) {
88+
if path.starts_with(incl) {
8989
include = Some(match include {
90-
Some(prev) if is_prefix(incl, prev) => prev,
90+
Some(prev) if prev.starts_with(incl) => prev,
9191
_ => incl,
9292
})
9393
}
@@ -97,15 +97,11 @@ impl Directories {
9797
None => return false,
9898
};
9999
for excl in &self.exclude {
100-
if is_prefix(excl, path) && is_prefix(include, excl) {
100+
if path.starts_with(excl) && excl.starts_with(include) {
101101
return false;
102102
}
103103
}
104-
return true;
105-
106-
fn is_prefix(short: &AbsPath, long: &AbsPath) -> bool {
107-
long.strip_prefix(short).is_some()
108-
}
104+
true
109105
}
110106
}
111107

0 commit comments

Comments
 (0)