Move debug macros to macros.rs

This commit is contained in:
Joe Wilm 2016-07-29 18:16:41 -07:00
parent f6cd24eccc
commit 9542279f9d
2 changed files with 27 additions and 16 deletions

View File

@ -27,3 +27,30 @@ macro_rules! err_println {
(writeln!(&mut ::std::io::stderr(), $($arg)*)).expect("stderr");
}}
}
#[macro_export]
macro_rules! err_println {
($($arg:tt)*) => {{
use std::io::Write;
(writeln!(&mut ::std::io::stderr(), $($arg)*)).expect("stderr");
}}
}
#[macro_export]
macro_rules! debug_println {
($($t:tt)*) => {
if cfg!(debug_assertions) {
println!($($t)*);
}
}
}
#[macro_export]
macro_rules! debug_print {
($($t:tt)*) => {
if cfg!(debug_assertions) {
print!($($t)*);
}
}
}

View File

@ -24,22 +24,6 @@ use tty;
use ::Rgb;
macro_rules! debug_println {
($($t:tt)*) => {
if cfg!(debug_assertions) {
println!($($t)*);
}
}
}
macro_rules! debug_print {
($($t:tt)*) => {
if cfg!(debug_assertions) {
print!($($t)*);
}
}
}
/// RAII type which manages grid state for render
///
/// This manages the cursor during a render. The cursor location is inverted to