cargo_util::paths

Function write_if_changed

source
pub fn write_if_changed<P: AsRef<Path>, C: AsRef<[u8]>>(
    path: P,
    contents: C,
) -> Result<()>
Expand description

Equivalent to write(), but does not write anything if the file contents are identical to the given contents.