refactor: 继续调整优化部分代码,移除主体代码的所有 unwrap

This commit is contained in:
amtoaer
2025-01-21 17:17:14 +08:00
parent cdc30e1b32
commit 0f25923c52
14 changed files with 101 additions and 67 deletions

View File

@@ -1,7 +1,7 @@
macro_rules! regex {
($re:literal $(,)?) => {{
static RE: once_cell::sync::OnceCell<regex::Regex> = once_cell::sync::OnceCell::new();
RE.get_or_init(|| regex::Regex::new($re).unwrap())
RE.get_or_init(|| regex::Regex::new($re).expect("invalid regex"))
}};
}