Skip to content

Commit

Permalink
update to latest zig changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kubkon committed Jan 17, 2025
1 parent 3be4efc commit cacb3e8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/yaml.zig
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ pub const Value = union(enum) {
.array => return encode(arena, &input),

.pointer => |info| switch (info.size) {
.One => switch (@typeInfo(info.child)) {
.one => switch (@typeInfo(info.child)) {
.array => |child_info| {
const Slice = []const child_info.child;
return encode(arena, @as(Slice, input));
Expand All @@ -276,7 +276,7 @@ pub const Value = union(enum) {
@compileError("Unhandled type: {s}" ++ @typeName(info.child));
},
},
.Slice => {
.slice => {
if (info.child == u8) {
return Value{ .string = try arena.dupe(u8, input) };
}
Expand Down Expand Up @@ -376,7 +376,7 @@ pub const Yaml = struct {
},
.pointer => |info| {
switch (info.size) {
.Slice => {
.slice => {
var parsed = try self.arena.allocator().alloc(info.child, self.docs.items.len);
for (self.docs.items, 0..) |doc, i| {
parsed[i] = try self.parseValue(info.child, doc);
Expand Down Expand Up @@ -473,7 +473,7 @@ pub const Yaml = struct {
const arena = self.arena.allocator();

switch (ptr_info.size) {
.Slice => {
.slice => {
if (ptr_info.child == u8) {
return value.asString();
}
Expand Down

0 comments on commit cacb3e8

Please sign in to comment.