Skip to content

Commit c21ee2d

Browse files
authored
Remove Sendable constraint for AsyncAdjacentPairsSequence (#212)
# Motivation We want to remove any `Sendable` constraints on iterators since they ought to not be passed between `Task`s. # Modification Explicitly mark the `AsyncAdjacentPairsSequence` to be not `Sendable`. # Result Nobody can make this `Sendable`.
1 parent aedcb78 commit c21ee2d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: Sources/AsyncAlgorithms/AsyncAdjacentPairsSequence.swift

+4-2
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,7 @@ extension AsyncSequence {
8383
}
8484
}
8585

86-
extension AsyncAdjacentPairsSequence: Sendable where Base: Sendable, Base.Element: Sendable, Base.AsyncIterator: Sendable { }
87-
extension AsyncAdjacentPairsSequence.Iterator: Sendable where Base: Sendable, Base.Element: Sendable, Base.AsyncIterator: Sendable { }
86+
extension AsyncAdjacentPairsSequence: Sendable where Base: Sendable, Base.Element: Sendable { }
87+
88+
@available(*, unavailable)
89+
extension AsyncAdjacentPairsSequence.Iterator: Sendable { }

0 commit comments

Comments
 (0)