another fix
This commit is contained in:
@@ -13,7 +13,11 @@ nonisolated(unsafe) let _stderr = stderr
|
||||
|
||||
struct StandardError: TextOutputStream {
|
||||
mutating func write(_ string: String) {
|
||||
for byte in string.utf8 { putc(numericCast(byte), _stderr) }
|
||||
let utf8 = string.utf8
|
||||
utf8.withContiguousStorageIfAvailable { _ = fwrite($0.baseAddress, 1, $0.count, _stderr) } ?? {
|
||||
var buf = Array(utf8);
|
||||
fwrite(&buf, 1, buf.count, _stderr)
|
||||
}()
|
||||
}
|
||||
}
|
||||
nonisolated(unsafe) var standardError: StandardError = StandardError()
|
||||
|
||||
Reference in New Issue
Block a user