pub fn write_text(path: &Path, contents: &str) -> Result<()>
Replace a UTF-8 text file’s contents directly.
Returns a contextual error when the contents cannot be written.