diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-07-15 00:04:20 +0300 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2019-07-15 00:12:08 +0300 |
commit | 85a70d656b6bd7377bfed9785724ff4ef2fc1cac (patch) | |
tree | b40d8b6e39c21cddc1905b80b71641fa899e0ce9 /melib/src/lib.rs | |
parent | f13da6a26a64f8cf29de161bb50dbf396696e094 (diff) |
melib: restore stringified variable print
Diffstat (limited to 'melib/src/lib.rs')
-rw-r--r-- | melib/src/lib.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/melib/src/lib.rs b/melib/src/lib.rs index 97b142dc..ce5424b1 100644 --- a/melib/src/lib.rs +++ b/melib/src/lib.rs @@ -43,6 +43,7 @@ pub mod dbg { }; ($val:expr) => { if cfg!(debug_assertions) { + let stringify = stringify!($val); // Use of `match` here is intentional because it affects the lifetimes // of temporaries - https://stackoverflow.com/a/48732525/1063961 match $val { @@ -57,7 +58,7 @@ pub mod dbg { line!(), column!() ); - eprintln!("{} = {:?}", stringify!(tmp), tmp); + eprintln!("{} = {:?}", stringify, tmp); tmp } } |