diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-05-12 17:37:07 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-06-10 19:40:48 +0300 |
commit | 1e7e99f499e3ff32b58264e40db9032f59d99bb4 (patch) | |
tree | 02566bb054e226e604a6288d4641a92da6a4f7a5 /melib/src/lib.rs | |
parent | f972f69bad54f29671a473d4f9a96e39fd7e4448 (diff) |
melib: return $val in debug!
Diffstat (limited to 'melib/src/lib.rs')
-rw-r--r-- | melib/src/lib.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/melib/src/lib.rs b/melib/src/lib.rs index 68bc0480..72e36b77 100644 --- a/melib/src/lib.rs +++ b/melib/src/lib.rs @@ -23,6 +23,7 @@ pub mod dbg { #[macro_export] macro_rules! debug { ($val:literal) => { + { if cfg!(debug_assertions) { eprint!( "[{:?}] {}:{}_{}: ", @@ -36,8 +37,11 @@ pub mod dbg { ); eprintln!($val); } + $val + } }; ($val:expr) => { + { if cfg!(debug_assertions) { eprint!( "[{:?}] {}:{}_{}: ", @@ -51,6 +55,8 @@ pub mod dbg { ); eprintln!("{} = {:?}", stringify!($val), $val); } + $val + } }; ($fmt:literal, $($arg:tt)*) => { if cfg!(debug_assertions) { |