Apply formatting

This commit is contained in:
Cory Benfield committed 2020-07-17 10:06:44 +01:00
1 parent 89ef2cf73d
commit 3f73125a0d
28 files changed
+198 -184

No files matched your search

@@ -27,23 +27,23 @@ struct DictionaryKeyedContainer<Key: CodingKey, BaseData: RandomAccessCollection
extension DictionaryKeyedContainer: KeyedDecodingContainerProtocol {
var codingPath: [CodingKey] {
return self.decoder.codingPath
self.decoder.codingPath
}
var allKeys: [Key] {
return self.dictionary.compactMap { Key(stringValue: $0.0) }
self.dictionary.compactMap { Key(stringValue: $0.0) }
}
func contains(_ key: Key) -> Bool {
return self.dictionary.contains(where: { $0.0 == key.stringValue })
self.dictionary.contains(where: { $0.0 == key.stringValue })
}
func decodeNil(forKey key: Key) throws -> Bool {
// We will decode nil if the key is not present.
return !self.contains(key)
!self.contains(key)
}
func decode<T>(_ type: T.Type, forKey key: Key) throws -> T where T : Decodable {
func decode<T>(_ type: T.Type, forKey key: Key) throws -> T where T: Decodable {
try self.decoder.push(_StructuredHeaderCodingKey(key, keyDecodingStrategy: self.decoder.keyDecodingStrategy))
defer {
self.decoder.pop()