Skip to content

Commit 1615570

Browse files
committed
Update AsyncPrefixWhileSequence.swift
1 parent e76b97e commit 1615570

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

stdlib/public/Concurrency/AsyncPrefixWhileSequence.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ import Swift
1414

1515
@available(SwiftStdlib 5.1, *)
1616
extension AsyncSequence {
17+
@available(*, deprecated, renamed: "prefix(while:)")
18+
@preconcurrency
19+
@inlinable
20+
public __consuming func prefix(
21+
while predicate: @Sendable @escaping (Element) async -> Bool
22+
) rethrows -> AsyncPrefixWhileSequence<Self> {
23+
return AsyncPrefixWhileSequence(self, predicate: predicate)
24+
}
1725
/// Returns an asynchronous sequence, containing the initial, consecutive
1826
/// elements of the base sequence that satisfy the given predicate.
1927
///
@@ -42,7 +50,7 @@ extension AsyncSequence {
4250
@inlinable
4351
public __consuming func prefix(
4452
while predicate: @Sendable @escaping (Element) async -> Bool
45-
) rethrows -> AsyncPrefixWhileSequence<Self> {
53+
) -> AsyncPrefixWhileSequence<Self> {
4654
return AsyncPrefixWhileSequence(self, predicate: predicate)
4755
}
4856
}

0 commit comments

Comments
 (0)