Skip to main content

replace

Function replace 

Source
pub fn replace(
    path: &Path,
    write: impl FnOnce(&mut BufWriter<File>) -> Result<()>,
) -> bool
Expand description

Replace path with whatever write emits, creating the directory above it if needed. Reports whether the file was replaced; a failure anywhere leaves the existing file untouched and no temp behind.