diff options
| author | Dylan DPC <99973273+Dylan-DPC@users.noreply.github.com> | 2022-09-12 15:21:30 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-12 15:21:30 +0530 |
| commit | 93177758fccdaac08d606348f79b20e9cd9df022 (patch) | |
| tree | 2d40e1231d79e875258f1414f30b045d083f48c3 /compiler/rustc_ast/src/util/literal.rs | |
| parent | 413703201c59f25a5a2fded13d7ee4b4be4e8545 (diff) | |
| parent | a297631bdcc7742b55cf5961fcbc505e91217c7d (diff) | |
| download | rust-93177758fccdaac08d606348f79b20e9cd9df022.tar.gz rust-93177758fccdaac08d606348f79b20e9cd9df022.zip | |
Rollup merge of #100767 - kadiwa4:escape_ascii, r=jackh726
Remove manual <[u8]>::escape_ascii `@rustbot` label: +C-cleanup
Diffstat (limited to 'compiler/rustc_ast/src/util/literal.rs')
| -rw-r--r-- | compiler/rustc_ast/src/util/literal.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/compiler/rustc_ast/src/util/literal.rs b/compiler/rustc_ast/src/util/literal.rs index 6a1578498e6..536b385606c 100644 --- a/compiler/rustc_ast/src/util/literal.rs +++ b/compiler/rustc_ast/src/util/literal.rs @@ -163,12 +163,7 @@ impl LitKind { } LitKind::Str(symbol, ast::StrStyle::Raw(n)) => (token::StrRaw(n), symbol, None), LitKind::ByteStr(ref bytes) => { - let string = bytes - .iter() - .cloned() - .flat_map(ascii::escape_default) - .map(Into::<char>::into) - .collect::<String>(); + let string = bytes.escape_ascii().to_string(); (token::ByteStr, Symbol::intern(&string), None) } LitKind::Byte(byte) => { |
