Chore: add comments to explicitly express two-step check
See https://github.com/rust-analyzer/rust-analyzer/pull/9836#discussion_r685953381
This commit is contained in:
parent
ae1288eeed
commit
0e480a6e9c
@ -136,10 +136,13 @@ pub fn contains_dir(&self, path: &AbsPath) -> bool {
|
||||
impl Directories {
|
||||
/// Returns `true` if `path` is included in `self`.
|
||||
pub fn contains_file(&self, path: &AbsPath) -> bool {
|
||||
// First, check the file extension...
|
||||
let ext = path.extension().unwrap_or_default();
|
||||
if self.extensions.iter().all(|it| it.as_str() != ext) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Then, check for path inclusion...
|
||||
self.includes_path(path)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user