fn write_json(path: &Path, results: &[Calculation]) -> Result<()>