duplicate_code 0.8.1

A tool for parsing directories scanning all the files within to find duplicate segments of code across files.
use regex::Regex;

pub fn does_not_match_any(checking: &str, regexes: &[Regex]) -> bool {
    for regex in regexes {
        if regex.is_match(checking) {
            return false;
        }
    }

    true
}

pub fn get_regexes(regexes: Vec<String>) -> Vec<Regex> {
    regexes.iter().map(|regex| get_regex(regex)).collect()
}

fn get_regex(regex: &str) -> Regex {
    match Regex::new(regex) {
        Ok(regex) => regex,
        Err(error) => {
            error!("{:?}", error);
            std::process::exit(crate::ERROR_EXIT_CODE);
        }
    }
}