pub fn write_atomic<P: AsRef<Path>, C: AsRef<[u8]>>( path: P, contents: C, ) -> Result<()>
Writes a file to disk atomically.
write_atomic uses tempfile::persist to accomplish atomic writes.