diff options
| author | 2024-03-27 21:52:02 -0400 | |
|---|---|---|
| committer | 2024-03-27 21:52:02 -0400 | |
| commit | 4ce891a8ce5336da39180964792110e131756cdd (patch) | |
| tree | b4ff0180157bb49e15d2c36f2cf0cdaab1a24535 /src/CaseData.zig | |
| parent | Friendly general category methods (diff) | |
| download | zg-4ce891a8ce5336da39180964792110e131756cdd.tar.gz zg-4ce891a8ce5336da39180964792110e131756cdd.tar.xz zg-4ce891a8ce5336da39180964792110e131756cdd.zip | |
ScriptsData and made all Datas const
Diffstat (limited to 'src/CaseData.zig')
| -rw-r--r-- | src/CaseData.zig | 10 |
1 files changed, 5 insertions, 5 deletions
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 { | |||
| 77 | return self; | 77 | return self; |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | pub fn deinit(self: *Self) void { | 80 | pub fn deinit(self: *const Self) void { |
| 81 | self.allocator.free(self.case_map); | 81 | self.allocator.free(self.case_map); |
| 82 | self.allocator.free(self.prop_s1); | 82 | self.allocator.free(self.prop_s1); |
| 83 | self.allocator.free(self.prop_s2); | 83 | self.allocator.free(self.prop_s2); |
| @@ -103,7 +103,7 @@ pub fn isUpperStr(self: Self, str: []const u8) bool { | |||
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | test "isUpperStr" { | 105 | test "isUpperStr" { |
| 106 | var cd = try init(testing.allocator); | 106 | const cd = try init(testing.allocator); |
| 107 | defer cd.deinit(); | 107 | defer cd.deinit(); |
| 108 | 108 | ||
| 109 | try testing.expect(cd.isUpperStr("HELLO, WORLD 2112!")); | 109 | try testing.expect(cd.isUpperStr("HELLO, WORLD 2112!")); |
| @@ -138,7 +138,7 @@ pub fn toUpperStr( | |||
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | test "toUpperStr" { | 140 | test "toUpperStr" { |
| 141 | var cd = try init(testing.allocator); | 141 | const cd = try init(testing.allocator); |
| 142 | defer cd.deinit(); | 142 | defer cd.deinit(); |
| 143 | 143 | ||
| 144 | const uppered = try cd.toUpperStr(testing.allocator, "Hello, World 2112!"); | 144 | const uppered = try cd.toUpperStr(testing.allocator, "Hello, World 2112!"); |
| @@ -161,7 +161,7 @@ pub fn isLowerStr(self: Self, str: []const u8) bool { | |||
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | test "isLowerStr" { | 163 | test "isLowerStr" { |
| 164 | var cd = try init(testing.allocator); | 164 | const cd = try init(testing.allocator); |
| 165 | defer cd.deinit(); | 165 | defer cd.deinit(); |
| 166 | 166 | ||
| 167 | try testing.expect(cd.isLowerStr("hello, world 2112!")); | 167 | try testing.expect(cd.isLowerStr("hello, world 2112!")); |
| @@ -196,7 +196,7 @@ pub fn toLowerStr( | |||
| 196 | } | 196 | } |
| 197 | 197 | ||
| 198 | test "toLowerStr" { | 198 | test "toLowerStr" { |
| 199 | var cd = try init(testing.allocator); | 199 | const cd = try init(testing.allocator); |
| 200 | defer cd.deinit(); | 200 | defer cd.deinit(); |
| 201 | 201 | ||
| 202 | const lowered = try cd.toLowerStr(testing.allocator, "Hello, World 2112!"); | 202 | const lowered = try cd.toLowerStr(testing.allocator, "Hello, World 2112!"); |