Another
This commit is contained in:
@@ -9,17 +9,12 @@ struct HtmlElement {
|
|||||||
let type:String
|
let type:String
|
||||||
}
|
}
|
||||||
|
|
||||||
nonisolated(unsafe) let _stderr = stderr
|
|
||||||
|
|
||||||
struct StandardError: TextOutputStream {
|
struct StandardError: TextOutputStream {
|
||||||
mutating func write(_ string: String) {
|
mutating func write(_ string: String) {
|
||||||
let utf8 = string.utf8
|
FileHandle.standardError.write(Foundation.Data(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()
|
nonisolated(unsafe) var standardError: StandardError = StandardError()
|
||||||
|
|
||||||
extension String {
|
extension String {
|
||||||
|
|||||||
Reference in New Issue
Block a user