mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 04:49:06 +00:00
we should not crash here
This commit is contained in:
11
src/fd.zig
11
src/fd.zig
@@ -303,11 +303,6 @@ pub const FDImpl = packed struct {
|
||||
}
|
||||
|
||||
pub fn format(this: FDImpl, comptime fmt: []const u8, _: std.fmt.FormatOptions, writer: anytype) !void {
|
||||
if (fmt.len == 1 and fmt[0] == 'd') {
|
||||
try writer.print("{d}", .{this.system()});
|
||||
return;
|
||||
}
|
||||
|
||||
if (fmt.len != 0) {
|
||||
@compileError("invalid format string for FDImpl.format. must be either '' or 'd'");
|
||||
}
|
||||
@@ -316,6 +311,12 @@ pub const FDImpl = packed struct {
|
||||
try writer.writeAll("[invalid_fd]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (fmt.len == 1 and fmt[0] == 'd') {
|
||||
try writer.print("{d}", .{this.system()});
|
||||
return;
|
||||
}
|
||||
|
||||
switch (env.os) {
|
||||
else => {
|
||||
const fd = this.system();
|
||||
|
||||
Reference in New Issue
Block a user