ib_matcher/regex/util/
prefilter.rs1pub use regex_automata::util::prefilter::*;
2
3#[non_exhaustive]
4#[derive(Clone, Debug)]
5pub enum PrefilterIb {
6 #[cfg(feature = "perf-literal-substring")]
7 Byte2OrNonAscii(u8, u8),
8}
9
10#[cfg(feature = "perf-literal-substring")]
11impl PrefilterIb {
12 pub fn byte2_or_non_ascii(b: u8, case_insensitive: bool) -> Self {
13 let (a, b) = if case_insensitive {
14 if b.is_ascii_lowercase() {
16 (b, b.to_ascii_uppercase())
17 } else {
18 (b.to_ascii_lowercase(), b)
19 }
20 } else {
21 (b, b)
22 };
23 Self::Byte2OrNonAscii(a, b)
24 }
25}