From ae1288eeed72c2b2a1ad638c1b9d99fa35035f91 Mon Sep 17 00:00:00 2001 From: Basti Ortiz <39114273+Some-Dood@users.noreply.github.com> Date: Tue, 10 Aug 2021 22:25:43 +0800 Subject: [PATCH] Fix: revert complex conditional in `Directories::contains_file` This reverts commit 6d0336b2e41703254b31f5d9a1358eb7e15cee3f. --- crates/vfs/src/loader.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/vfs/src/loader.rs b/crates/vfs/src/loader.rs index b1d3918cb9..211d4f7c78 100644 --- a/crates/vfs/src/loader.rs +++ b/crates/vfs/src/loader.rs @@ -137,7 +137,10 @@ impl Directories { /// Returns `true` if `path` is included in `self`. pub fn contains_file(&self, path: &AbsPath) -> bool { let ext = path.extension().unwrap_or_default(); - self.extensions.iter().any(|it| it.as_str() == ext) && self.includes_path(path) + if self.extensions.iter().all(|it| it.as_str() != ext) { + return false; + } + self.includes_path(path) } /// Returns `true` if `path` is included in `self`.