mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
use constant in formatType
This commit is contained in:
parent
aa07366513
commit
ae44e199a8
@ -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),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user