Skip to content

Commit 757b8ba

Browse files
authored
use copy/remove vs fs rename (#76)
1 parent 556b545 commit 757b8ba

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cli/src/source.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ pub(crate) fn save_source_info(path: &Path, source: &Source) -> Result<()> {
5454

5555
writer.finish()?;
5656
// Replace the original file with the patched one.
57-
fs::rename(out_path, path)?;
57+
fs::copy(&out_path, path)?;
58+
fs::remove_file(&out_path)?;
5859
Ok(())
5960
}
6061

0 commit comments

Comments
 (0)