macro_rules! dbg {
() => { ... };
($val:expr $(,)?) => { ... };
($($val:expr),+ $(,)?) => { ... };
}Expand description
A version of std::dbg! that works regardless
of whether or not T implements Debug
This requires the standard library to be present.
This macro is also aliased as dbg!,
so you may use a fully qualified maybe_debug::dbg!() if you so chose.
See also maybe_debug function.
ยงExample
use maybe_debug::maybe_dbg;
let a = vec![5, 4, 8];
assert_eq!(maybe_dbg!(a), vec![5, 4, 8]);
let a = vec![2, 4, 7];
// NOTE: Absolute path is useful for the 'dbg!' variant (and often clearer)
let (a, b, c) = maybe_debug::dbg!(a, format!("foooz"), 5u32);
let (a, b, _c): (Vec<i32>, String, u32) = maybe_debug::dbg!(a, b, c);
drop(a);
drop(b);