pub fn write_to<P>(file: Option<P>, content: String) -> WriteResultExpand description
Writes content to a file or to stdout.
If file is Some, then use it as a filename to write to. Otherwise, write
to the standard output.
If any error is found, return an Err.
ยงExamples
use kripher::utils::write_to;
// Write 'Content' to a file.
match write_to(Some("/tmp/output"), String::from("Content")) {
Ok(_) => println!("write successfull"),
Err(_) => println!("Oops!"),
}