mirror of
https://github.com/clap-rs/clap
synced 2025-01-08 10:48:45 +00:00
21 lines
442 B
Rust
21 lines
442 B
Rust
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")]
|
|
macro_rules! debug {
|
|
($($arg:tt)*) => {
|
|
print!("[{:>w$}] \t", module_path!(), w = 28);
|
|
println!($($arg)*)
|
|
}
|
|
}
|
|
|
|
#[cfg(not(feature = "debug"))]
|
|
macro_rules! debug {
|
|
($($arg:tt)*) => {};
|
|
}
|