Skip to content

Commit

Permalink
fix: iterable.From
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Shaw committed Dec 11, 2023
1 parent b133216 commit 55806bb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/iterable/iterable.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ func From[T any](slice []T) Iterator[T] {
i := 0
return NewIterator(func() (T, error) {
if i < len(slice) {
item := slice[i]
i++
return slice[i], nil
return item, nil
}
var undef T
return undef, io.EOF
Expand Down

0 comments on commit 55806bb

Please sign in to comment.