chore: replace regex with regex-lite, where appropriate (#1200)

As explained on https://crates.io/crates/regex-lite, `regex-lite` is a
lighter alternative to `regex` and seems to be sufficient for our
purposes.
This commit is contained in:
Michael Bolin
2025-06-02 17:11:45 -07:00
committed by GitHub
parent 0f3cc8f842
commit 5a5aa89914
8 changed files with 19 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
use multimap::MultiMap;
use regex::Error as RegexError;
use regex::Regex;
use regex_lite::Error as RegexError;
use regex_lite::Regex;
use crate::ExecCall;
use crate::Forbidden;
@@ -29,7 +29,7 @@ impl Policy {
} else {
let escaped_substrings = forbidden_substrings
.iter()
.map(|s| regex::escape(s))
.map(|s| regex_lite::escape(s))
.collect::<Vec<_>>()
.join("|");
Some(Regex::new(&format!("({escaped_substrings})"))?)