Rollup merge of #45101 - lfairy:proc-macro-string-escape, r=jseyfried
Make the result of `Literal::string()` more readable Closes #45076
This commit is contained in:
commit
bedce1e0a6
@ -488,7 +488,7 @@ impl Literal {
|
||||
pub fn string(string: &str) -> Literal {
|
||||
let mut escaped = String::new();
|
||||
for ch in string.chars() {
|
||||
escaped.extend(ch.escape_unicode());
|
||||
escaped.extend(ch.escape_debug());
|
||||
}
|
||||
Literal(token::Literal(token::Lit::Str_(Symbol::intern(&escaped)), None))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user