Closed
Metadata
Metadata
Assignees
Labels
Blocker: Implemented in the nightly compiler and unstable.Category: An issue tracking the progress of sth. like the implementation of an RFCRelevant to the library API team, which will review and decide on the PR/issue.In the final comment period and will be merged soon unless new substantive objections are raised.
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
nikonthethird commentedon Nov 12, 2016
I hope this is the correct spot to mention that all examples of std::char::escape_debug use std::char::escape_default.
https://doc.rust-lang.org/std/primitive.char.html#method.escape_debug
Mark-Simulacrum commentedon May 16, 2017
The above has been fixed; the function is correctly documented. Nominating for libs team discussion as to stabilization, I don't think we're going to get much information out of usage since this is such a niche API. I'm personally not certain I like the name:
escape_debug
seems odd to me, it's not really anything related to debugging I think.cc @rust-lang/libs
tbu- commentedon May 16, 2017
debug
refers to the fact that it is used for theDebug
implementation ofString
and&str
.I would prefer to call these functions just
escape
(best would beescape_default
, but that one is taken). Could we maybe permanently deprecateescape_default
in favor of something likeescape_nonascii
to make it clear that escaping all non-ASCII code points has nothing to do with "default"?(I don't suggest ever removing
escape_default
, just deprecating it.)sfackler commentedon May 23, 2017
@rfcbot fcp merge
rfcbot commentedon May 23, 2017
Team member @sfackler has proposed to merge this. The next step is review by the rest of the tagged teams:
Concerns:
strresolved by Tracking issue for the functions for debug escapingchar_escape_debug
#35068 (comment)Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!
See this document for info about what commands tagged team members can give me.
BurntSushi commentedon May 27, 2017
Sorry, but I've lost context on this change and this issue doesn't appear to link to anything. What is the purpose of this new method? Is it just a rename?
tbu- commentedon May 27, 2017
The function escapes characters the way the
Debug
implementation forstr
andchar
does.dtolnay commentedon Jun 3, 2017
If we are doing this, I would also like to have a plan for #27791 which includes
<str>::escape_debug
. Looks like there were concerns about consistency between char's and str's escape_default in #27791 (comment).@rfcbot concern str
brson commentedon Jun 6, 2017
Please change this sentence in the docs: "This will escape the characters similar to the Debug implementations of str or char." I assume this is not just similar, it is the implementation of 'Debug'.
tbu- commentedon Jun 6, 2017
Currently. What if we wanted to change either of these but not the other?
escape_default
couldn't be changed because the documentation was too concrete.6 remaining items
tbu- commentedon Jun 23, 2017
See the original pull request: #34485.
dtolnay commentedon Jul 20, 2017
@rfcbot resolved str
char::escape_debug
is good to go. We will address the consistency question as part of #27791.rfcbot commentedon Jul 20, 2017
🔔 This is now entering its final comment period, as per the review above. 🔔
std: Stabilize `char_escape_debug`
leo60228 commentedon Apr 21, 2020
I'm not sure of a better place to put this. Is this function guaranteed so that
format!("\"{}\"", x.escape_debug())
returns valid Rust code that represents a value equal tox
?