blob: fb986beab6977332179c6c33db773775e2f94ac6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
fileprivate struct FfiConverterFloat: FfiConverterPrimitive {
typealias FfiType = Float
typealias SwiftType = Float
public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Float {
return try lift(readFloat(&buf))
}
public static func write(_ value: Float, into buf: inout [UInt8]) {
writeFloat(&buf, lower(value))
}
}
|