]> git.lizzy.rs Git - rust.git/commitdiff
Remove `unescape_byte_literal`.
authorNicholas Nethercote <n.nethercote@gmail.com>
Fri, 4 Nov 2022 00:09:23 +0000 (11:09 +1100)
committerNicholas Nethercote <n.nethercote@gmail.com>
Sat, 5 Nov 2022 02:56:36 +0000 (13:56 +1100)
It's easy to just use `unescape_literal` + `byte_from_char`.

crates/syntax/src/validation.rs

index b9f2b5132353c9c2d30ae16b22cc4b1c98db324f..1eea2346451dd42038a9edcb5bdfe3cd368bb20c 100644 (file)
@@ -5,9 +5,7 @@
 mod block;
 
 use rowan::Direction;
-use rustc_lexer::unescape::{
-    self, unescape_byte, unescape_byte_literal, unescape_char, unescape_literal, Mode,
-};
+use rustc_lexer::unescape::{self, unescape_byte, unescape_char, unescape_literal, Mode};
 
 use crate::{
     algo,
@@ -143,7 +141,7 @@ fn unquote(text: &str, prefix_len: usize, end_delimiter: char) -> Option<&str> {
         ast::LiteralKind::ByteString(s) => {
             if !s.is_raw() {
                 if let Some(without_quotes) = unquote(text, 2, '"') {
-                    unescape_byte_literal(without_quotes, Mode::ByteStr, &mut |range, char| {
+                    unescape_literal(without_quotes, Mode::ByteStr, &mut |range, char| {
                         if let Err(err) = char {
                             push_err(2, (range.start, err));
                         }