pub fn save_inferred<P, T>(path: P, config: T) -> Result<()>Expand description
Save the current config by inferring the format from the file extension.
.toml writes TOML. .json and .jsonc write standard JSON.
use cloudiful_config::save_inferred;
use serde::Serialize;
#[derive(Serialize)]
struct AppConfig {
debug: bool,
}
let path = std::env::temp_dir().join("config-crate-save-inferred.jsonc");
save_inferred(&path, AppConfig { debug: true }).unwrap();