pub fn replace_file(from: &Path, to: &Path) -> Result<()>Expand description
Replace to by renaming from to to.
Notes:
- On Unix,
renameoverwrites atomically whenfromandtoare on the same filesystem. - On Windows,
renamefails whentoexists. We fall back to remove + rename, which is not atomic but matches the expected overwrite behavior for temp-file workflows.