mirror of
https://github.com/apple/swift-http-structured-headers
synced 2026-11-25 04:47:48 +00:00
Apply formatting
This commit is contained in:
1 parent
89ef2cf73d
commit
3f73125a0d
28 files changed
+198
-184
No files matched your search
@@ -30,27 +30,27 @@ struct TopLevelListDecoder<BaseData: RandomAccessCollection> where BaseData.Elem
|
||||
|
||||
extension TopLevelListDecoder: UnkeyedDecodingContainer {
|
||||
var codingPath: [CodingKey] {
|
||||
return self.decoder.codingPath
|
||||
self.decoder.codingPath
|
||||
}
|
||||
|
||||
var count: Int? {
|
||||
return self.list.count
|
||||
self.list.count
|
||||
}
|
||||
|
||||
var isAtEnd: Bool {
|
||||
return self.currentOffset == self.list.count
|
||||
self.currentOffset == self.list.count
|
||||
}
|
||||
|
||||
var currentIndex: Int {
|
||||
return self.currentOffset
|
||||
self.currentOffset
|
||||
}
|
||||
|
||||
mutating func decodeNil() throws -> Bool {
|
||||
// We never decode nil.
|
||||
return false
|
||||
false
|
||||
}
|
||||
|
||||
mutating func decode<T>(_ type: T.Type) throws -> T where T : Decodable {
|
||||
mutating func decode<T>(_ type: T.Type) throws -> T where T: Decodable {
|
||||
// This is a request to decode a scalar. We decode the next entry and increment the index.
|
||||
guard !self.isAtEnd else {
|
||||
throw StructuredHeaderError.indexOutOfRange
|
||||
@@ -77,7 +77,7 @@ extension TopLevelListDecoder: UnkeyedDecodingContainer {
|
||||
}
|
||||
}
|
||||
|
||||
mutating func nestedContainer<NestedKey>(keyedBy type: NestedKey.Type) throws -> KeyedDecodingContainer<NestedKey> where NestedKey : CodingKey {
|
||||
mutating func nestedContainer<NestedKey>(keyedBy type: NestedKey.Type) throws -> KeyedDecodingContainer<NestedKey> where NestedKey: CodingKey {
|
||||
// This is a request to decode a full item. We decode the next entry and increment the index.
|
||||
guard !self.isAtEnd else {
|
||||
throw StructuredHeaderError.indexOutOfRange
|
||||
@@ -116,5 +116,4 @@ extension TopLevelListDecoder: UnkeyedDecodingContainer {
|
||||
// No inheritance here folks
|
||||
throw StructuredHeaderError.invalidTypeForItem
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user