melib: restore stringified variable print

embed
Manos Pitsidianakis 2019-07-15 00:04:20 +03:00
parent f13da6a26a
commit 85a70d656b
Signed by: Manos Pitsidianakis
GPG Key ID: 73627C2F690DF710
1 changed files with 2 additions and 1 deletions

View File

@ -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
}
}