Part of Santh - open source Rust security and infrastructure tooling.
Vocabulary types for multi-pattern matching. Match struct, Matcher trait, shared errors.
use matchkit::{Match, MatchSet};
let mut set = MatchSet::new();
set.insert(Match::new(0, 10, 18));
set.insert(Match::new(1, 15, 20));
set.merge_overlapping();
assert_eq!(set.len(), 1);
assert_eq!(set.as_slice()[0].end, 20);MIT