From 4ce891a8ce5336da39180964792110e131756cdd Mon Sep 17 00:00:00 2001 From: Jose Colon Rodriguez Date: Wed, 27 Mar 2024 21:52:02 -0400 Subject: ScriptsData and made all Datas const --- src/CaseData.zig | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/CaseData.zig') diff --git a/src/CaseData.zig b/src/CaseData.zig index 4f06636..c9ccc1e 100644 --- a/src/CaseData.zig +++ b/src/CaseData.zig @@ -77,7 +77,7 @@ pub fn init(allocator: mem.Allocator) !Self { return self; } -pub fn deinit(self: *Self) void { +pub fn deinit(self: *const Self) void { self.allocator.free(self.case_map); self.allocator.free(self.prop_s1); self.allocator.free(self.prop_s2); @@ -103,7 +103,7 @@ pub fn isUpperStr(self: Self, str: []const u8) bool { } test "isUpperStr" { - var cd = try init(testing.allocator); + const cd = try init(testing.allocator); defer cd.deinit(); try testing.expect(cd.isUpperStr("HELLO, WORLD 2112!")); @@ -138,7 +138,7 @@ pub fn toUpperStr( } test "toUpperStr" { - var cd = try init(testing.allocator); + const cd = try init(testing.allocator); defer cd.deinit(); const uppered = try cd.toUpperStr(testing.allocator, "Hello, World 2112!"); @@ -161,7 +161,7 @@ pub fn isLowerStr(self: Self, str: []const u8) bool { } test "isLowerStr" { - var cd = try init(testing.allocator); + const cd = try init(testing.allocator); defer cd.deinit(); try testing.expect(cd.isLowerStr("hello, world 2112!")); @@ -196,7 +196,7 @@ pub fn toLowerStr( } test "toLowerStr" { - var cd = try init(testing.allocator); + const cd = try init(testing.allocator); defer cd.deinit(); const lowered = try cd.toLowerStr(testing.allocator, "Hello, World 2112!"); -- cgit v1.2.3