Preserve unicode escapes in format string literals when pretty-printing AST
This commit is contained in:
parent
98c1e3d95b
commit
587899e9ca
3 changed files with 33 additions and 2 deletions
|
@ -684,8 +684,8 @@ pub fn reconstruct_format_args_template_string(pieces: &[FormatArgsPiece]) -> St
|
|||
for piece in pieces {
|
||||
match piece {
|
||||
FormatArgsPiece::Literal(s) => {
|
||||
for c in s.as_str().escape_debug() {
|
||||
template.push(c);
|
||||
for c in s.as_str().chars() {
|
||||
template.extend(c.escape_debug());
|
||||
if let '{' | '}' = c {
|
||||
template.push(c);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue