Move debug macros to macros.rs
This commit is contained in:
parent
f6cd24eccc
commit
9542279f9d
|
@ -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)*);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
16
src/term.rs
16
src/term.rs
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue