History

fix: Return `ExactSizeIterator` where applicable.

That way, the caller can obtain the amount of patterns more easily.

Sebastian Thiel committed 2 years ago

Commit ea2e5bb1 parent f520a511 file · +1 −1Browse files

Unified · Split

gix-pathspec/src/search/mod.rs+1−1
@@ -39,7 +39,7 @@ impl Match<'_> { · 38 unmodified lines
39/// Access39/// Access
40impl Search {40impl 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