From 94a0819fe3a0d679c3042a77bfe6a2afc505daea Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:11:28 +0200 Subject: Adding upstream version 1.66.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/regex/src/re_trait.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'vendor/regex/src/re_trait.rs') diff --git a/vendor/regex/src/re_trait.rs b/vendor/regex/src/re_trait.rs index 680aa5459..d0c717df5 100644 --- a/vendor/regex/src/re_trait.rs +++ b/vendor/regex/src/re_trait.rs @@ -74,8 +74,19 @@ impl<'c> Iterator for SubCapturesPosIter<'c> { self.idx += 1; x } + + fn size_hint(&self) -> (usize, Option) { + let len = self.locs.len() - self.idx; + (len, Some(len)) + } + + fn count(self) -> usize { + self.len() + } } +impl<'c> ExactSizeIterator for SubCapturesPosIter<'c> {} + impl<'c> FusedIterator for SubCapturesPosIter<'c> {} /// `RegularExpression` describes types that can implement regex searching. @@ -139,7 +150,7 @@ pub trait RegularExpression: Sized + fmt::Debug { /// Returns an iterator over all non-overlapping successive leftmost-first /// matches. fn find_iter(self, text: &Self::Text) -> Matches<'_, Self> { - Matches { re: self, text: text, last_end: 0, last_match: None } + Matches { re: self, text, last_end: 0, last_match: None } } /// Returns an iterator over all non-overlapping successive leftmost-first -- cgit v1.2.3