truncate in save_to_file
This commit is contained in:
parent
4161dd8df8
commit
8e93a4224b
@ -63,6 +63,7 @@ pub fn save_to_file(idfile: &str, content: &str) -> Result<()> {
|
|||||||
OpenOptions::new()
|
OpenOptions::new()
|
||||||
.create(true)
|
.create(true)
|
||||||
.write(true)
|
.write(true)
|
||||||
|
.truncate(true)
|
||||||
.open(filepath)?
|
.open(filepath)?
|
||||||
.write_all(content.as_bytes())?;
|
.write_all(content.as_bytes())?;
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user