Make the result of Literal::string() more readable

Closes #45076
This commit is contained in:
Chris Wong 2017-10-08 21:42:33 +13:00
parent ac76206be4
commit f108fce21c

View File

@ -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))
}