diff --git a/src/pattern.rs b/src/pattern.rs index 816b0a3..e615622 100644 --- a/src/pattern.rs +++ b/src/pattern.rs @@ -89,9 +89,13 @@ impl MultiPattern { // TODO: wheight columns? let mut score = 0; for ((pattern, _), haystack) in self.cols.iter().zip(haystack) { - score += pattern.score(haystack.slice(..), matcher)? + score += pattern.score(haystack.slice(..), matcher).unwrap_or(0); + } + if score > 0 { + Some(score) + } else { + None } - Some(score) } pub fn is_empty(&self) -> bool {