Skip to content

Commit

Permalink
Stricter parsing of string_continue escape in cooked byte string literal
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jun 24, 2023
1 parent 0828793 commit fef64da
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/lit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1273,8 +1273,7 @@ mod value {
b'"' => b'"',
b'\r' | b'\n' => loop {
let byte = byte(v, 0);
let ch = char::from_u32(u32::from(byte)).unwrap();
if ch.is_whitespace() {
if matches!(byte, b' ' | b'\t' | b'\n' | b'\r') {
v = &v[1..];
} else {
continue 'outer;
Expand Down

0 comments on commit fef64da

Please sign in to comment.