Skip to content

Commit b2beeb2

Browse files
authored
Change all AsyncStreaming availability from 26.2 to SwiftStdlib 5.0 (#421)
* Change all AsyncStreaming availability from 26.2 to SwiftStdlib 5.0 * Spelling
1 parent d0b4a06 commit b2beeb2

18 files changed

Lines changed: 9 additions & 38 deletions

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ if Context.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
163163
package.dependencies += [
164164
.package(
165165
url: "https://github.com/apple/swift-collections.git",
166-
from: "1.5.0",
166+
from: "1.5.1",
167167
traits: [.trait(name: "UnstableContainersPreview", condition: .when(traits: ["UnstableAsyncStreaming"]))]
168168
)
169169
]

Sources/AsyncStreaming/AsyncReader/AsyncReader+collect.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public struct AsyncReaderLeftOverElementsError: Error, Hashable {
2222
public init() {}
2323
}
2424

25-
@available(macOS 26.2, iOS 26.2, watchOS 26.2, tvOS 26.2, visionOS 26.2, *)
25+
@available(macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, *)
2626
extension AsyncReader where Self: ~Copyable, Self: ~Escapable, ReadElement: ~Copyable {
2727
/// Collects elements from the reader up to a specified limit and processes them.
2828
///

Sources/AsyncStreaming/AsyncReader/AsyncReader+forEach.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
public import ContainersPreview
1515

1616
// swift-format-ignore: AmbiguousTrailingClosureOverload
17-
@available(macOS 26.2, iOS 26.2, watchOS 26.2, tvOS 26.2, visionOS 26.2, *)
17+
@available(macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, *)
1818
extension AsyncReader where Self: ~Copyable, Self: ~Escapable {
1919
/// Iterates over all chunks from the reader, executing the provided body for each buffer.
2020
///

Sources/AsyncStreaming/AsyncReader/AsyncReader.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public import ContainersPreview
1717
/// Adopt ``AsyncReader`` when you need callee-managed buffering,
1818
/// where the reader controls the buffer and passes it to the caller
1919
/// through the `body` closure.
20-
@available(macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, visionOS 1.0, *)
20+
@available(macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, *)
2121
public protocol AsyncReader<ReadElement, ReadFailure>: ~Copyable, ~Escapable {
2222
/// The type of elements this reader reads.
2323
associatedtype ReadElement: ~Copyable

Sources/AsyncStreaming/AsyncWriter/AsyncWriter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public import ContainersPreview
1717
/// Adopt ``AsyncWriter`` when you need callee-managed buffering,
1818
/// where the writer supplies a buffer that the caller fills
1919
/// with elements to write.
20-
@available(macOS 26.2, iOS 26.2, watchOS 26.2, tvOS 26.2, visionOS 26.2, *)
20+
@available(macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, *)
2121
public protocol AsyncWriter<WriteElement, WriteFailure>: ~Copyable, ~Escapable {
2222
/// The type of elements this writer writes.
2323
associatedtype WriteElement: ~Copyable

Sources/AsyncStreaming/CallerAsyncReader/CallerAsyncReader.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public import ContainersPreview
1717
/// Adopt ``CallerAsyncReader`` when you need caller-managed buffering,
1818
/// where the caller supplies a buffer that the reader fills
1919
/// with elements.
20-
@available(macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, visionOS 1.0, *)
20+
@available(macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, *)
2121
public protocol CallerAsyncReader<ReadElement, ReadFailure>: ~Copyable, ~Escapable {
2222
/// The type of elements this reader reads.
2323
associatedtype ReadElement: ~Copyable

Sources/AsyncStreaming/CallerAsyncWriter/CallerAsyncWriter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public import ContainersPreview
1717
/// Adopt ``CallerAsyncWriter`` when you need caller-managed buffering,
1818
/// where the caller provides a buffer of elements for the writer
1919
/// to consume.
20-
@available(macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, visionOS 1.0, *)
20+
@available(macOS 10.14.4, iOS 12.2, watchOS 5.2, tvOS 12.2, *)
2121
public protocol CallerAsyncWriter<WriteElement, WriteFailure>: ~Copyable, ~Escapable {
2222
/// The type of elements this writer writes.
2323
associatedtype WriteElement: ~Copyable

Tests/AsyncAlgorithmsTests/MultiProducerSingleConsumerChannel/MultiProducerSingleConsumerAsyncChannelTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ final class MultiProducerSingleConsumerAsyncChannelTests: XCTestCase {
962962
_ = await iterator.next(isolation: nil)
963963
}
964964

965-
func testWatermarWithLotsOfElements() async throws {
965+
func testWatermarkWithLotsOfElements() async throws {
966966
await withThrowingTaskGroup(of: Void.self) { group in
967967
// This test should in the future use a custom task executor to schedule to avoid sending
968968
// 1000 elements.
@@ -971,7 +971,7 @@ final class MultiProducerSingleConsumerAsyncChannelTests: XCTestCase {
971971
backpressureStrategy: .watermark(low: 2, high: 4)
972972
)
973973
let channel = channelAndSource.takeChannel()
974-
var source: MultiProducerSingleConsumerAsyncChannel.Source! = consume channelAndSource.source
974+
var source: MultiProducerSingleConsumerAsyncChannel.Source? = consume channelAndSource.source
975975

976976
group.addTask {
977977
var source = source.take()!

Tests/AsyncStreamingTests/AsyncReader/AsyncReader+collectTests.swift

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import Testing
1919
@Suite
2020
struct AsyncReaderCollectTests {
2121
@Test
22-
@available(macOS 26.2, iOS 26.2, watchOS 26.2, tvOS 26.2, visionOS 26.2, *)
2322
func collectAllElements() async throws {
2423
var reader = UniqueArrayAsyncReader(storage: UniqueArray(capacity: 5, copying: [1, 2, 3, 4, 5]))
2524

@@ -31,7 +30,6 @@ struct AsyncReaderCollectTests {
3130
}
3231

3332
@Test
34-
@available(macOS 26.2, iOS 26.2, watchOS 26.2, tvOS 26.2, visionOS 26.2, *)
3533
func collectWithExactLimit() async throws {
3634
var reader = UniqueArrayAsyncReader(storage: UniqueArray(capacity: 5, copying: [1, 2, 3, 4, 5]))
3735

@@ -43,7 +41,6 @@ struct AsyncReaderCollectTests {
4341
}
4442

4543
@Test
46-
@available(macOS 26.2, iOS 26.2, watchOS 26.2, tvOS 26.2, visionOS 26.2, *)
4744
func collectEmptyReader() async throws {
4845
var reader = UniqueArrayAsyncReader(storage: UniqueArray(capacity: 0, copying: []))
4946

@@ -55,7 +52,6 @@ struct AsyncReaderCollectTests {
5552
}
5653

5754
@Test
58-
@available(macOS 26.2, iOS 26.2, watchOS 26.2, tvOS 26.2, visionOS 26.2, *)
5955
func collectProcessesAllElements() async throws {
6056
var reader = UniqueArrayAsyncReader(storage: UniqueArray(capacity: 3, copying: [10, 20, 30]))
6157

@@ -71,7 +67,6 @@ struct AsyncReaderCollectTests {
7167
}
7268

7369
@Test
74-
@available(macOS 26.2, iOS 26.2, watchOS 26.2, tvOS 26.2, visionOS 26.2, *)
7570
func collectThrowsLeftOverElements() async throws {
7671
var reader = UniqueArrayAsyncReader(storage: UniqueArray(capacity: 3, copying: [1, 2, 3]))
7772

Tests/AsyncStreamingTests/AsyncReader/AsyncReader+forEachTests.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import Testing
1919
@Suite
2020
struct AsyncReaderforEachBufferTests {
2121
@Test
22-
@available(macOS 26.2, iOS 26.2, watchOS 26.2, tvOS 26.2, visionOS 26.2, *)
2322
func forEachBufferIteratesAllSpans() async throws {
2423
let reader = UniqueArrayAsyncReader(storage: UniqueArray(capacity: 5, copying: [1, 2, 3, 4, 5]))
2524
var elementCount = 0
@@ -32,7 +31,6 @@ struct AsyncReaderforEachBufferTests {
3231
}
3332

3433
@Test
35-
@available(macOS 26.2, iOS 26.2, watchOS 26.2, tvOS 26.2, visionOS 26.2, *)
3634
func forEachBufferProcessesElements() async throws {
3735
let reader = UniqueArrayAsyncReader(storage: UniqueArray(capacity: 3, copying: [10, 20, 30]))
3836
var sum = 0
@@ -47,7 +45,6 @@ struct AsyncReaderforEachBufferTests {
4745
}
4846

4947
@Test
50-
@available(macOS 26.2, iOS 26.2, watchOS 26.2, tvOS 26.2, visionOS 26.2, *)
5148
func forEachBufferWithEmptyReader() async throws {
5249
let reader = UniqueArrayAsyncReader(storage: UniqueArray(capacity: 0, copying: []))
5350
var callCount = 0
@@ -60,7 +57,6 @@ struct AsyncReaderforEachBufferTests {
6057
}
6158

6259
@Test
63-
@available(macOS 26.2, iOS 26.2, watchOS 26.2, tvOS 26.2, visionOS 26.2, *)
6460
func forEachBufferWithThrowingBody() async {
6561
enum TestError: Error {
6662
case failed
@@ -79,7 +75,6 @@ struct AsyncReaderforEachBufferTests {
7975
}
8076

8177
@Test
82-
@available(macOS 26.2, iOS 26.2, watchOS 26.2, tvOS 26.2, visionOS 26.2, *)
8378
func forEachBufferWithNeverFailingReader() async {
8479
enum TestError: Error {
8580
case failed
@@ -100,7 +95,6 @@ struct AsyncReaderforEachBufferTests {
10095
}
10196

10297
@Test
103-
@available(macOS 26.2, iOS 26.2, watchOS 26.2, tvOS 26.2, visionOS 26.2, *)
10498
func forEachBufferWithAsyncWork() async throws {
10599
let reader = UniqueArrayAsyncReader(storage: UniqueArray(capacity: 3, copying: [1, 2, 3]))
106100
var results: [Int] = []

0 commit comments

Comments
 (0)