Skip to content

Commit e425731

Browse files
committed
Update ParseError display logic for bytes to match AsciiSet
1 parent b43bf3f commit e425731

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

crates/utils/src/parser/error.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,9 @@ impl Display for ParseError {
6262
match *self {
6363
ParseError::Expected(x) => write!(f, "expected {x}"),
6464
ParseError::ExpectedLiteral(x) => write!(f, "expected {x:?}"),
65-
ParseError::ExpectedByte(x) => write!(f, "expected {:?}", x.escape_ascii().to_string()),
65+
ParseError::ExpectedByte(x) => write!(f, "expected {:?}", x as char),
6666
ParseError::ExpectedByteRange(min, max) => {
67-
write!(
68-
f,
69-
"expected {:?}-{:?}",
70-
min.escape_ascii().to_string(),
71-
max.escape_ascii().to_string(),
72-
)
67+
write!(f, "expected {:?}-{:?}", min as char, max as char)
7368
}
7469
ParseError::ExpectedOneOf(set) => write!(f, "expected one of {set}"),
7570
ParseError::ExpectedEof() => write!(f, "expected end of input"),

0 commit comments

Comments
 (0)