fn scratch_path(path: &Path) -> PathBuf
Where path’s replacement is built: <name>.tmp in the same directory, so the rename that finishes it never crosses a filesystem.
path
<name>.tmp