Skip to content

Conversation

benburkert
Copy link

Add zon.Formatter & zon.fmt for pretty printing:

const Thing = struct {
    num: u32,
    msg: []const u8,
    sub: struct {
	mybool: bool,
    },
};

const thing: Thing = .{
    .num = 927,
    .msg = "hello",
    .sub = .{ .mybool = true },
};

std.debug.print("{f}", .{std.zon.fmt(thing, .{})});

// outputs:
//
// .{
//     .num = 927,
//     .msg = "hello",
//     .sub = .{ .mybool = true },
// }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant