pub fn write_if_changed<P: AsRef<Path>, C: AsRef<[u8]>>( path: P, contents: C, ) -> Result<()>
Equivalent to write(), but does not write anything if the file contents are identical to the given contents.
write()