From 85a70d656b6bd7377bfed9785724ff4ef2fc1cac Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Mon, 15 Jul 2019 00:04:20 +0300 Subject: [PATCH] melib: restore stringified variable print --- melib/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/melib/src/lib.rs b/melib/src/lib.rs index 97b142dc8..ce5424b1b 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 } }