(&self, directory: &Path)
| 22 | } |
| 23 | |
| 24 | pub fn enable(&self, directory: &Path) { |
| 25 | if let Ok(mut file) = self.lock_file() { |
| 26 | let file_path = directory.join("engine.log"); |
| 27 | match File::create(file_path) { |
| 28 | Ok(new_file) => { |
| 29 | let new_file = BufWriter::new(new_file); |
| 30 | *file = Some(new_file); |
| 31 | self.file.0.store(true, Ordering::Relaxed) |
| 32 | } |
| 33 | Err(_) => *file = None, |
| 34 | } |
| 35 | } |
| 36 | } |
| 37 | |
| 38 | pub fn disable(&self) { |
| 39 | if let Ok(mut file) = self.lock_file() { |
no test coverage detected