codspeed-divan-compat 4.2.1

Divan compatibility layer for CodSpeed
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use regex::Regex;

/// Filters which benchmark to run based on name.
pub(crate) enum Filter {
    Regex(Regex),
    Exact(String),
}

impl Filter {
    /// Returns `true` if a string matches this filter.
    pub fn is_match(&self, s: &str) -> bool {
        match self {
            Self::Regex(r) => r.is_match(s),
            Self::Exact(e) => e == s,
        }
    }
}