macro_rules! writables { [$($args:tt),+] => { ... }; (@do Newline) => { ... }; (@do $arg:expr) => { ... }; }
Expand description
A macro for creating an array of Writable
s without needing to pepper your code with into()
s.
§Usage
use crate::fif::writables;
use crate::fif::formats::{Writable, smart_write};
let mut f = std::io::stdout();
// Instead of...
smart_write(&mut f, &["hello".into(), Writable::Newline]);
// ...just use:
smart_write(&mut f, writables!["hello", Newline]);