diff --git a/pretty.zig b/pretty.zig index f600339..84571c7 100644 --- a/pretty.zig +++ b/pretty.zig @@ -21,14 +21,13 @@ pub const Options = struct { inline_arrays: bool = false, always_show_index: bool = false, + treat_u8_arrays_as_strings: bool = true, inline_structs: bool = false, show_type_names: bool = true, always_show_type_names: bool = false, - treat_u8_arrays_as_strings: bool = true, - theme: Theme = .{}, }; @@ -246,6 +245,27 @@ inline fn formatNull(comptime ctx: Context, run: *const Runtime) !void { run.resetColor(); } +inline fn formatType( + comptime ctx: Context, + run: *const Runtime, + value: type, +) !void { + run.setColor(ctx, .type); + run.setColorRaw(.bold); + try run.write(@typeName(value)); + run.resetColor(); +} + +inline fn formatValue( + comptime ctx: Context, + run: *const Runtime, + value: anytype, +) !void { + run.setColor(ctx, .value); + try run.print("{}", .{value}); + run.resetColor(); +} + inline fn formatOptional( comptime T: type, comptime ctx: Context, @@ -380,27 +400,6 @@ inline fn formatErrorUnion( ); } -inline fn formatType( - comptime ctx: Context, - run: *const Runtime, - value: type, -) !void { - run.setColor(ctx, .type); - run.setColorRaw(.bold); - try run.write(@typeName(value)); - run.resetColor(); -} - -inline fn formatValue( - comptime ctx: Context, - run: *const Runtime, - value: anytype, -) !void { - run.setColor(ctx, .value); - try run.print("{}", .{value}); - run.resetColor(); -} - inline fn formatFn( comptime T: type, comptime ctx: Context,