@@ -161,18 +161,6 @@ public extension KeyedEncodingContainerProtocol {
161161 try self . encodeMap ( pairs)
162162 }
163163 }
164-
165- mutating func encode( _ value: Decimal , forKey key: Self . Key ) throws {
166- var mutableValue = value
167- let stringValue = NSDecimalString ( & mutableValue, Locale ( identifier: " en_US " ) )
168- try self . encode ( stringValue, forKey: key)
169- }
170-
171- mutating func encodeIfPresent( _ value: Decimal ? , forKey key: Self . Key ) throws {
172- if let value {
173- try self . encode ( value, forKey: key)
174- }
175- }
176164}
177165
178166public extension KeyedDecodingContainerProtocol {
@@ -213,34 +201,6 @@ public extension KeyedDecodingContainerProtocol {
213201
214202 return map
215203 }
216-
217- func decode( _ type: Decimal . Type , forKey key: Self . Key ) throws -> Decimal {
218- let stringValue = try decode ( String . self, forKey: key)
219- guard let decimalValue = Decimal ( string: stringValue) else {
220- let context = DecodingError . Context (
221- codingPath: [ key] ,
222- debugDescription: " The key \( key) couldn't be converted to a Decimal value "
223- )
224- throw DecodingError . typeMismatch ( type, context)
225- }
226-
227- return decimalValue
228- }
229-
230- func decodeIfPresent( _ type: Decimal . Type , forKey key: Self . Key ) throws -> Decimal ? {
231- guard let stringValue = try decodeIfPresent ( String . self, forKey: key) else {
232- return nil
233- }
234- guard let decimalValue = Decimal ( string: stringValue) else {
235- let context = DecodingError . Context (
236- codingPath: [ key] ,
237- debugDescription: " The key \( key) couldn't be converted to a Decimal value "
238- )
239- throw DecodingError . typeMismatch ( type, context)
240- }
241-
242- return decimalValue
243- }
244204}
245205
246206extension HTTPURLResponse {
0 commit comments