Skip to content

Commit 67a2795

Browse files
committed
Remove the mapping error util
1 parent 53c44d0 commit 67a2795

File tree

2 files changed

+6
-29
lines changed

2 files changed

+6
-29
lines changed

Sources/AsyncAlgorithms/CombineLatest/CombineLatestManyStateMachine.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
import DequeModule
1313

14-
// TODO: Do we need to add Failure: Error generic here?
15-
1614
/// State machine for combine latest
1715
@available(AsyncAlgorithms 1.1, *)
1816
struct CombineLatestManyStateMachine<Element: Sendable>: Sendable {

Tests/AsyncAlgorithmsTests/TestCombineLatestMany.swift

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ import AsyncAlgorithms
1515
@available(AsyncAlgorithms 1.1, *)
1616
final class TestCombineLatestMany: XCTestCase {
1717
func test_combineLatest() async throws {
18-
let a = [1, 2, 3].async.mappedFailureToError
19-
let b = [4, 5, 6].async.mappedFailureToError
20-
let c = [7, 8, 9].async.mappedFailureToError
18+
let a = [1, 2, 3].async
19+
let b = [4, 5, 6].async
20+
let c = [7, 8, 9].async
2121
let sequence = combineLatestMany([a, b, c])
2222
let actual = try await Array(sequence)
2323
XCTAssertGreaterThanOrEqual(actual.count, 3)
2424
}
2525

2626
func test_ordering1() async {
27-
var a = GatedSequence([1, 2, 3]).mappedFailureToError
28-
var b = GatedSequence([4, 5, 6]).mappedFailureToError
29-
var c = GatedSequence([7, 8, 9]).mappedFailureToError
27+
var a = GatedSequence([1, 2, 3])
28+
var b = GatedSequence([4, 5, 6])
29+
var c = GatedSequence([7, 8, 9])
3030
let finished = expectation(description: "finished")
3131
let sequence = combineLatestMany([a, b, c])
3232
let validator = Validator<[Int]>()
@@ -83,24 +83,3 @@ final class TestCombineLatestMany: XCTestCase {
8383
)
8484
}
8585
}
86-
87-
@available(AsyncAlgorithms 1.1, *)
88-
private struct MappingErrorAsyncSequence<Upstream: AsyncSequence & Sendable>: AsyncSequence, Sendable where Upstream.Failure == Never {
89-
var upstream: Upstream
90-
func makeAsyncIterator() -> Iterator {
91-
Iterator(upstream: upstream.makeAsyncIterator())
92-
}
93-
struct Iterator: AsyncIteratorProtocol {
94-
var upstream: Upstream.AsyncIterator
95-
mutating func next(isolation actor: isolated (any Actor)?) async throws -> Upstream.Element? {
96-
await upstream.next(isolation: actor)
97-
}
98-
}
99-
}
100-
101-
@available(AsyncAlgorithms 1.1, *)
102-
extension AsyncSequence where Failure == Never, Self: Sendable {
103-
var mappedFailureToError: some AsyncSequence<Element, any Error> & Sendable {
104-
MappingErrorAsyncSequence(upstream: self)
105-
}
106-
}

0 commit comments

Comments
 (0)