mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Merge #5155
5155: FileSetConfig works with empty set of roots r=matklad a=matklad Closes #5139 bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
5749c42b71
1 changed files with 1 additions and 1 deletions
|
@ -69,7 +69,7 @@ impl FileSetConfig {
|
|||
Ok(it) => it,
|
||||
Err(it) => it.saturating_sub(1),
|
||||
};
|
||||
if path.starts_with(&self.roots[idx].0) {
|
||||
if !self.roots.is_empty() && path.starts_with(&self.roots[idx].0) {
|
||||
self.roots[idx].1
|
||||
} else {
|
||||
self.len() - 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue