Merge pull request #598 from lorentey/remove-BorrowingSequence.first

[ContainersPreview] Remove BorrowingSequence.first
This commit is contained in:
Karoy Lorentey authored and GitHub committed 2026-03-09 16:40:18 -07:00
commit 41beccbd44
1 file changed
-13
@@ -47,19 +47,6 @@ extension BorrowingSequence where Self: Sequence {
}
}
@available(SwiftStdlib 5.0, *)
extension BorrowingSequence where Element: Copyable {
// FIXME: How do we expect this to work for ~Copyable elements?
public var first: Element? {
var it = makeBorrowingIterator()
let span = it.nextSpan(maximumCount: 1)
guard !span.isEmpty else { return nil }
return span[0]
}
}
@available(SwiftStdlib 5.0, *)
extension BorrowingSequence where Self: ~Copyable & ~Escapable {
/// Implementation demo of what borrowing for-in loops would need to expand into.