aboutsummaryrefslogtreecommitdiff
path: root/crates/vfs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-07-01 08:06:51 +0100
committerAleksey Kladov <[email protected]>2020-07-01 08:06:51 +0100
commite336a96998710c94685d42435acccff15dc8cd4f (patch)
treef140a859ec5829be7f01cbca6e958632ab261c71 /crates/vfs
parentb1a2d016450c96581c9cc70cc464f8aab2e5c0f3 (diff)
FileSetConfig works with empty set of roots
Closes #5139
Diffstat (limited to 'crates/vfs')
-rw-r--r--crates/vfs/src/file_set.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/vfs/src/file_set.rs b/crates/vfs/src/file_set.rs
index d0ddeafe7..977ba3010 100644
--- a/crates/vfs/src/file_set.rs
+++ b/crates/vfs/src/file_set.rs
@@ -69,7 +69,7 @@ impl FileSetConfig {
69 Ok(it) => it, 69 Ok(it) => it,
70 Err(it) => it.saturating_sub(1), 70 Err(it) => it.saturating_sub(1),
71 }; 71 };
72 if path.starts_with(&self.roots[idx].0) { 72 if !self.roots.is_empty() && path.starts_with(&self.roots[idx].0) {
73 self.roots[idx].1 73 self.roots[idx].1
74 } else { 74 } else {
75 self.len() - 1 75 self.len() - 1