From 5dd81ad0cd42027f77168ef786d5c743b4b482d7 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 20 Nov 2023 18:58:50 +0100 Subject: [PATCH] Zig: use "const" for variables that are never mutated --- build.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.zig b/build.zig index 6296b4c5..ad2c50f2 100644 --- a/build.zig +++ b/build.zig @@ -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; @@ -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| {