pub fn write_to_file<P: AsRef<Path>>(path: P, content: &str) -> Result<()> {
    std::fs::write(&path, content.as_bytes()).with_context(|| format!("Failed to write to file {:?}", path.as_ref()))?;

    Ok(())
}
/// Write string to file
///
/// _Note:_ Replaces the current file content if the file already exists.
Write string to file
_Note:_ Replaces the current file content if the file already exists.
Write string to file _Note : _ Replaces the current file content if the file already exists .
pub fn write_to_file<P: AsRef<Path>>(path: P, content: &str) -> Result<()> {
    std::fs::write(&path, content.as_bytes()).with_context(|| format!("Failed to write to file {:?}", path.as_ref()))?;
    Ok(())
}
pub fn write_to_file < P : AsRef < Path > > ( path : P , content : & str ) -> Result < ( ) > { std :: fs :: write ( & path , content . as_bytes ( ) ) . with_context ( | | format ! ( " " path as_ref ( ) ) ) ? ; Ok ( ( ) ) }
Write string to file
_Note:_ Replaces the current file content if the file already exists.
Write string to file _Note : _ Replaces the current file content if the file already exists .
path
P
content
&str
path
P
content
&str