diff --git a/itlib/chain.go b/itlib/chain.go index 3160a99..ae1842a 100644 --- a/itlib/chain.go +++ b/itlib/chain.go @@ -31,6 +31,7 @@ type ChainIterator[T any] struct { // Ensure ChainIterator conforms to the Iterator protocol. var _ itkit.Iterator[struct{}] = &ChainIterator[struct{}]{} +// Next implements the [itkit.Iterator.Next] interface. func (c *ChainIterator[T]) Next() bool { if c.current != nil && c.current.Next() { return true @@ -44,6 +45,7 @@ func (c *ChainIterator[T]) Next() bool { return false } +// Value implements the [itkit.Iterator.Value] interface. func (c *ChainIterator[T]) Value() T { return c.current.Value() } diff --git a/itlib/filter.go b/itlib/filter.go index 8e11446..57f4608 100644 --- a/itlib/filter.go +++ b/itlib/filter.go @@ -26,6 +26,7 @@ type FilterIter[T any] struct { cur T } +// Next implements the [itkit.Iterator.Next] interface. func (f *FilterIter[T]) Next() bool { var next T for f.it.Next() { @@ -37,6 +38,7 @@ func (f *FilterIter[T]) Next() bool { return false } +// Value implements the [itkit.Iterator.Value] interface. func (f *FilterIter[T]) Value() T { return f.cur } // Filter returns an Iterator yielding items from the given iterator