Skip to content

Commit a65ca91

Browse files
authored
Rollup merge of rust-lang#103919 - nnethercote:unescaping-cleanups, r=matklad
Unescaping cleanups Some code improvements, and some error message improvements. Best reviewed one commit at a time. r? ````@matklad````
2 parents c60b1f6 + 7d2a1ee commit a65ca91

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

crates/syntax/src/validation.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
mod block;
66

77
use rowan::Direction;
8-
use rustc_lexer::unescape::{
9-
self, unescape_byte, unescape_byte_literal, unescape_char, unescape_literal, Mode,
10-
};
8+
use rustc_lexer::unescape::{self, unescape_byte, unescape_char, unescape_literal, Mode};
119

1210
use crate::{
1311
algo,
@@ -143,7 +141,7 @@ fn validate_literal(literal: ast::Literal, acc: &mut Vec<SyntaxError>) {
143141
ast::LiteralKind::ByteString(s) => {
144142
if !s.is_raw() {
145143
if let Some(without_quotes) = unquote(text, 2, '"') {
146-
unescape_byte_literal(without_quotes, Mode::ByteStr, &mut |range, char| {
144+
unescape_literal(without_quotes, Mode::ByteStr, &mut |range, char| {
147145
if let Err(err) = char {
148146
push_err(2, (range.start, err));
149147
}

0 commit comments

Comments
 (0)