@@ -216,35 +216,35 @@ public struct HTTPFields: Sendable, Hashable {
216
216
}
217
217
}
218
218
219
- private func fields( for name: HTTPField . Name ) -> some Sequence < HTTPField > {
220
- struct HTTPFieldSequence : Sequence {
221
- let fields : [ ( field: HTTPField , next: UInt16 ) ]
222
- let index : UInt16
219
+ private struct HTTPFieldSequence : Sequence {
220
+ let fields : [ ( field: HTTPField , next: UInt16 ) ]
221
+ let index : UInt16
223
222
224
- struct Iterator : IteratorProtocol {
225
- let fields : [ ( field: HTTPField , next: UInt16 ) ]
226
- var index : UInt16
223
+ struct Iterator : IteratorProtocol {
224
+ let fields : [ ( field: HTTPField , next: UInt16 ) ]
225
+ var index : UInt16
227
226
228
- mutating func next( ) -> HTTPField ? {
229
- if self . index == . max {
230
- return nil
231
- }
232
- let ( field, next) = self . fields [ Int ( self . index) ]
233
- self . index = next
234
- return field
227
+ mutating func next( ) -> HTTPField ? {
228
+ if self . index == . max {
229
+ return nil
235
230
}
231
+ let ( field, next) = self . fields [ Int ( self . index) ]
232
+ self . index = next
233
+ return field
236
234
}
235
+ }
237
236
238
- func makeIterator( ) -> Iterator {
239
- Iterator ( fields: self . fields, index: self . index)
240
- }
237
+ func makeIterator( ) -> Iterator {
238
+ Iterator ( fields: self . fields, index: self . index)
241
239
}
240
+ }
242
241
242
+ private func fields( for name: HTTPField . Name ) -> HTTPFieldSequence {
243
243
let index = self . _storage. ensureIndex [ name. canonicalName] ? . first ?? . max
244
244
return HTTPFieldSequence ( fields: self . _storage. fields, index: index)
245
245
}
246
246
247
- private mutating func setFields( _ fieldSequence: some Sequence < HTTPField > , for name: HTTPField . Name ) {
247
+ private mutating func setFields< S : Sequence > ( _ fieldSequence: S , for name: HTTPField . Name ) where S . Element == HTTPField {
248
248
if !isKnownUniquelyReferenced( & self . _storage) {
249
249
self . _storage = self . _storage. copy ( )
250
250
}
@@ -384,7 +384,7 @@ extension HTTPFields: Codable {
384
384
385
385
extension Array {
386
386
// `removalIndices` must be ordered.
387
- mutating func remove( at removalIndices: some Sequence < Index > ) {
387
+ mutating func remove< S : Sequence > ( at removalIndices: S ) where S . Element == Index {
388
388
var offset = 0
389
389
var iterator = removalIndices. makeIterator ( )
390
390
var nextToRemoveOptional = iterator. next ( )
0 commit comments