INNER CODE UNIT · Rust
Ok
Drew-Alleman/DataSurgeon · src/main.rs:349
if let Ok(regex) = Regex::new(&plugin.regex) {
if !regex_map.contains_key(&plugin.content_type) {
regex_map.insert(plugin.content_type.clone(), regex);
}
}
}
let keys_to_keep: Vec<String> = regex_map.keys()
.filter(|&key| *self.matches.get_one::<bool>(key).unwrap_or(&false))
.cloned()
.collect();
// If no keys were passed as arguments, return the entire map
if keys_to_keep.is_empty() {
return regex_map;
}