internal: Restructure some semantics APIs for virtual macro files

This commit is contained in:
Lukas Wirth 2025-05-30 22:02:59 +02:00
parent f0e39c77cc
commit 38bf4b1fe1
12 changed files with 185 additions and 79 deletions

View file

@ -39,6 +39,13 @@ impl VfsPath {
}
}
pub fn into_abs_path(self) -> Option<AbsPathBuf> {
match self.0 {
VfsPathRepr::PathBuf(it) => Some(it),
VfsPathRepr::VirtualPath(_) => None,
}
}
/// Creates a new `VfsPath` with `path` adjoined to `self`.
pub fn join(&self, path: &str) -> Option<VfsPath> {
match &self.0 {