aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-07-01 08:08:26 +0100
committerGitHub <[email protected]>2020-07-01 08:08:26 +0100
commit5749c42b71a2485148c374a15f087f0922c138e6 (patch)
treef140a859ec5829be7f01cbca6e958632ab261c71 /crates
parentb1a2d016450c96581c9cc70cc464f8aab2e5c0f3 (diff)
parente336a96998710c94685d42435acccff15dc8cd4f (diff)
Merge #5155
5155: FileSetConfig works with empty set of roots r=matklad a=matklad Closes #5139 bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates')
-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