ToSlice consumes an Iterator creating a slice from the yielded values.
(it Iterator[T])
| 79 | |
| 80 | // ToSlice consumes an Iterator creating a slice from the yielded values. |
| 81 | func ToSlice[T any](it Iterator[T]) []T { |
| 82 | result := []T{} |
| 83 | ForEach(it, func(v T) { |
| 84 | result = append(result, v) |
| 85 | }) |
| 86 | return result |
| 87 | } |
| 88 | |
| 89 | // ToString consumes a rune Iterator creating a string. |
| 90 | func ToString(it Iterator[rune]) string { |
searching dependent graphs…