Skip to main content

save_repos_conf_file

Function save_repos_conf_file 

Source
pub fn save_repos_conf_file(
    path: &Path,
    file: &ReposConfFile,
) -> Result<(), String>
Expand description

What: Serialize a resolved repos.conf document to disk (overwrites the file).

Inputs:

  • path: Destination path (typically resolve_repos_config_path()).
  • file: Parsed and validated rows to write.

Output:

  • Ok(()) or a user-visible error string.

Details:

  • Uses toml::to_string; formatting and comments from the prior file are not preserved.

ยงErrors

  • Returns an error when TOML serialization fails or the file cannot be written.