Repository: cristianoliveira/funzzy (language: rust)

Issue:
feat: better error message for invalid glob pattern
See https://github.com/cristianoliveira/funzzy/blob/83528b7f073fe0f7af109fad2fe0918067477fc3/src/rules.rs#L192


Discussion / hints:

Fix patch:
diff --git a/src/rules.rs b/src/rules.rs
index f2ed318..ee547e6 100644
--- a/src/rules.rs
+++ b/src/rules.rs
@@ -194,7 +194,8 @@ pub fn from_file(filename: &str) -> Result<Vec<Rules>, String> {
 }
 
 fn pattern(pattern: &str) -> Pattern {
-    Pattern::new(&format!("**/{}", pattern)).expect("Pattern error.")
+    Pattern::new(&format!("**/{}", pattern))
+        .expect(format!("Invalid glob pattern {}", pattern).as_str())
 }
 
 #[cfg(test)]


Test patch: