1 macro_rules! w { 2 ($buf:expr, $to_w:expr) => { 3 match $buf.write_all($to_w) { 4 Ok(..) => (), 5 Err(..) => panic!("Failed to write to generated file"), 6 } 7 }; 8 } 9 10 #[cfg(feature = "debug")] 11 macro_rules! debug { 12 ($($arg:tt)*) => { 13 eprint!("[{:>w$}] \t", module_path!(), w = 28); 14 eprintln!($($arg)*) 15 } 16 } 17 18 #[cfg(not(feature = "debug"))] 19 macro_rules! debug { 20 ($($arg:tt)*) => {}; 21 } 22