pub trait AsCleanDebug {
    fn as_clean(&self) -> CleanDebug<'_, Self>
        Self: Display
, { ... } }
Expand description

Trait to enable .as_clean to get a CleanDebug for the variable.

Provided Methods

Get a CleanDebug for Self.

let s = "a\tstring";
let clean_debug = s.as_clean();

// A debug formatting is the same as the value itself.
assert_eq!(format!("{:?}", clean_debug), s);

// The debug formatting of the `&str` is messy for clean output in debug implementations.
assert_eq!(format!("{:?}", s), r#""a\tstring""#)