File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -184,9 +184,6 @@ internal extension TLVEncoder.Encoder {
184184
185185 func boxEncodable < T: Encodable > ( _ value: T ) throws -> Data {
186186
187- // should not call this function
188- assert ( value as? TLVRawEncodable == nil , " Should not call this method for native types " )
189-
190187 if let data = value as? Data {
191188 return data
192189 } else if let uuid = value as? UUID {
@@ -502,9 +499,9 @@ internal final class TLVSingleValueEncodingContainer: SingleValueEncodingContain
502499
503500 func encode( _ value: String ) throws { write ( encoder. box ( value) ) }
504501
505- func encode( _ value: Double ) throws { write ( encoder. boxNumeric ( value. bitPattern ) ) }
502+ func encode( _ value: Double ) throws { write ( encoder. boxDouble ( value) ) }
506503
507- func encode( _ value: Float ) throws { write ( encoder. boxNumeric ( value. bitPattern ) ) }
504+ func encode( _ value: Float ) throws { write ( encoder. boxFloat ( value) ) }
508505
509506 func encode( _ value: Int ) throws { write ( encoder. boxNumeric ( Int32 ( value) ) ) }
510507
You can’t perform that action at this time.
0 commit comments