diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-07-31 22:59:14 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-08-01 00:00:36 +0200 |
| commit | 3c92bad9a7cd6b880de197806443ffcce2cac9d8 (patch) | |
| tree | 1faf79c66e23bc37711af16ad690a9878e28d348 /src/loading/fs.rs | |
| parent | fbd3d191137aac8188ab8c6503d257d65d873972 (diff) | |
Pretty-printed diagnostics with traceback
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"); |
