pub fn write<P: AsRef<Path>, C: AsRef<[u8]>>(path: P, contents: C) -> Result<()>
Writes a file to disk.
Equivalent to std::fs::write with better error messages. This will also create the parent directory if it doesn’t exist.
std::fs::write