Skip to main content

utf8_or_hex

Function utf8_or_hex 

pub fn utf8_or_hex(bytes: &[u8]) -> impl Display
Expand description

Display valid UTF-8 as a quoted debug string, or other bytes as uppercase hexadecimal prefixed with 0x.

Formatting is deferred and does not allocate.