Add u8::escape_default
and [u8]::escape_default
#80743
Labels
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
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 bytesI propose that we add associated functions to
u8
and[u8]
that are like{char,str}::escape_default
but for ASCII. Thestd::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 onStack Overflow when I found it in the
std
docs and posted an answer tohelp others who also don't realize the existence of
std::ascii::escape_default
.The text was updated successfully, but these errors were encountered: