changeset 52183:82007b8c189e

rust-vfs: delete the temp file and not the target on drop Oops. This never affected anything since `close()` is correct and no code has dropped an `AtomicFile` without a close first yet. Next patch will add tests.
author Raphaël Gomès <rgomes@octobus.net>
date Tue, 08 Oct 2024 16:09:39 +0200
parents bd8081e9fd62
children 735bf027dd1d
files rust/hg-core/src/vfs.rs
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/vfs.rs	Thu Sep 26 14:26:24 2024 +0200
+++ b/rust/hg-core/src/vfs.rs	Tue Oct 08 16:09:39 2024 +0200
@@ -280,7 +280,7 @@
 impl Drop for AtomicFile {
     fn drop(&mut self) {
         if self.is_open {
-            std::fs::remove_file(self.target()).ok();
+            std::fs::remove_file(&self.temp_path).ok();
         }
     }
 }