diff options
Diffstat (limited to 'vendor/regex/src/re_set.rs')
-rw-r--r-- | vendor/regex/src/re_set.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/vendor/regex/src/re_set.rs b/vendor/regex/src/re_set.rs index a6d886d76..7c8253f0c 100644 --- a/vendor/regex/src/re_set.rs +++ b/vendor/regex/src/re_set.rs @@ -289,6 +289,12 @@ impl RegexSet { } } +impl Default for RegexSet { + fn default() -> Self { + RegexSet::empty() + } +} + /// A set of matches returned by a regex set. #[derive(Clone, Debug)] pub struct SetMatches { @@ -315,6 +321,11 @@ impl SetMatches { } /// The total number of regexes in the set that created these matches. + /// + /// **WARNING:** This always returns the same value as [`RegexSet::len`]. + /// In particular, it does *not* return the number of elements yielded by + /// [`SetMatches::iter`]. The only way to determine the total number of + /// matched regexes is to iterate over them. pub fn len(&self) -> usize { self.matches.len() } |