mirror of
https://github.com/zigzap/zap.git
synced 2025-10-21 15:44:10 +00:00
Upgrade to latest zig master (replace std.io with std.Io)
This commit is contained in:
parent
76679f308c
commit
de9f49e4a9
3 changed files with 4 additions and 4 deletions
|
@ -354,12 +354,12 @@ pub fn _internal_sendError(self: *const Request, err: anyerror, err_trace: ?std.
|
||||||
// TODO: let's hope 20k is enough. Maybe just really allocate here
|
// TODO: let's hope 20k is enough. Maybe just really allocate here
|
||||||
self.h.*.status = errorcode_num;
|
self.h.*.status = errorcode_num;
|
||||||
var buf: [20 * 1024]u8 = undefined;
|
var buf: [20 * 1024]u8 = undefined;
|
||||||
var writer = std.io.Writer.fixed(&buf);
|
var writer = std.Io.Writer.fixed(&buf);
|
||||||
try writer.print("ERROR: {any}\n\n", .{err});
|
try writer.print("ERROR: {any}\n\n", .{err});
|
||||||
|
|
||||||
if (err_trace) |trace| {
|
if (err_trace) |trace| {
|
||||||
const debugInfo = try std.debug.getSelfDebugInfo();
|
const debugInfo = try std.debug.getSelfDebugInfo();
|
||||||
const ttyConfig: std.io.tty.Config = .no_color;
|
const ttyConfig: std.Io.tty.Config = .no_color;
|
||||||
try std.debug.writeStackTrace(trace, &writer, debugInfo, ttyConfig);
|
try std.debug.writeStackTrace(trace, &writer, debugInfo, ttyConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ fn makeRequest(a: std.mem.Allocator, url: []const u8) !void {
|
||||||
var http_client: std.http.Client = .{ .allocator = a };
|
var http_client: std.http.Client = .{ .allocator = a };
|
||||||
defer http_client.deinit();
|
defer http_client.deinit();
|
||||||
|
|
||||||
var response_writer = std.io.Writer.Allocating.init(a);
|
var response_writer = std.Io.Writer.Allocating.init(a);
|
||||||
defer response_writer.deinit();
|
defer response_writer.deinit();
|
||||||
|
|
||||||
_ = try http_client.fetch(.{
|
_ = try http_client.fetch(.{
|
||||||
|
|
|
@ -77,7 +77,7 @@ pub fn stringifyBuf(
|
||||||
value: anytype,
|
value: anytype,
|
||||||
options: std.json.Stringify.Options,
|
options: std.json.Stringify.Options,
|
||||||
) ![]const u8 {
|
) ![]const u8 {
|
||||||
var w: std.io.Writer = .fixed(buffer);
|
var w: std.Io.Writer = .fixed(buffer);
|
||||||
if (std.json.Stringify.value(value, options, &w)) {
|
if (std.json.Stringify.value(value, options, &w)) {
|
||||||
return w.buffered();
|
return w.buffered();
|
||||||
} else |err| { // error
|
} else |err| { // error
|
||||||
|
|
Loading…
Add table
Reference in a new issue