Nth returns nth element of the Iterator.
(it Iterator[T], n uint)
| 450 | |
| 451 | // Nth returns nth element of the Iterator. |
| 452 | func Nth[T any](it Iterator[T], n uint) Option[T] { |
| 453 | v := it.Next() |
| 454 | for n > 0 { |
| 455 | if v.IsNone() { |
| 456 | break |
| 457 | } |
| 458 | v = it.Next() |
| 459 | n-- |
| 460 | } |
| 461 | return v |
| 462 | } |
| 463 | |
| 464 | // Determines if the elements of two Iterators are equal. |
| 465 | func Equal[T comparable](first Iterator[T], second Iterator[T]) bool { |