@@ -51,9 +51,8 @@ public typealias Codable = Encodable & Decodable
51
51
//===----------------------------------------------------------------------===//
52
52
53
53
/// A type that can be used as a key for encoding and decoding.
54
- public protocol CodingKey :
55
- CustomStringConvertible , CustomDebugStringConvertible
56
- {
54
+ public protocol CodingKey : CustomStringConvertible ,
55
+ CustomDebugStringConvertible {
57
56
/// The string to use in a named collection (e.g. a string-keyed dictionary).
58
57
var stringValue : String { get }
59
58
@@ -153,7 +152,9 @@ public protocol Decoder {
153
152
/// - returns: A keyed decoding container view into this decoder.
154
153
/// - throws: `DecodingError.typeMismatch` if the encountered stored value is
155
154
/// not a keyed container.
156
- func container< Key> ( keyedBy type: Key . Type ) throws -> KeyedDecodingContainer < Key >
155
+ func container< Key> (
156
+ keyedBy type: Key . Type
157
+ ) throws -> KeyedDecodingContainer < Key >
157
158
158
159
/// Returns the data stored in this decoder as represented in a container
159
160
/// appropriate for holding values with no keys.
@@ -329,7 +330,6 @@ public protocol KeyedEncodingContainerProtocol {
329
330
forKey key: Key
330
331
) throws
331
332
332
-
333
333
/// Encodes the given value for the given key if it is not `nil`.
334
334
///
335
335
/// - parameter value: The value to encode.
@@ -3398,7 +3398,8 @@ extension DecodingError {
3398
3398
/// - Returns: A new `.dataCorrupted` error with the given information.
3399
3399
public static func dataCorruptedError< C: KeyedDecodingContainerProtocol > (
3400
3400
forKey key: C . Key ,
3401
- in container: C , debugDescription: String
3401
+ in container: C ,
3402
+ debugDescription: String
3402
3403
) -> DecodingError {
3403
3404
let context = DecodingError . Context (
3404
3405
codingPath: container. codingPath + [ key] ,
@@ -3440,7 +3441,8 @@ extension DecodingError {
3440
3441
///
3441
3442
/// - Returns: A new `.dataCorrupted` error with the given information.
3442
3443
public static func dataCorruptedError(
3443
- in container: SingleValueDecodingContainer , debugDescription: String
3444
+ in container: SingleValueDecodingContainer ,
3445
+ debugDescription: String
3444
3446
) -> DecodingError {
3445
3447
let context = DecodingError . Context ( codingPath: container. codingPath,
3446
3448
debugDescription: debugDescription)
@@ -5730,7 +5732,6 @@ extension KeyedDecodingContainerProtocol {
5730
5732
return try self . decode ( UInt64 . self, forKey: key)
5731
5733
}
5732
5734
5733
-
5734
5735
public func decodeIfPresent< T: Decodable > (
5735
5736
_ type: T . Type ,
5736
5737
forKey key: Key
@@ -5972,7 +5973,6 @@ extension UnkeyedDecodingContainer {
5972
5973
return try self . decode ( UInt64 . self)
5973
5974
}
5974
5975
5975
-
5976
5976
public mutating func decodeIfPresent< T: Decodable > (
5977
5977
_ type: T . Type
5978
5978
) throws -> T ? {
0 commit comments