Commit ae44e199a8

orvit <cdavis4short@gmail.com>
2024-05-21 16:41:49
use constant in formatType
1 parent aa07366
Changed files (1)
lib
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),