Simple glob-style pattern matching for SCAN MATCH. Supports `*` (match any sequence) and `?` (match single byte). `None` pattern matches everything.
(key: &[u8], pattern: Option<&str>)
| 105 | /// Supports `*` (match any sequence) and `?` (match single byte). |
| 106 | /// `None` pattern matches everything. |
| 107 | fn matches_pattern(key: &[u8], pattern: Option<&str>) -> bool { |
| 108 | let Some(pattern) = pattern else { |
| 109 | return true; |
| 110 | }; |
| 111 | glob_match(pattern.as_bytes(), key) |
| 112 | } |
| 113 | |
| 114 | /// Glob matching: `*` matches zero or more bytes, `?` matches exactly one byte. |
| 115 | pub(crate) fn glob_match(pattern: &[u8], input: &[u8]) -> bool { |
no test coverage detected