Adopted Span and MutableSpan for buffers across the library to adapt to Swift 6.4.
This commit is contained in:
@@ -126,9 +126,9 @@ extension JSON {
|
||||
reader.read = { userdata, buffer, size in
|
||||
guard let userdata, let buffer else { return -1 }
|
||||
let file = Unmanaged<File.Handle>.fromOpaque(userdata).takeUnretainedValue()
|
||||
let destination = UnsafeMutableRawBufferPointer(start: buffer, count: Int(size))
|
||||
var destination = UnsafeMutableBufferPointer(start: buffer, count: Int(size)).mutableSpan
|
||||
do {
|
||||
let count = try file.read(into: destination)
|
||||
let count = try file.read(into: &destination)
|
||||
return count > 0 ? Int32(count) : -1
|
||||
} catch {
|
||||
return -1
|
||||
|
||||
Reference in New Issue
Block a user