zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit ae44e199a8caa8d26db04b81867acb81d54ba217 (tree)
parent aa0736651346304199cebc8ea97bebbcde0491e3
Author: orvit <cdavis4short@gmail.com>
Date:   Tue, 21 May 2024 09:41:49 -0500

use constant in formatType


Diffstat:
Mlib/std/fmt.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig @@ -480,7 +480,7 @@ pub fn formatType( ) @TypeOf(writer).Error!void { const T = @TypeOf(value); const actual_fmt = comptime if (std.mem.eql(u8, fmt, ANY)) - defaultSpec(@TypeOf(value)) + defaultSpec(T) else if (fmt.len != 0 and (fmt[0] == '?' or fmt[0] == '!')) switch (@typeInfo(T)) { .Optional, .ErrorUnion => fmt, else => stripOptionalOrErrorUnionSpec(fmt),