Skip to content

Commit 0e75335

Browse files
Remove AsyncStream.makeStream backports now we support only Swift 5.9+ (#34)
### Motivation We had some code in an `#if swift(<5.9)` block, which can now be removed because we only support Swift 5.9 and newer. ### Modifications Remove code required to support Swift 5.8. ### Result Removed dead code. ### Test Plan Tests pass.
1 parent 0b99785 commit 0e75335

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

Tests/OpenAPIURLSessionTests/TestUtils.swift

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -153,31 +153,6 @@ final class LockedValueBox<Value>: @unchecked Sendable where Value: Sendable {
153153
}
154154
}
155155

156-
#if swift(<5.9)
157-
extension AsyncStream {
158-
static func makeStream(
159-
of elementType: Element.Type = Element.self,
160-
bufferingPolicy limit: Self.Continuation.BufferingPolicy = .unbounded
161-
) -> (stream: Self, continuation: Self.Continuation) {
162-
var continuation: Self.Continuation!
163-
let stream = Self(bufferingPolicy: limit) { continuation = $0 }
164-
return (stream, continuation)
165-
}
166-
}
167-
168-
extension AsyncThrowingStream {
169-
static func makeStream(
170-
of elementType: Element.Type = Element.self,
171-
throwing failureType: Failure.Type = Failure.self,
172-
bufferingPolicy limit: Self.Continuation.BufferingPolicy = .unbounded
173-
) -> (stream: Self, continuation: Self.Continuation) where Failure == Error {
174-
var continuation: Self.Continuation!
175-
let stream = Self(bufferingPolicy: limit) { continuation = $0 }
176-
return (stream, continuation!)
177-
}
178-
}
179-
#endif // #if swift(<5.9)
180-
181156
extension AsyncSequence {
182157
/// Collect all elements in the sequence into an array.
183158
func collect() async throws -> [Element] {

0 commit comments

Comments
 (0)