pub fn save_via_temp_file<F, P, E>(
    path: P,
    temp_suffix: E,
    writer: F
) -> Result<(), Error>
where F: FnMut(Box<dyn Write>) -> Result<(), Error>, P: AsRef<Path>, E: AsRef<OsStr>,
Expand description

Creates temporary file with name created by adding temp_suffix to path. Applies writer function to it and renames temporary file into original specified by path.