Expand description
A DebugValue<T>
is a T
that is only present if debug assertions are enabled.
On debug builds it has the exact same layout as T
.
On release builds it is a zero-sized-type.
let mut x = String::from("Mutated but restored by f");
let passed_in = DebugValue::new_cloned(&x);
f(&mut x);
passed_in.assert_eq(&x);