pub fn store(config: &Config, path: impl AsRef<Path>) -> Result<(), error::Error> {
    let mut file = if path.as_ref().exists() {
        fs::OpenOptions::new().write(true).truncate(true).open(path)
    } else {
        File::create(path)
    }
    .map_err(|e| error::Kind::Config.context(e))?;

    store_writer(config, &mut file)
}
/// Serialize the given `Config` as TOML to the given config file.
Serialize the given `Config` as TOML to the given config file.
Serialize the given ` Config ` as TOML to the given config file .
pub fn store(config: &Config, path: impl AsRef<Path>) -> Result<(), error::Error> {
    let mut file = if path.as_ref().exists() {
        fs::OpenOptions::new().write(true).truncate(true).open(path)
    } else {
        File::create(path)
    }
    .map_err(|e| error::Kind::Config.context(e))?;
    store_writer(config, &mut file)
}
pub fn store ( config : & Config , path : impl AsRef < Path > ) -> Result < ( ) , error :: Error > { let mut file = if path . as_ref ( ) . exists ( ) { fs :: OpenOptions :: new ( ) . write ( true ) . truncate ( true ) . open ( path ) } else { File :: create ( path ) } . map_err ( | e | error :: Kind :: Config . context ( e ) ) ? ; store_writer ( config , & mut file ) }
Serialize the given `Config` as TOML to the given config file.
Serialize the given ` Config ` as TOML to the given config file .
config
&Config
path
impl AsRef<Path>
config
&Config
path
impl AsRef<Path>