Write data as json into output path if it exists.
(&self, maybe_path: Option<impl AsRef<Path>>)
| 176 | |
| 177 | /// Write data as json into output path if it exists. |
| 178 | pub fn maybe_write_json(&self, maybe_path: Option<impl AsRef<Path>>) -> Result<()> { |
| 179 | if let Some(path) = maybe_path { |
| 180 | std::fs::write(path, self.to_json())?; |
| 181 | }; |
| 182 | Ok(()) |
| 183 | } |
| 184 | } |