(s: &[u8])
| 124 | /* f-string prefix: f, F, fr, Fr, fR, FR, rf, rF, Rf, RF. */ |
| 125 | #[inline] |
| 126 | pub fn is_fstring_prefix(s: &[u8]) -> bool { |
| 127 | match s.len() { |
| 128 | 1 => matches!(s[0], b'f' | b'F'), |
| 129 | 2 => matches!( |
| 130 | (s[0], s[1]), |
| 131 | (b'f' | b'F', b'r' | b'R') | (b'r' | b'R', b'f' | b'F') |
| 132 | ), |
| 133 | _ => false, |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | /* Regular string prefix: r, R, u, U. The b/B variants live in `is_bytes_prefix` to emit a distinct `Bytes` token. */ |
| 138 | #[inline] |