Closed
Description
The standard library has several functions for printing escaped text:
char::escape_default
for printing escaped Unicode charactersstr::escape_default
for printing escaped Unicode stringsstd::ascii::escape_default
for printing escaped ASCII bytes
I propose that we add associated functions to u8
and [u8]
that are like
{char,str}::escape_default
but for ASCII. The std::ascii::escape_default
function is not very discoverable – I was expecting a u8::escape_default
function like for char
– and in fact I was about to post a question on
Stack Overflow when I found it in the std
docs and posted an answer to
help others who also don't realize the existence of std::ascii::escape_default
.