(&mut self, path: &str)
| 107 | } |
| 108 | |
| 109 | pub fn open_file(&mut self, path: &str) -> Result<()> { |
| 110 | for (i, f) in self.files.iter().enumerate() { |
| 111 | if f.path.as_deref() == Some(path) { |
| 112 | self.current_file = i; |
| 113 | return Ok(()); |
| 114 | } |
| 115 | } |
| 116 | let file = OpenFile::from_path(path)?; |
| 117 | self.files.push(file); |
| 118 | self.current_file = self.files.len() - 1; |
| 119 | Ok(()) |
| 120 | } |
| 121 | |
| 122 | pub fn save_current(&mut self) -> Result<()> { |
| 123 | if let Some(f) = self.files.get_mut(self.current_file) { |
no outgoing calls
no test coverage detected