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
3939 /// Access
4040 impl Search {
4141 /// 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> + '_ {
4343 self.patterns.iter().map(|m| &m.value.pattern)
4444 }
4545