tools: correct unnecessary uses of 'var'

This commit is contained in:
mlugg 2023-11-14 09:15:15 +00:00
parent d82d327de2
commit 026a8278f8
No known key found for this signature in database
GPG Key ID: 58978E823BDE3EF9
2 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@ pub fn main() !void {
var scanner = std.json.Scanner.initCompleteInput(allocator, spec);
var diagnostics = std.json.Diagnostics{};
scanner.enableDiagnostics(&diagnostics);
var parsed = std.json.parseFromTokenSource(g.CoreRegistry, allocator, &scanner, .{}) catch |err| {
const parsed = std.json.parseFromTokenSource(g.CoreRegistry, allocator, &scanner, .{}) catch |err| {
std.debug.print("line,col: {},{}\n", .{ diagnostics.getLine(), diagnostics.getColumn() });
return err;
};
@ -466,7 +466,7 @@ fn renderBitEnum(
std.debug.assert(@popCount(value) == 1);
var bitpos = std.math.log2_int(u32, value);
const bitpos = std.math.log2_int(u32, value);
if (flags_by_bitpos[bitpos]) |*existing| {
const tag_index = std.mem.indexOfDiff(u8, enumerant.enumerant, enumerants[existing.*].enumerant).?;
const enum_priority = tagPriorityScore(enumerant.enumerant[tag_index..]);

View File

@ -35,7 +35,7 @@ pub fn main() !void {
// As of 5.17.1, the largest table is 23467 bytes.
// 32k should be enough for now.
var buf = try allocator.alloc(u8, 1 << 15);
const buf = try allocator.alloc(u8, 1 << 15);
const linux_dir = try std.fs.openDirAbsolute(linux_path, .{});
try writer.writeAll(