pub fn write_atomic(file: &Path, text: &str) -> Result<()>
Writes text to file atomically: a temporary file in the same directory, then a rename over the old file.
text
file