Remove additional null termination

[`std.builtin.Type.StructField.name`](https://ziglang.org/documentation/master/std/#std.builtin.Type.StructField) has type `[:0]const u8`
This commit is contained in:
rpkak
2025-04-02 09:09:34 +02:00
parent 355e4828dd
commit 208f0612de

View File

@@ -1496,8 +1496,7 @@ fn Renderer(comptime WriterType: type) type {
\\pub fn load({[params]s}) Self {{
\\ var self: Self = .{{ .dispatch = .{{}} }};
\\ inline for (std.meta.fields(Dispatch)) |field| {{
\\ const name: [*:0]const u8 = @ptrCast(field.name ++ "\x00");
\\ const cmd_ptr = loader({[first_arg]s}, name) orelse undefined;
\\ const cmd_ptr = loader({[first_arg]s}, field.name.ptr) orelse undefined;
\\ @field(self.dispatch, field.name) = @ptrCast(cmd_ptr);
\\ }}
\\ return self;