17
17
/// x.split(maxSplits:omittingEmptySubsequences:whereSeparator)
18
18
/// x.split(separator:maxSplits:omittingEmptySubsequences)
19
19
///
20
- /// where `x` conforms to `LazyCollection `.
20
+ /// where `x` conforms to `LazyCollectionProtocol `.
21
21
public struct LazySplitCollection < Base: LazyCollectionProtocol >
22
- where Base . Element : Equatable , Base. Elements. Index == Base . Index {
22
+ where Base. Elements. Index == Base . Index {
23
23
internal let base : Base
24
24
internal let isSeparator : ( Base . Element ) -> Bool
25
25
internal let maxSplits : Int
@@ -53,7 +53,7 @@ extension LazySplitCollection {
53
53
}
54
54
}
55
55
56
- extension LazySplitCollection . Iterator : IteratorProtocol , Sequence {
56
+ extension LazySplitCollection . Iterator : IteratorProtocol {
57
57
public typealias Element = Base . Elements . SubSequence
58
58
59
59
public mutating func next( ) -> Element ? {
@@ -148,7 +148,7 @@ extension LazySplitCollection: LazySequenceProtocol {
148
148
}
149
149
}
150
150
151
- extension LazyCollection where Element : Equatable {
151
+ extension LazyCollectionProtocol where Elements . Index == Index {
152
152
/// Lazily returns the longest possible subsequences of the collection, in order,
153
153
/// that don't contain elements satisfying the given predicate.
154
154
///
@@ -227,7 +227,7 @@ extension LazyCollection where Element: Equatable {
227
227
func split(
228
228
maxSplits: Int = Int . max,
229
229
omittingEmptySubsequences: Bool = true ,
230
- whereSeparator isSeparator: @escaping ( Base . Element ) -> Bool
230
+ whereSeparator isSeparator: @escaping ( Element ) -> Bool
231
231
) -> LazySplitCollection < Self > {
232
232
precondition ( maxSplits >= 0 , " Must take zero or more splits " )
233
233
@@ -238,7 +238,9 @@ extension LazyCollection where Element: Equatable {
238
238
omittingEmptySubsequences: omittingEmptySubsequences
239
239
)
240
240
}
241
+ }
241
242
243
+ extension LazyCollectionProtocol where Element: Equatable , Elements. Index == Index {
242
244
/// Lazily returns the longest possible subsequences of the collection, in order,
243
245
/// around elements equal to the given element.
244
246
///
0 commit comments