authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-31 21:08:56 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-31 21:08:56 -07:00
logc2ff3f0ca598c280c709016c5fb45f7c1dab1d23
tree84d39618f54f36ea87672a9742d31b3ee2ae1a0d
parent49e67c0ca9713d8a4617735d6e43d7993dd139df
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

update to zig 0.15.2


1 files changed, 12 insertions(+), 21 deletions(-)

yaml.zig+12-21
...@@ -54,30 +54,27 @@ pub const Item = union(enum) {...@@ -54,30 +54,27 @@ pub const Item = union(enum) {
54 }54 }
55 }55 }
5656
57 pub fn format(self: Item, comptime fmt: string, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void {57 pub fn format(self: Item, writer: *std.Io.Writer) !void {
58 _ = fmt;
59 _ = options;
60
61 try writer.writeAll("Item{");58 try writer.writeAll("Item{");
62 switch (self) {59 switch (self) {
63 .event => {60 .event => {
64 try std.fmt.format(writer, "event {}", .{self.event});61 try writer.print("event {}", .{self.event});
65 },62 },
66 .kv, .stream => {63 .kv, .stream => {
67 unreachable;64 unreachable;
68 },65 },
69 .mapping => {66 .mapping => {
70 try std.fmt.format(writer, "{}", .{self.mapping});67 try writer.print("{f}", .{self.mapping});
71 },68 },
72 .sequence => {69 .sequence => {
73 try writer.writeAll("[ ");70 try writer.writeAll("[ ");
74 for (self.sequence) |it| {71 for (self.sequence) |it| {
75 try std.fmt.format(writer, "{}, ", .{it});72 try writer.print("{f}, ", .{it});
76 }73 }
77 try writer.writeAll("]");74 try writer.writeAll("]");
78 },75 },
79 .string => {76 .string => {
80 try std.fmt.format(writer, "{s}", .{self.string});77 try writer.print("{s}", .{self.string});
81 },78 },
82 }79 }
83 try writer.writeAll("}");80 try writer.writeAll("}");
...@@ -114,22 +111,19 @@ pub const Value = union(enum) {...@@ -114,22 +111,19 @@ pub const Value = union(enum) {
114 }111 }
115 }112 }
116113
117 pub fn format(self: Value, comptime fmt: string, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void {114 pub fn format(self: Value, writer: *std.Io.Writer) !void {
118 _ = fmt;
119 _ = options;
120
121 try writer.writeAll("Value{");115 try writer.writeAll("Value{");
122 switch (self) {116 switch (self) {
123 .string => {117 .string => {
124 try std.fmt.format(writer, "{s}", .{self.string});118 try writer.print("{s}", .{self.string});
125 },119 },
126 .mapping => {120 .mapping => {
127 try std.fmt.format(writer, "{}", .{self.mapping});121 try writer.print("{f}", .{self.mapping});
128 },122 },
129 .sequence => {123 .sequence => {
130 try writer.writeAll("[ ");124 try writer.writeAll("[ ");
131 for (self.sequence) |it| {125 for (self.sequence) |it| {
132 try std.fmt.format(writer, "{}, ", .{it});126 try writer.print("{f}, ", .{it});
133 }127 }
134 try writer.writeAll("]");128 try writer.writeAll("]");
135 },129 },
...@@ -188,14 +182,11 @@ pub const Mapping = struct {...@@ -188,14 +182,11 @@ pub const Mapping = struct {
188 return self.getT(k, .mapping);182 return self.getT(k, .mapping);
189 }183 }
190184
191 pub fn format(self: Mapping, comptime fmt: string, options: std.fmt.FormatOptions, writer: anytype) @TypeOf(writer).Error!void {185 pub fn format(self: Mapping, writer: *std.Io.Writer) !void {
192 _ = fmt;
193 _ = options;
194
195 try writer.writeAll("{ ");186 try writer.writeAll("{ ");
196 for (self.items) |it| {187 for (self.items) |it| {
197 try std.fmt.format(writer, "{s}: ", .{it.key});188 try writer.print("{s}: ", .{it.key});
198 try std.fmt.format(writer, "{}, ", .{it.value});189 try writer.print("{f}, ", .{it.value});
199 }190 }
200 try writer.writeAll("}");191 try writer.writeAll("}");
201 }192 }