@@ -199,65 +199,65 @@ extension ShadowDecoder.KeyedContainer {
199199}
200200
201201//extension ShadowDecoder.KeyedContainer {
202- // func decodeIfPresent(_ type: String.Type, forKey key: Key) throws -> String? {
203- // try? self.decode(String.self, forKey: key)
204- // }
202+ // func decodeIfPresent(_ type: String.Type, forKey key: Key) throws -> String? {
203+ // try? self.decode(String.self, forKey: key)
204+ // }
205205//
206- // func decodeIfPresent(_ type: Bool.Type, forKey key: Key) throws -> Bool? {
207- // try? self.decode(Bool.self, forKey: key)
208- // }
206+ // func decodeIfPresent(_ type: Bool.Type, forKey key: Key) throws -> Bool? {
207+ // try? self.decode(Bool.self, forKey: key)
208+ // }
209209//
210- // func decodeIfPresent(_ type: Int.Type, forKey key: Key) throws -> Int? {
211- // try? self.decode(Int.self, forKey: key)
212- // }
210+ // func decodeIfPresent(_ type: Int.Type, forKey key: Key) throws -> Int? {
211+ // try? self.decode(Int.self, forKey: key)
212+ // }
213213//
214- // func decodeIfPresent(_ type: Int8.Type, forKey key: Key) throws -> Int8? {
215- // try? self.decode(Int8.self, forKey: key)
216- // }
214+ // func decodeIfPresent(_ type: Int8.Type, forKey key: Key) throws -> Int8? {
215+ // try? self.decode(Int8.self, forKey: key)
216+ // }
217217//
218- // func decodeIfPresent(_ type: Int16.Type, forKey key: Key) throws -> Int16? {
219- // try? self.decode(Int16.self, forKey: key)
220- // }
218+ // func decodeIfPresent(_ type: Int16.Type, forKey key: Key) throws -> Int16? {
219+ // try? self.decode(Int16.self, forKey: key)
220+ // }
221221//
222- // func decodeIfPresent(_ type: Int32.Type, forKey key: Key) throws -> Int32? {
223- // try? self.decode(Int32.self, forKey: key)
224- // }
222+ // func decodeIfPresent(_ type: Int32.Type, forKey key: Key) throws -> Int32? {
223+ // try? self.decode(Int32.self, forKey: key)
224+ // }
225225//
226- // func decodeIfPresent(_ type: Int64.Type, forKey key: Key) throws -> Int64? {
227- // try? self.decode(Int64.self, forKey: key)
228- // }
226+ // func decodeIfPresent(_ type: Int64.Type, forKey key: Key) throws -> Int64? {
227+ // try? self.decode(Int64.self, forKey: key)
228+ // }
229229//
230- // func decodeIfPresent(_ type: UInt.Type, forKey key: Key) throws -> UInt? {
231- // try? self.decode(UInt.self, forKey: key)
232- // }
230+ // func decodeIfPresent(_ type: UInt.Type, forKey key: Key) throws -> UInt? {
231+ // try? self.decode(UInt.self, forKey: key)
232+ // }
233233//
234- // func decodeIfPresent(_ type: UInt8.Type, forKey key: Key) throws -> UInt8? {
235- // try? self.decode(UInt8.self, forKey: key)
236- // }
234+ // func decodeIfPresent(_ type: UInt8.Type, forKey key: Key) throws -> UInt8? {
235+ // try? self.decode(UInt8.self, forKey: key)
236+ // }
237237//
238- // func decodeIfPresent(_ type: UInt16.Type, forKey key: Key) throws -> UInt16? {
239- // try? self.decode(UInt16.self, forKey: key)
240- // }
238+ // func decodeIfPresent(_ type: UInt16.Type, forKey key: Key) throws -> UInt16? {
239+ // try? self.decode(UInt16.self, forKey: key)
240+ // }
241241//
242- // func decodeIfPresent(_ type: UInt32.Type, forKey key: Key) throws -> UInt32? {
243- // try? self.decode(UInt32.self, forKey: key)
244- // }
242+ // func decodeIfPresent(_ type: UInt32.Type, forKey key: Key) throws -> UInt32? {
243+ // try? self.decode(UInt32.self, forKey: key)
244+ // }
245245//
246- // func decodeIfPresent(_ type: UInt64.Type, forKey key: Key) throws -> UInt64? {
247- // try? self.decode(UInt64.self, forKey: key)
248- // }
246+ // func decodeIfPresent(_ type: UInt64.Type, forKey key: Key) throws -> UInt64? {
247+ // try? self.decode(UInt64.self, forKey: key)
248+ // }
249249//
250- // func decodeIfPresent(_ type: Float.Type, forKey key: Key) throws -> Float? {
251- // try? self.decode(Float.self, forKey: key)
252- // }
250+ // func decodeIfPresent(_ type: Float.Type, forKey key: Key) throws -> Float? {
251+ // try? self.decode(Float.self, forKey: key)
252+ // }
253253//
254- // func decodeIfPresent(_ type: Double.Type, forKey key: Key) throws -> Double? {
255- // try? self.decode(Double.self, forKey: key)
256- // }
254+ // func decodeIfPresent(_ type: Double.Type, forKey key: Key) throws -> Double? {
255+ // try? self.decode(Double.self, forKey: key)
256+ // }
257257//
258- // func decodeIfPresent<T>(_ type: T.Type, forKey key: Key) throws -> T? where T:Decodable {
259- // try? self.decode(T.self, forKey: key)
260- // }
258+ // func decodeIfPresent<T>(_ type: T.Type, forKey key: Key) throws -> T? where T:Decodable {
259+ // try? self.decode(T.self, forKey: key)
260+ // }
261261//}
262262
263263// MARK: -
@@ -291,33 +291,33 @@ private extension ShadowDecoder.KeyedContainer {
291291 }
292292
293293 let decoder = ShadowDecoder ( source: self . _decoder. source, codingPath: codingPath)
294- return . init ( unsafeDecoder: decoder, rowIndex: index. row, fieldIndex: index. field)
294+ return ShadowDecoder . SingleValueContainer ( unsafeDecoder: decoder, rowIndex: index. row, fieldIndex: index. field)
295295 }
296296}
297297
298298fileprivate extension CSVDecoder . Error {
299299 /// Error raised when a coding key representing a row within the CSV file cannot be transformed into an integer value.
300300 /// - parameter codingPath: The full decoding chain.
301301 static func _invalidRowKey( forKey key: CodingKey , codingPath: [ CodingKey ] ) -> CSVError < CSVDecoder > {
302- . init ( . invalidPath,
303- reason: " The coding key identifying a CSV row couldn't be transformed into an integer value. " ,
304- help: " The provided coding key identifying a CSV row must implement `intValue`. " ,
305- userInfo: [ " Coding path " : codingPath, " Key " : key] )
302+ CSVError ( . invalidPath,
303+ reason: " The coding key identifying a CSV row couldn't be transformed into an integer value. " ,
304+ help: " The provided coding key identifying a CSV row must implement `intValue`. " ,
305+ userInfo: [ " Coding path " : codingPath, " Key " : key] )
306306 }
307307 /// Error raised when a keyed container is requested on an invalid coding path.
308308 /// - parameter codingPath: The full decoding chain.
309309 static func _invalidContainerRequest( forKey key: CodingKey , codingPath: [ CodingKey ] ) -> CSVError < CSVDecoder > {
310- . init ( . invalidPath,
311- reason: " A CSV doesn't support more than two nested decoding container. " ,
312- help: " Don't ask for a nested container on the targeted key for this coding path. " ,
313- userInfo: [ " Coding path " : codingPath, " Key " : key] )
310+ CSVError ( . invalidPath,
311+ reason: " A CSV doesn't support more than two nested decoding container. " ,
312+ help: " Don't ask for a nested container on the targeted key for this coding path. " ,
313+ userInfo: [ " Coding path " : codingPath, " Key " : key] )
314314 }
315315 /// Error raised when a value is decoded, but a container was expected by the decoder.
316316 /// - parameter codingPath: The full decoding chain.
317317 static func _invalidNestedRequired( codingPath: [ CodingKey ] ) -> CSVError < CSVDecoder > {
318- . init ( . invalidPath,
319- reason: " A nested container is needed to decode CSV row values " ,
320- help: " Request a nested container instead of trying to decode a value directly. " ,
321- userInfo: [ " Coding path " : codingPath] )
318+ CSVError ( . invalidPath,
319+ reason: " A nested container is needed to decode CSV row values " ,
320+ help: " Request a nested container instead of trying to decode a value directly. " ,
321+ userInfo: [ " Coding path " : codingPath] )
322322 }
323323}
0 commit comments