} } } const PATTERNS: &[(Representation, &str)] = &[ Representation::Address.pattern(), Representation::Decimal.pattern(), Representation::Degree.pattern(), Representation::Hash.pattern(), Representation::InscriptionId.pattern(), Representation::Integer.pattern(), Representation::Name.pattern(), Representation::OutPoint.pattern(), Representation::Percentile.pattern(), Representation::SatPoint.pattern(), ]; lazy_static! { static ref REGEX_SET: RegexSet = RegexSet::new(PATTERNS.iter().map(|(_representation, pattern)| pattern),).unwrap(); } #[cfg(test)] mod tests { use super::*; #[test] fn all_patterns_are_anchored() { assert!(PATTERNS .iter() .all(|(_representation, pattern)| pattern.starts_with('^') && pattern.ends_with('$'))); } }