Skip to content

Commit

Permalink
return &str instead of File from API
Browse files Browse the repository at this point in the history
  • Loading branch information
kevaundray committed Dec 17, 2023
1 parent fa1cf5f commit e24738b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/fm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ impl FileManager {
assert!(old_value.is_none(), "ice: the same path was inserted into the file manager twice");
}

pub fn fetch_file(&self, file_id: FileId) -> File {
pub fn fetch_file(&self, file_id: FileId) -> &str {
// Unwrap as we ensure that all file_id's map to a corresponding file in the file map
self.file_map.get_file(file_id).unwrap()
self.file_map.get_file(file_id).unwrap().source()
}

pub fn path(&self, file_id: FileId) -> &Path {
Expand Down

0 comments on commit e24738b

Please sign in to comment.