MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / matches_pattern

Function matches_pattern

atomic-identity/src/delegation.rs:405–409  ·  view source on GitHub ↗

Simple glob pattern matching (supports `*` and `?`).

(pattern: &str, value: &str)

Source from the content-addressed store, hash-verified

403
404/// Simple glob pattern matching (supports `*` and `?`).
405fn 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
411fn matches_pattern_recursive(pattern: &[char], value: &[char]) -> bool {
412 match (pattern.first(), value.first()) {

Callers 1

matches_anyFunction · 0.85

Calls 2

collectMethod · 0.45

Tested by

no test coverage detected