Skip to content

Commit 1827dc9

Browse files
authored
Merge pull request #38 from gwynne/patch-1
Stop using opaque return types to resolve build error
2 parents 4c54209 + fee4574 commit 1827dc9

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

CONTRIBUTORS.txt

+2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ needs to be listed here.
1313

1414
- Franz Busch <[email protected]>
1515
- Guoye Zhang <[email protected]>
16+
- Gwynne Raskind <[email protected]>
1617
- Jager-yoo <[email protected]>
1718
- Sergey Dmitriev <[email protected]>
19+
- Tim Condon <[email protected]>
1820
- Tomohiro Kumagai <[email protected]>
1921

2022
**Updating this list**

Sources/HTTPTypes/HTTPFields.swift

+17-17
Original file line numberDiff line numberDiff line change
@@ -216,30 +216,30 @@ public struct HTTPFields: Sendable, Hashable {
216216
}
217217
}
218218

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
223222

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
227226

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
235230
}
231+
let (field, next) = self.fields[Int(self.index)]
232+
self.index = next
233+
return field
236234
}
235+
}
237236

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)
241239
}
240+
}
242241

242+
private func fields(for name: HTTPField.Name) -> HTTPFieldSequence {
243243
let index = self._storage.ensureIndex[name.canonicalName]?.first ?? .max
244244
return HTTPFieldSequence(fields: self._storage.fields, index: index)
245245
}

0 commit comments

Comments
 (0)