diff options
| author | Matthew Lugg <mlugg@mlugg.co.uk> | 2023-11-19 16:19:06 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-19 16:19:06 +0000 |
| commit | 6b1a823b2b30d9318c9877dbdbd3d02fa939fba0 (patch) | |
| tree | 6e5afdad2397ac7224119811583d19107b6e517a /lib/std/Build/Cache/DepTokenizer.zig | |
| parent | 325e0f5f0e8a9ce2540ec3ec5b7cbbecac15257a (diff) | |
| parent | 9cf6c1ad11bb5f0247ff3458cba5f3bd156d1fb9 (diff) | |
| download | zig-6b1a823b2b30d9318c9877dbdbd3d02fa939fba0.tar.gz zig-6b1a823b2b30d9318c9877dbdbd3d02fa939fba0.zip | |
Merge pull request #18017 from mlugg/var-never-mutated
compiler: add error for unnecessary use of 'var'
Diffstat (limited to 'lib/std/Build/Cache/DepTokenizer.zig')
| -rw-r--r-- | lib/std/Build/Cache/DepTokenizer.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/Build/Cache/DepTokenizer.zig b/lib/std/Build/Cache/DepTokenizer.zig index 0e5224edc0..9edc53cbb2 100644 --- a/lib/std/Build/Cache/DepTokenizer.zig +++ b/lib/std/Build/Cache/DepTokenizer.zig @@ -950,7 +950,7 @@ fn printSection(out: anytype, label: []const u8, bytes: []const u8) !void { fn printLabel(out: anytype, label: []const u8, bytes: []const u8) !void { var buf: [80]u8 = undefined; - var text = try std.fmt.bufPrint(buf[0..], "{s} {d} bytes ", .{ label, bytes.len }); + const text = try std.fmt.bufPrint(buf[0..], "{s} {d} bytes ", .{ label, bytes.len }); try out.writeAll(text); var i: usize = text.len; const end = 79; @@ -983,12 +983,12 @@ fn hexDump(out: anytype, bytes: []const u8) !void { try printDecValue(out, offset, 8); try out.writeAll(":"); try out.writeAll(" "); - var end1 = @min(offset + n, offset + 8); + const end1 = @min(offset + n, offset + 8); for (bytes[offset..end1]) |b| { try out.writeAll(" "); try printHexValue(out, b, 2); } - var end2 = offset + n; + const end2 = offset + n; if (end2 > end1) { try out.writeAll(" "); for (bytes[end1..end2]) |b| { |
