Make VFS join methods fallible

This commit is contained in:
Jonas Schievink 2020-06-26 16:25:08 +02:00
parent 38cd1b70e8
commit 72fe70f2f8
4 changed files with 27 additions and 9 deletions

View file

@ -18,7 +18,7 @@ impl FileSet {
pub fn resolve_path(&self, anchor: FileId, path: &str) -> Option<FileId> {
let mut base = self.paths[&anchor].clone();
base.pop();
let path = base.join(path);
let path = base.join(path)?;
let res = self.files.get(&path).copied();
res
}