write-to-file
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. 🤗
Tests as Examples: tests/
function version usage:
use write_to_file;
// write binary
let buf = vec!;
let path = "target/test/file.bin";
write_to_file.unwrap; // <- Easy to write!
// write text
let buf = "Nyanko is one of the greatest life.".to_string;
let path = "target/test/file.txt";
write_to_file.unwrap; // <- Easy to write!
trait version usage:
use WriteToFile;
// Vec<u8>
let buf: = vec!;
let path = "target/test/file.bin";
buf.write_to_file.unwrap; // <- Easy to write!
// &[u8]
let buf: & = buf.as_slice;
let path = "target/test/file.bin";
buf.write_to_file.unwrap; // <- Easy to write!
// String
let buf: String = "Nyanko is one of the greatest life.".to_string;
let path = "target/test/file.txt";
buf.write_to_file.unwrap; // <- Easy to write!
// &str
let buf: &str = buf.as_str;
let path = "target/test/file.txt";
buf.write_to_file.unwrap; // <- Easy to write!
LICENSE
Author
- USAGI.NETWORK / Usagi Ito https://github.com/usagi/