1919/// - Returns: An asynchronous sequence that iterates first over the elements of `s1`, and
2020/// then over the elements of `s2`, and then over the elements of `s3`
2121@inlinable
22- public func chain< Base1: AsyncSequence , Base2: AsyncSequence , Base3: AsyncSequence > ( _ s1: Base1 , _ s2: Base2 , _ s3: Base3 ) -> AsyncChain3Sequence < Base1 , Base2 , Base3 > {
22+ public func chain< Base1: AsyncSequence , Base2: AsyncSequence , Base3: AsyncSequence > (
23+ _ s1: Base1 ,
24+ _ s2: Base2 ,
25+ _ s3: Base3
26+ ) -> AsyncChain3Sequence < Base1 , Base2 , Base3 > {
2327 AsyncChain3Sequence ( s1, s2, s3)
2428}
2529
2630/// A concatenation of three asynchronous sequences with the same element type.
2731@frozen
28- public struct AsyncChain3Sequence < Base1: AsyncSequence , Base2: AsyncSequence , Base3: AsyncSequence > where Base1. Element == Base2 . Element , Base1. Element == Base3 . Element {
32+ public struct AsyncChain3Sequence < Base1: AsyncSequence , Base2: AsyncSequence , Base3: AsyncSequence >
33+ where Base1. Element == Base2 . Element , Base1. Element == Base3 . Element {
2934 @usableFromInline
3035 let base1 : Base1
31-
36+
3237 @usableFromInline
3338 let base2 : Base2
34-
39+
3540 @usableFromInline
3641 let base3 : Base3
37-
42+
3843 @usableFromInline
3944 init ( _ base1: Base1 , _ base2: Base2 , _ base3: Base3 ) {
4045 self . base1 = base1
@@ -45,26 +50,26 @@ public struct AsyncChain3Sequence<Base1: AsyncSequence, Base2: AsyncSequence, Ba
4550
4651extension AsyncChain3Sequence : AsyncSequence {
4752 public typealias Element = Base1 . Element
48-
53+
4954 /// The iterator for a `AsyncChain3Sequence` instance.
5055 @frozen
5156 public struct Iterator : AsyncIteratorProtocol {
5257 @usableFromInline
5358 var base1 : Base1 . AsyncIterator ?
54-
59+
5560 @usableFromInline
5661 var base2 : Base2 . AsyncIterator ?
57-
62+
5863 @usableFromInline
5964 var base3 : Base3 . AsyncIterator ?
60-
65+
6166 @usableFromInline
6267 init ( _ base1: Base1 . AsyncIterator , _ base2: Base2 . AsyncIterator , _ base3: Base3 . AsyncIterator ) {
6368 self . base1 = base1
6469 self . base2 = base2
6570 self . base3 = base3
6671 }
67-
72+
6873 @inlinable
6974 public mutating func next( ) async rethrows -> Element ? {
7075 do {
@@ -87,14 +92,14 @@ extension AsyncChain3Sequence: AsyncSequence {
8792 }
8893 }
8994 }
90-
95+
9196 @inlinable
9297 public func makeAsyncIterator( ) -> Iterator {
9398 Iterator ( base1. makeAsyncIterator ( ) , base2. makeAsyncIterator ( ) , base3. makeAsyncIterator ( ) )
9499 }
95100}
96101
97- extension AsyncChain3Sequence : Sendable where Base1: Sendable , Base2: Sendable , Base3: Sendable { }
102+ extension AsyncChain3Sequence : Sendable where Base1: Sendable , Base2: Sendable , Base3: Sendable { }
98103
99104@available ( * , unavailable)
100- extension AsyncChain3Sequence . Iterator : Sendable { }
105+ extension AsyncChain3Sequence . Iterator : Sendable { }
0 commit comments