diff --git a/crates/atomic-file-install/src/lib.rs b/crates/atomic-file-install/src/lib.rs index 63ad812a..4f444262 100644 --- a/crates/atomic-file-install/src/lib.rs +++ b/crates/atomic-file-install/src/lib.rs @@ -33,6 +33,7 @@ fn copy_to_tempfile(src: &Path, dst: &Path) -> io::Result { src.display(), tempfile.path().display() ); + fs::remove_file(tempfile.path())?; // src and dst is likely to be on the same filesystem. // Uses reflink if the fs support it, or fallback to // `fs::copy` if it doesn't support it or it is not on the