aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2023-12-13 18:04:04 +0100
committerQuentin Dufour <quentin@deuxfleurs.fr>2023-12-13 18:04:04 +0100
commit29561dde41b402362f8baa3d9cd87a07f743b9fd (patch)
tree3d2698eb2c3547d923bf6468e65614eb7fc73dcf /src/config.rs
parent064a1077c8c66fe8d3ee71f831c930e1ddfbc34a (diff)
downloadaerogramme-29561dde41b402362f8baa3d9cd87a07f743b9fd.tar.gz
aerogramme-29561dde41b402362f8baa3d9cd87a07f743b9fd.zip
CLI tools
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index eae50f5..e50cd68 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -155,6 +155,8 @@ pub fn read_config<T: serde::de::DeserializeOwned>(config_file: PathBuf) -> Resu
pub fn write_config<T: Serialize>(config_file: PathBuf, config: &T) -> Result<()> {
let mut file = std::fs::OpenOptions::new()
.write(true)
+ .create(true)
+ .truncate(true)
.open(config_file.as_path())?;
file.write_all(toml::to_string(config)?.as_bytes())?;