Skip to content

Commit 0e480a6

Browse files
committed
Chore: add comments to explicitly express two-step check
See #9836 (comment)
1 parent ae1288e commit 0e480a6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/vfs/src/loader.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,13 @@ impl Entry {
136136
impl Directories {
137137
/// Returns `true` if `path` is included in `self`.
138138
pub fn contains_file(&self, path: &AbsPath) -> bool {
139+
// First, check the file extension...
139140
let ext = path.extension().unwrap_or_default();
140141
if self.extensions.iter().all(|it| it.as_str() != ext) {
141142
return false;
142143
}
144+
145+
// Then, check for path inclusion...
143146
self.includes_path(path)
144147
}
145148

0 commit comments

Comments
 (0)