Created
April 20, 2016 18:36
-
-
Save nixpulvis/9076d7ad11273c937f1dce2e76595726 to your computer and use it in GitHub Desktop.
debug! an expression and it's syntax.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[macro_export] | |
macro_rules! debug_expr { | |
($expr:expr) => {{ | |
let value = $expr; | |
debug!("`{}` = {:?}", stringify!($expr), value); | |
value | |
}}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment