diff --git a/build.zig b/build.zig index 4608d07..3fd1247 100644 --- a/build.zig +++ b/build.zig @@ -25,7 +25,7 @@ pub fn build(b: *std.build.Builder) void { const test_step = b.step("test", "Run all the tests"); test_step.dependOn(b.getInstallStep()); - var tests = b.addTest(.{ + const tests = b.addTest(.{ .root_source_file = .{ .path = "tests/tests.zig" }, .target = target, }); diff --git a/build.zig.zon b/build.zig.zon index c20a216..9303fd2 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -1,6 +1,6 @@ .{ .name = "lspmm-zig", .version = "0.1.0", - + .paths = .{"build.zig", "build.zig.zon", "src"}, .dependencies = .{}, } diff --git a/src/main.zig b/src/main.zig index 3687e6b..115b729 100644 --- a/src/main.zig +++ b/src/main.zig @@ -91,7 +91,7 @@ fn isOrActuallyEnum(ort: MetaModel.OrType) bool { fn isTypeNull(typ: MetaModel.Type) bool { if (typ != .@"or") return false; - var ort = typ.@"or"; + const ort = typ.@"or"; return (ort.items.len == 2 and ort.items[1] == .base and ort.items[1].base.name == .null) or (ort.items[ort.items.len - 1] == .base and ort.items[ort.items.len - 1].base.name == .null); } @@ -163,7 +163,7 @@ fn writeType(meta_model: MetaModel, writer: anytype, typ: MetaModel.Type) @TypeO } try writer.writeByte('}'); } else { - var has_null = ort.items[ort.items.len - 1] == .base and ort.items[ort.items.len - 1].base.name == .null; + const has_null = ort.items[ort.items.len - 1] == .base and ort.items[ort.items.len - 1].base.name == .null; if (has_null) try writer.writeByte('?');