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§

source

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

Get a CleanDebug for Self.

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

Implementors§

source§

impl<T> AsCleanDebug for Twhere T: Display,