refactor: 继续调整优化部分代码,移除主体代码的所有 unwrap
This commit is contained in:
@@ -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"))
|
||||
}};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user