This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct AnyAsyncSequence<Element>: AsyncSequence { | |
| struct AnyAsyncIterator: AsyncIteratorProtocol { | |
| private let _next: () async throws -> Element? | |
| init<Base: AsyncSequence>(_ base: Base) where Base.Element == Element { | |
| var baseIterator = base.makeAsyncIterator() | |
| self._next = { try await baseIterator.next() } | |
| } | |
| func next() async throws -> Element? { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct InterleavedSequence<First: Sequence, Second: Sequence>: Sequence where First.Element == Second.Element { | |
| let first: First | |
| let second: Second | |
| init(first: First, second: Second) { | |
| self.first = first | |
| self.second = second | |
| } | |
| func makeIterator() -> Iterator { |
NewerOlder