Skip to content

Commit

Permalink
Restore compatibility with rust 1.31
Browse files Browse the repository at this point in the history
    error: cannot find macro `matches!` in this scope
        --> src/lit.rs:1121:32
         |
    1121 |                             if matches!(b, b' ' | b'\t' | b'\n' | b'\r') {
         |                                ^^^^^^^
  • Loading branch information
dtolnay committed Feb 24, 2023
1 parent 01f69e9 commit c182545
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1118,10 +1118,9 @@ mod value {
b'"' => '"',
b'\r' | b'\n' => loop {
let b = byte(s, 0);
if matches!(b, b' ' | b'\t' | b'\n' | b'\r') {
s = &s[1..];
} else {
continue 'outer;
match b {
b' ' | b'\t' | b'\n' | b'\r' => s = &s[1..],
_ => continue 'outer,
}
},
b => panic!("unexpected byte {:?} after \\ character in byte literal", b),
Expand Down

0 comments on commit c182545

Please sign in to comment.