| author | |
| committer | |
| log | 2352c1b2b2a15b3ce60914adcbc9567184efac59 |
| tree | 2bd0241be806d641b0bdb105db4e84ff78146242 |
| parent | 56919ce43dcc3ecee22eb7d51e90dcef0ce7f4bb |
1 files changed, 3 insertions(+), 0 deletions(-)
src/lib.zig+3| ... | ... | @@ -88,6 +88,9 @@ fn do(alloc: *std.mem.Allocator, writer: anytype, comptime value: astgen.Value, |
| 88 | 88 | try writer.print("{d}", .{x}); |
| 89 | 89 | return; |
| 90 | 90 | } |
| 91 | if (comptime std.meta.trait.hasFn("format")(TO)) { | |
| 92 | return std.fmt.format(writer, "{}", .{x}); | |
| 93 | } | |
| 91 | 94 | if (comptime std.meta.trait.hasFn("toString")(TO)) { |
| 92 | 95 | try writer.writeAll(try x.toString(alloc)); |
| 93 | 96 | return; |