That way, the caller can obtain the amount of patterns more easily.
Unified · Split
| @@ -39,7 +39,7 @@ impl Match<'_> { · 38 unmodified lines | |||
| 39 | /// Access | 39 | /// Access |
| 40 | impl Search { | 40 | impl Search { |
| 41 | /// Return an iterator over the patterns that participate in the search. | 41 | /// Return an iterator over the patterns that participate in the search. |
| 42 | pub fn patterns(&self) -> impl Iterator<Item = &Pattern> + '_ { | 42 | pub fn patterns(&self) -> impl ExactSizeIterator<Item = &Pattern> + '_ { |
| 43 | self.patterns.iter().map(|m| &m.value.pattern) | 43 | self.patterns.iter().map(|m| &m.value.pattern) |
| 44 | } | 44 | } |
| 45 | 45 | ||