| ... | ... | @@ -18,17 +18,12 @@ pub const File = struct { |
| 18 | 18 | path: ?[]const u8, |
| 19 | 19 | stat: fs.File.Stat, |
| 20 | 20 | bin_digest: [BIN_DIGEST_LEN]u8, |
| 21 | | contents: ?[]const u8, |
| 22 | 21 | |
| 23 | 22 | pub fn deinit(self: *@This(), alloc: *Allocator) void { |
| 24 | 23 | if (self.path) |owned_slice| { |
| 25 | 24 | alloc.free(owned_slice); |
| 26 | 25 | self.path = null; |
| 27 | 26 | } |
| 28 | | if (self.contents) |owned_slice| { |
| 29 | | alloc.free(owned_slice); |
| 30 | | self.contents = null; |
| 31 | | } |
| 32 | 27 | } |
| 33 | 28 | }; |
| 34 | 29 | |
| ... | ... | @@ -232,7 +227,7 @@ pub const CacheHash = struct { |
| 232 | 227 | if (idx < input_file_count or idx == 0) { |
| 233 | 228 | self.manifest_dirty = true; |
| 234 | 229 | while (idx < input_file_count) : (idx += 1) { |
| 235 | | var cache_hash_file = self.files.ptrAt(idx); |
| 230 | var cache_hash_file = &self.files.items[idx]; |
| 236 | 231 | self.populate_file_hash(cache_hash_file) catch |err| { |
| 237 | 232 | self.manifest_file.?.close(); |
| 238 | 233 | self.manifest_file = null; |
| ... | ... | @@ -318,7 +313,7 @@ fn hash_file(alloc: *Allocator, bin_digest: []u8, handle: *const fs.File) !void |
| 318 | 313 | blake3.final(bin_digest); |
| 319 | 314 | } |
| 320 | 315 | |
| 321 | | test "cache file and the recall it" { |
| 316 | test "cache file and then recall it" { |
| 322 | 317 | const cwd = fs.cwd(); |
| 323 | 318 | |
| 324 | 319 | const temp_file = "test.txt"; |