From c21ee2d706c2fd802c9676d40d874d7dee61c0cb Mon Sep 17 00:00:00 2001 From: Franz Busch Date: Fri, 14 Oct 2022 16:39:53 +0100 Subject: [PATCH] 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`. --- Sources/AsyncAlgorithms/AsyncAdjacentPairsSequence.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/AsyncAlgorithms/AsyncAdjacentPairsSequence.swift b/Sources/AsyncAlgorithms/AsyncAdjacentPairsSequence.swift index 7a69bf3..2a37f91 100644 --- a/Sources/AsyncAlgorithms/AsyncAdjacentPairsSequence.swift +++ b/Sources/AsyncAlgorithms/AsyncAdjacentPairsSequence.swift @@ -83,5 +83,7 @@ extension AsyncSequence { } } -extension AsyncAdjacentPairsSequence: Sendable where Base: Sendable, Base.Element: Sendable, Base.AsyncIterator: Sendable { } -extension AsyncAdjacentPairsSequence.Iterator: Sendable where Base: Sendable, Base.Element: Sendable, Base.AsyncIterator: Sendable { } +extension AsyncAdjacentPairsSequence: Sendable where Base: Sendable, Base.Element: Sendable { } + +@available(*, unavailable) +extension AsyncAdjacentPairsSequence.Iterator: Sendable { }