mirror of
https://github.com/caoer/CodableFirebase.git
synced 2026-04-01 12:23:16 +08:00
remove unused structs
This commit is contained in:
@@ -857,45 +857,3 @@ fileprivate struct OptionalTopLevelWrapper<T> : Codable, Equatable where T : Cod
|
||||
return lhs.value == rhs.value
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate struct FloatNaNPlaceholder : Codable, Equatable {
|
||||
init() {}
|
||||
|
||||
func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.singleValueContainer()
|
||||
try container.encode(Float.nan)
|
||||
}
|
||||
|
||||
init(from decoder: Decoder) throws {
|
||||
let container = try decoder.singleValueContainer()
|
||||
let float = try container.decode(Float.self)
|
||||
if !float.isNaN {
|
||||
throw DecodingError.dataCorrupted(DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Couldn't decode NaN."))
|
||||
}
|
||||
}
|
||||
|
||||
static func ==(_ lhs: FloatNaNPlaceholder, _ rhs: FloatNaNPlaceholder) -> Bool {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
fileprivate struct DoubleNaNPlaceholder : Codable, Equatable {
|
||||
init() {}
|
||||
|
||||
func encode(to encoder: Encoder) throws {
|
||||
var container = encoder.singleValueContainer()
|
||||
try container.encode(Double.nan)
|
||||
}
|
||||
|
||||
init(from decoder: Decoder) throws {
|
||||
let container = try decoder.singleValueContainer()
|
||||
let double = try container.decode(Double.self)
|
||||
if !double.isNaN {
|
||||
throw DecodingError.dataCorrupted(DecodingError.Context(codingPath: decoder.codingPath, debugDescription: "Couldn't decode NaN."))
|
||||
}
|
||||
}
|
||||
|
||||
static func ==(_ lhs: DoubleNaNPlaceholder, _ rhs: DoubleNaNPlaceholder) -> Bool {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user