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

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

Provided Methods§


fn as_clean(&self) -> CleanDebug<'_, Self>where Self: Display,

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""#)



impl<T> AsCleanDebug for Twhere T: Display,