diff --git a/src/lib.rs b/src/lib.rs index 49fed1c..d002561 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -28,7 +28,7 @@ fn find_repos( let mut warnings = Vec::new(); let exlusion_regex: regex::Regex = regex::Regex::new(&exclusion_pattern.unwrap_or(r"^$")) - .unwrap_or_else(|_| regex::Regex::new(r"^$").unwrap()); + .map_err(|e| format!("invalid regex: {e}"))?; for path in tree::find_repo_paths(root)? { if exclusion_pattern.is_some() && exlusion_regex.is_match(&path::path_as_string(&path)) { warnings.push(format!("[skipped] {}", &path::path_as_string(&path)));