Macro dbg_

Source
macro_rules! dbg_ {
    ($val:expr, $b:block) => { ... };
}
Expand description

Prints the procedural change difference and returns the final expression in the procedural block.

This macro works with a Debug implementation of the given expression type.

An example:

use diff_ba_rs::prelude::*;

let mut a = 2;
let b =  diff_ba::dbg!(&a, {
    a *= 2;
    a + 1
});
// prints:
// ```
// - 2
// + 4
// ```
assert_eq!(b, 5);