pub fn write(path: &Path, contents: impl AsRef<[u8]>) -> Result<()>
Write bytes to a file.
On error, the returned diagnostic includes the failing path.