Skip to content

Commit

Permalink
Zig: use "const" for variables that are never mutated
Browse files Browse the repository at this point in the history
  • Loading branch information
jedisct1 committed Nov 20, 2023
1 parent f1184e4 commit 6669f95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ pub fn build(b: *std.build.Builder) !void {
else => {},
}

var allocator = heap.page_allocator;
const allocator = heap.page_allocator;
var walker = try src_dir.walk(allocator);
while (try walker.next()) |entry| {
const name = entry.basename;
Expand Down Expand Up @@ -280,7 +280,7 @@ pub fn build(b: *std.build.Builder) !void {
fs.Dir.makePath(cwd, out_bin_path) catch {};
const out_bin_dir = try fs.Dir.openDir(cwd, out_bin_path, .{});
try test_dir.dir.copyFile("run.sh", out_bin_dir, "run.sh", .{});
var allocator = heap.page_allocator;
const allocator = heap.page_allocator;
var walker = try test_dir.walk(allocator);
if (build_tests) {
while (try walker.next()) |entry| {
Expand Down

0 comments on commit 6669f95

Please sign in to comment.