Skip to content

Commit 836bcf2

Browse files
committed
Nits
1 parent dc10070 commit 836bcf2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ impl State {
163163
pub async fn async_save(&self, path: impl AsRef<Path>) -> Result<(), Error> {
164164
let path_tmp = path.as_ref().with_extension("tmp");
165165
let mut fpb = tokio::fs::OpenOptions::new();
166-
let fpb = fpb.create(true).write(true);
166+
let fpb = fpb.create(true).write(true).truncate(true);
167167
let mut fp = fpb.open(&path_tmp).await?;
168168
let state_str = toml::to_string(&self)?;
169169
fp.write_all(state_str.as_bytes()).await?;

0 commit comments

Comments
 (0)