Skip to content

Commit

Permalink
Fix build with zig master 2023-11-21
Browse files Browse the repository at this point in the history
  - Add the paths field to build.zig.zon
  - Use const instead of var when there is no mutation
  • Loading branch information
perillo authored and kubkon committed Nov 21, 2023
1 parent 66ec990 commit 1ed4925
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub fn build(b: *std.Build) void {
.source_file = std.build.FileSource{ .path = "src/yaml.zig" },
});

var yaml_tests = b.addTest(.{
const yaml_tests = b.addTest(.{
.root_source_file = .{ .path = "src/yaml.zig" },
.target = target,
.optimize = optimize,
Expand Down
7 changes: 7 additions & 0 deletions build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
.{
.name = "zig-yaml",
.version = "0.0.1",
.paths = .{
"src",
"build.zig",
"build.zig.zon",
"LICENSE",
"README.md",
},
}
2 changes: 1 addition & 1 deletion src/yaml.zig
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ pub fn stringify(allocator: Allocator, input: anytype, writer: anytype) !void {
var arena = ArenaAllocator.init(allocator);
defer arena.deinit();

var maybe_value = try Value.encode(arena.allocator(), input);
const maybe_value = try Value.encode(arena.allocator(), input);

if (maybe_value) |value| {
// TODO should we output as an explicit doc?
Expand Down

0 comments on commit 1ed4925

Please sign in to comment.