diff options
Diffstat (limited to 'src/loading/fs.rs')
| -rw-r--r-- | src/loading/fs.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/loading/fs.rs b/src/loading/fs.rs index d41a7dc1..c3ca332e 100644 --- a/src/loading/fs.rs +++ b/src/loading/fs.rs @@ -1,4 +1,4 @@ -use std::cell::RefCell; +use std::cell::{Ref, RefCell}; use std::collections::HashMap; use std::fs::{self, File}; use std::io; @@ -92,6 +92,11 @@ impl FsLoader { } } + /// Return the path of a resolved file. + pub fn path(&self, id: FileId) -> Ref<Path> { + Ref::map(self.paths.borrow(), |paths| paths[&id].as_path()) + } + #[cfg(all(unix, not(target_os = "macos")))] fn search_system_impl(&mut self) { self.search_path("/usr/share/fonts"); |
