clap/clap_complete/src/macros.rs

22 lines
442 B
Rust
Raw Normal View History

2020-02-05 10:04:59 +00:00
macro_rules! w {
($buf:expr, $to_w:expr) => {
match $buf.write_all($to_w) {
Ok(..) => (),
Err(..) => panic!("Failed to write to generated file"),
}
};
}
#[cfg(feature = "debug")]
2020-04-22 18:14:47 +00:00
macro_rules! debug {
($($arg:tt)*) => {
print!("[{:>w$}] \t", module_path!(), w = 28);
println!($($arg)*)
2020-02-05 10:04:59 +00:00
}
}
#[cfg(not(feature = "debug"))]
2020-04-22 18:14:47 +00:00
macro_rules! debug {
($($arg:tt)*) => {};
2020-02-05 10:04:59 +00:00
}