authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-31 15:48:08 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-31 15:48:08 -07:00
log72fb20a7c5f6f466ced5c3bc731864ee69bc7682
treea966ef94d8253e145e362cb28de42db05ed38234
parent93e7414f96aa2b27f3f0bf72f27967c83e6396ef
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

fmt: add some returns to not trigger the error added in 1a90f8f77b3e01150399d0fca057bc8e109bf7e2


1 files changed, 5 insertions(+), 1 deletions(-)

fmt.zig+5-1
......@@ -495,6 +495,7 @@ fn formatType(value: anytype, comptime fmt: []const u8, options: FormatOptions,
495495 } else {
496496 try format(writer, "@{x}", .{@intFromPtr(&value)});
497497 }
498 return;
498499 },
499500 .@"struct" => |info| {
500501 if (actual_fmt.len != 0) invalidFmtError(fmt, value);
......@@ -530,6 +531,7 @@ fn formatType(value: anytype, comptime fmt: []const u8, options: FormatOptions,
530531 try formatType(@field(value, f.name), "any", options, writer, max_depth - 1);
531532 }
532533 try writer.writeAll(" }");
534 return;
533535 },
534536 .pointer => |ptr_info| switch (ptr_info.size) {
535537 .one => switch (@typeInfo(ptr_info.child)) {
......@@ -547,7 +549,6 @@ fn formatType(value: anytype, comptime fmt: []const u8, options: FormatOptions,
547549 if (actual_fmt[0] == 's' and ptr_info.child == u8) {
548550 return formatBuf(std.mem.span(value), options, writer);
549551 }
550 invalidFmtError(fmt, value);
551552 },
552553 .slice => {
553554 if (actual_fmt.len == 0) {
......@@ -567,6 +568,7 @@ fn formatType(value: anytype, comptime fmt: []const u8, options: FormatOptions,
567568 }
568569 }
569570 try writer.writeAll(" }");
571 return;
570572 },
571573 },
572574 .array => |info| {
......@@ -587,6 +589,7 @@ fn formatType(value: anytype, comptime fmt: []const u8, options: FormatOptions,
587589 }
588590 }
589591 try writer.writeAll(" }");
592 return;
590593 },
591594 .vector => |info| {
592595 if (max_depth == 0) {
......@@ -601,6 +604,7 @@ fn formatType(value: anytype, comptime fmt: []const u8, options: FormatOptions,
601604 }
602605 }
603606 try writer.writeAll(" }");
607 return;
604608 },
605609 .@"fn" => @compileError("unable to format function body type, use '*const " ++ @typeName(T) ++ "' for a function pointer type"),
606610 .type => {