use ;
/// Write `buf` to `path`, with create required directories if not exists.
/// ```rust
/// // write binary
/// let buf = vec![1u8, 2, 3, 4]; // Both of Vec<u8> and &[u8] are supported.
/// let path = "target/test/path/to/file.bin";
/// write_to_file::write_to_file(path, buf);
/// // write text
/// let buf = "Nyanko is one of the greatest life."; // Both of String and str are supported.
/// let path = "target/test/path/to/file.txt";
/// write_to_file::write_to_file(path, buf);
/// ```