diff --git a/src/lib.rs b/src/lib.rs index 48f789d..c1398e2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -594,11 +594,12 @@ impl Pattern { }); }; - let tokens_len = tokens.len(); - if is_valid { // collapse consecutive AnyRecursiveSequence to a // single one + + let tokens_len = tokens.len(); + if !(tokens_len > 1 && tokens[tokens_len - 1] == AnyRecursiveSequence) { is_recursive = true; tokens.push(AnyRecursiveSequence); @@ -967,7 +968,7 @@ fn chars_eq(a: char, b: char, case_sensitive: bool) -> bool { /// Configuration options to modify the behaviour of `Pattern::matches_with(..)`. #[allow(missing_copy_implementations)] -#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] +#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Default)] pub struct MatchOptions { /// Whether or not patterns should be matched in a case-sensitive manner. /// This currently only considers upper/lower case relationships between