This commit is contained in:
2026-05-19 04:20:04 -04:00
parent 282606dbc4
commit 1aff7e50ee
+4 -9
View File
@@ -9,17 +9,12 @@ struct HtmlElement {
let type:String
}
nonisolated(unsafe) let _stderr = stderr
struct StandardError: TextOutputStream {
mutating func write(_ string: String) {
let utf8 = string.utf8
utf8.withContiguousStorageIfAvailable { _ = fwrite($0.baseAddress, 1, $0.count, _stderr) } ?? {
var buf = Array(utf8);
fwrite(&buf, 1, buf.count, _stderr)
}()
}
mutating func write(_ string: String) {
FileHandle.standardError.write(Foundation.Data(string.utf8))
}
}
nonisolated(unsafe) var standardError: StandardError = StandardError()
extension String {