Adopted Span and MutableSpan for buffers across the library to adapt to Swift 6.4.

This commit is contained in:
2026-09-18 12:06:21 +02:00
parent 89c8d7a04c
commit 4cb0f8f500
18 changed files with 127 additions and 83 deletions
+2 -2
View File
@@ -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