From 71aa5e050cc52579e1e1557acf05e49cb156c68e Mon Sep 17 00:00:00 2001 From: Altagos Date: Tue, 27 Jan 2026 14:20:33 +0100 Subject: [PATCH] runtime is always const --- pretty.zig | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pretty.zig b/pretty.zig index e6ad4c6..b43e469 100644 --- a/pretty.zig +++ b/pretty.zig @@ -204,7 +204,7 @@ const InnerFmtOptions = struct { fn innerFmt( comptime T: type, comptime ctx: Context, - run: *Runtime, + run: *const Runtime, value: T, comptime opts: InnerFmtOptions, ) error{WriteFailed}!void { @@ -263,7 +263,7 @@ fn innerFmt( inline fn printType( comptime T: type, comptime ctx: Context, - run: *Runtime, + run: *const Runtime, value: T, ) error{WriteFailed}!void { const active_type = comptime std.meta.activeTag(@typeInfo(T)); @@ -342,7 +342,7 @@ inline fn formatValue( inline fn formatOptional( comptime T: type, comptime ctx: Context, - run: *Runtime, + run: *const Runtime, value: ?T, ) !void { return if (value) |val| @@ -355,7 +355,7 @@ inline fn formatStruct( comptime T: type, comptime ctx: Context, comptime st: Type.Struct, - run: *Runtime, + run: *const Runtime, value: T, ) !void { const next_ctx = Context{ @@ -399,7 +399,7 @@ inline fn formatStruct( inline fn formatUnion( comptime T: type, comptime ctx: Context, - run: *Runtime, + run: *const Runtime, value: T, ) !void { switch (value) { @@ -410,7 +410,7 @@ inline fn formatUnion( inline fn formatArray( comptime ctx: Context, comptime arr: Type.Array, - run: *Runtime, + run: *const Runtime, value: anytype, ) !void { const next_ctx = Context{ @@ -453,7 +453,7 @@ inline fn formatArray( inline fn formatVector( comptime ctx: Context, comptime vec: Type.Vector, - run: *Runtime, + run: *const Runtime, value: @Vector(vec.len, vec.child), ) !void { run.setColor(ctx, .dim); @@ -478,7 +478,7 @@ inline fn formatVector( inline fn formatPtrOne( comptime ctx: Context, comptime ptr: Type.Pointer, - run: *Runtime, + run: *const Runtime, value: anytype, ) !void { const is_string = switch (@typeInfo(ptr.child)) { @@ -493,7 +493,7 @@ inline fn formatPtrOne( inline fn formatPtrSlice( comptime ctx: Context, comptime ptr: Type.Pointer, - run: *Runtime, + run: *const Runtime, value: anytype, ) !void { if (ptr.child == u8 and ctx.options.ptr_slice_u8_as_string) @@ -536,7 +536,7 @@ inline fn formatPtrSlice( inline fn formatPtrMany( comptime ctx: Context, comptime ptr: Type.Pointer, - run: *Runtime, + run: *const Runtime, value: anytype, ) !void { _ = ptr; @@ -548,7 +548,7 @@ inline fn formatPtrMany( inline fn formatString( comptime ctx: Context, - run: *Runtime, + run: *const Runtime, value: anytype, ) !void { run.setColor(ctx, .string); @@ -571,7 +571,7 @@ inline fn formatErrorSet( inline fn formatErrorUnion( comptime ctx: Context, - run: *Runtime, + run: *const Runtime, value: anytype, ) !void { const val = value catch |err| return formatErrorSet(ctx, run, err); -- 2.51.2