Simple glob pattern matching (supports `*` and `?`).
(pattern: &str, value: &str)
| 403 | |
| 404 | /// Simple glob pattern matching (supports `*` and `?`). |
| 405 | fn matches_pattern(pattern: &str, value: &str) -> bool { |
| 406 | let pattern_chars: Vec<char> = pattern.chars().collect(); |
| 407 | let value_chars: Vec<char> = value.chars().collect(); |
| 408 | matches_pattern_recursive(&pattern_chars, &value_chars) |
| 409 | } |
| 410 | |
| 411 | fn matches_pattern_recursive(pattern: &[char], value: &[char]) -> bool { |
| 412 | match (pattern.first(), value.first()) { |
no test coverage detected