(&mut self)
| 57 | } |
| 58 | |
| 59 | pub fn save(&mut self) -> Result<()> { |
| 60 | let path = self |
| 61 | .path |
| 62 | .as_ref() |
| 63 | .context("File has no path. Use Ctrl+Shift+S")?; |
| 64 | let content = self.buffer.text(); |
| 65 | std::fs::write(path, content)?; |
| 66 | self.modified = false; |
| 67 | Ok(()) |
| 68 | } |
| 69 | |
| 70 | pub fn title(&self) -> String { |
| 71 | match &self.path { |
no test coverage detected