summaryrefslogtreecommitdiffstats
path: root/vendor/regex/src/re_trait.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--vendor/regex/src/re_trait.rs13
1 files changed, 12 insertions, 1 deletions
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<usize>) {
+ 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