mirror of
https://github.com/ziglang/zig.git
synced 2024-11-14 16:13:24 +00:00
tools: correct unnecessary uses of 'var'
This commit is contained in:
parent
d82d327de2
commit
026a8278f8
@ -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..]);
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user