toml::to_file needs to be able to create the save file

master
Paul Woolcock 6 years ago
parent 1057e58343
commit f8f8054c5c
  1. 2
      src/helpers/toml.rs

@ -60,7 +60,7 @@ pub fn to_writer<W: Write>(data: &Data, writer: W) -> Result<()> {
/// fine-grained control
pub fn to_file<P: AsRef<Path>>(data: &Data, path: P) -> Result<()> {
let mut options = OpenOptions::new();
options.write(true).truncate(true);
options.create(true).write(true).truncate(true);
to_file_with_options(data, path, options)?;
Ok(())
}

Loading…
Cancel
Save