mirror of
https://github.com/zkemail/zk-regex.git
synced 2026-01-09 13:48:00 -05:00
chore: error handling in extract_substrs
This commit is contained in:
@@ -53,7 +53,12 @@ pub fn extract_substr_idxes(
|
||||
input_str.to_string(),
|
||||
)
|
||||
})?
|
||||
.expect("Expected a match, but none was found");
|
||||
.ok_or_else(|| {
|
||||
ExtractSubstrssError::SubstringOfEntireNotFound(
|
||||
entire_regex.clone(),
|
||||
input_str.to_string(),
|
||||
)
|
||||
})?;
|
||||
|
||||
let mut public_idxes = vec![];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user