![github] ![crates-io] ![docs-rs]
Write to a file, simple helper fn and traits lib crate.
I'm tired to implements these very simple file writing feature, but I don't need more a rich features. So I publish the crate. Enjoy rust in relaxed. 🤗
```rust use writetofile::writetofile;
// write binary let buf = vec![1u8, 2, 3, 4]; let expected = buf.clone(); let path = "target/test/file.bin"; writetofile(path, buf).unwrap(); // <- Easy to write!
// write text let buf = "Nyanko is one of the greatest life.".tostring(); let expected = buf.clone(); let path = "target/test/file.txt"; writeto_file(path, buf).unwrap(); // <- Easy to write! ```
```rust use writetofile::WriteToFile;
// Vec
// &[u8] let buf: &[u8] = buf.asslice(); let path = "target/test/file.bin"; buf.writeto_file(path).unwrap(); // <- Easy to write!
// String let buf: String = "Nyanko is one of the greatest life.".tostring(); let path = "target/test/file.txt"; buf.writeto_file(path).unwrap(); // <- Easy to write!
// &str let buf: &str = buf.asstr(); let path = "target/test/file.txt"; buf.writeto_file(path).unwrap(); // <- Easy to write! ```