We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc10070 commit 836bcf2Copy full SHA for 836bcf2
1 file changed
src/config.rs
@@ -163,7 +163,7 @@ impl State {
163
pub async fn async_save(&self, path: impl AsRef<Path>) -> Result<(), Error> {
164
let path_tmp = path.as_ref().with_extension("tmp");
165
let mut fpb = tokio::fs::OpenOptions::new();
166
- let fpb = fpb.create(true).write(true);
+ let fpb = fpb.create(true).write(true).truncate(true);
167
let mut fp = fpb.open(&path_tmp).await?;
168
let state_str = toml::to_string(&self)?;
169
fp.write_all(state_str.as_bytes()).await?;
0 commit comments