Skip to content

Commit

Permalink
fix mustache.zig for current zig master (0.14.x)
Browse files Browse the repository at this point in the history
  • Loading branch information
renerocksai committed Feb 22, 2025
1 parent 425680d commit 2bd450a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
zig-out/
zig-cache/
.zig-cache/
*.tar.gz
flake.lock.bak
tmp/
Expand Down
4 changes: 2 additions & 2 deletions src/mustache.zig
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ fn fiobjectify(
},
.error_set => return fiobjectify(@as([]const u8, @errorName(value))),
.pointer => |ptr_info| switch (ptr_info.size) {
.One => switch (@typeInfo(ptr_info.child)) {
.one => switch (@typeInfo(ptr_info.child)) {
.array => {
const Slice = []const std.meta.Elem(ptr_info.child);
return fiobjectify(@as(Slice, value));
Expand All @@ -224,7 +224,7 @@ fn fiobjectify(
},
},
// TODO: .Many when there is a sentinel (waiting for https://github.com/ziglang/zig/pull/3972)
.Slice => {
.slice => {
// std.debug.print("new slice\n", .{});
if (ptr_info.child == u8 and std.unicode.utf8ValidateSlice(value)) {
return fio.fiobj_str_new(util.toCharPtr(value), value.len);
Expand Down

0 comments on commit 2bd450a

Please sign in to comment.