Skip to main content

save_models_config

Function save_models_config 

Source
pub fn save_models_config(cfg: &ModelsConfig) -> Result<(), ConfigError>
Expand description

Atomically write the whole ~/.rpi/models.json (used by the interactive provider form). Note: unlike crate::settings::save_settings, this serializes the modeled config directly, so hand-written comments and unknown fields in models.json are not preserved on rewrite. A timestamped models.json.bak-* snapshot is written first so a mistake can be reverted.