Fix reopen error

This commit is contained in:
2022-06-10 04:00:21 +00:00
committed by GitHub
parent 4bed81248e
commit a5d582c67b

View File

@@ -300,7 +300,7 @@ impl PdFile {
}
remove_file(self.file_path.get_ref().as_ref().unwrap())?;
f.take();
f.replace(File::open(self.file_path.get_ref().as_ref().unwrap())?);
f.replace(File::create(self.file_path.get_ref().as_ref().unwrap())?);
Ok(())
}