Write the canonical [`PersistedConfig`] to disk.
(persisted: &PersistedConfig, config_name: Option<&str>)
| 216 | |
| 217 | /// Write the canonical [`PersistedConfig`] to disk. |
| 218 | fn write_persisted(persisted: &PersistedConfig, config_name: Option<&str>) -> Result<()> { |
| 219 | let config_path = get_configuration_file_path(config_name); |
| 220 | fs::create_dir_all(config_path.parent().unwrap())?; |
| 221 | let config_str = serde_yaml::to_string(persisted)?; |
| 222 | fs::write(&config_path, config_str)?; |
| 223 | debug!("Config written to {}", config_path.display()); |
| 224 | Ok(()) |
| 225 | } |
| 226 | |
| 227 | impl CodSpeedConfig { |
| 228 | pub fn load_with_profile( |
no test coverage detected