]> git.lizzy.rs Git - rust.git/blobdiff - src/changes.rs
Merge pull request #128 from marcusklaas/subexpr
[rust.git] / src / changes.rs
index 3f0d985da483fa887882bf7a719eeb987cf5cf92..4cce45e5eb3af31a4a0f4a2198f108244fc200da 100644 (file)
@@ -99,6 +99,14 @@ pub fn push_str_span(&mut self, span: Span, text: &str) {
         self.push_str(&file_name, text)
     }
 
+    // Fetch the output buffer for the given file name.
+    // Panics on unknown files.
+    pub fn get(&mut self, file_name: &str) -> &StringBuffer {
+        self.file_map.get(file_name).unwrap()
+    }
+
+    // Fetch a mutable reference to the output buffer for the given file name.
+    // Panics on unknown files.
     pub fn get_mut(&mut self, file_name: &str) -> &mut StringBuffer {
         self.file_map.get_mut(file_name).unwrap()
     }