(&mut self, path: &str, content: &str)
| 29 | } |
| 30 | |
| 31 | pub fn create_snapshot(&mut self, path: &str, content: &str) { |
| 32 | self.snapshots.insert( |
| 33 | path.to_string(), |
| 34 | Snapshot { |
| 35 | content: content.to_string(), |
| 36 | }, |
| 37 | ); |
| 38 | } |
| 39 | |
| 40 | pub fn rollback(&self, path: &str) -> Option<String> { |
| 41 | self.snapshots.get(path).map(|s| s.content.clone()) |