10423: Internal: refactor for mdbook plugin r=Veykril a=HKalbasi

This PR is for upstreaming changes that I made for mdbook plugin. Changes are adding inlay hints to `StaticIndex` and changing some functions for working around privacy of crates.

Aside this, is it okay if I bring the plugin in tree? It is a simple binary crate. I feel it will better maintained here and become resistant to api changes.

Co-authored-by: hamidreza kalbasi <hamidrezakalbasi@protonmail.com>
This commit is contained in:
bors[bot] 2021-10-12 18:35:03 +00:00 committed by GitHub
commit f185d1c533
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 41 additions and 9 deletions

View file

@ -25,6 +25,12 @@ impl VfsPath {
VfsPath(VfsPathRepr::VirtualPath(VirtualPath(path)))
}
/// Create a path from string. Input should be a string representation of
/// an absolute path inside filesystem
pub fn new_real_path(path: String) -> VfsPath {
VfsPath::from(AbsPathBuf::assert(path.into()))
}
/// Returns the `AbsPath` representation of `self` if `self` is on the file system.
pub fn as_path(&self) -> Option<&AbsPath> {
match &self.0 {