This commit is contained in:
parent
92351a02ec
commit
209de180e9
2 changed files with 5 additions and 2 deletions
|
|
@ -10,7 +10,7 @@ debug = "none"
|
||||||
debug-assertions = false
|
debug-assertions = false
|
||||||
strip = true
|
strip = true
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
lto = true
|
# lto = true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,11 +56,14 @@ impl Default for ErrorInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
static ERROR_CODE_REGEX: Lazy<Regex> =
|
static ERROR_CODE_REGEX: Lazy<Regex> =
|
||||||
Lazy::new(|| Regex::new("(?<=(^| ))\\d\\d\\d-\\d\\d\\d\\d(?=($| ))").expect("invalid regex"));
|
Lazy::new(|| Regex::new("\\b\\d\\d\\d-\\d\\d\\d\\d\\b").expect("invalid regex"));
|
||||||
|
static WORD_BOUNDARY_START: Lazy<Regex> = Lazy::new(|| Regex::new("^\\b").expect("invalid regex"));
|
||||||
|
static WORD_BOUNDARY_END: Lazy<Regex> = Lazy::new(|| Regex::new("\\b$").expect("invalid regex"));
|
||||||
|
|
||||||
pub struct ErrorCodeHandler;
|
pub struct ErrorCodeHandler;
|
||||||
|
|
||||||
fn create_error_explain_message(str_code: &str, expanded: bool) -> Option<EditMessage> {
|
fn create_error_explain_message(str_code: &str, expanded: bool) -> Option<EditMessage> {
|
||||||
|
let str_code = str_code.trim();
|
||||||
let Ok(category) = str_code[0..3].parse() else {
|
let Ok(category) = str_code[0..3].parse() else {
|
||||||
return None;
|
return None;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue