diff options
author | Aleksey Kladov <[email protected]> | 2020-07-01 08:06:51 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-07-01 08:06:51 +0100 |
commit | e336a96998710c94685d42435acccff15dc8cd4f (patch) | |
tree | f140a859ec5829be7f01cbca6e958632ab261c71 | |
parent | b1a2d016450c96581c9cc70cc464f8aab2e5c0f3 (diff) |
FileSetConfig works with empty set of roots
Closes #5139
-rw-r--r-- | crates/vfs/src/file_set.rs | 2 |
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 |