authorgravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-04-30 19:54:40-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-05-25 13:48:43-04:00
logbe69e8e871d26973c644cfad5225ae9e337179c9
treed5ebab60fa48be4ff42705731de16d561e80c16d
parente6a37ed94193faf6450a0888c23168a83e914955

Remove non-null assertion in `CacheHash.release()`

People using the API as intended would never trigger this assertion anyway, but if someone has a non standard use case, I see no reason to make the program panic.

1 files changed, 5 insertions(+), 5 deletions(-)

lib/std/cache_hash.zig+5-5
......@@ -349,14 +349,14 @@ pub const CacheHash = struct {
349349 /// Writing to the manifest file is the only way that this file can return an
350350 /// error.
351351 pub fn release(self: *@This()) !void {
352 debug.assert(self.manifest_file != null);
352 if (self.manifest_file) |file| {
353 if (self.manifest_dirty) {
354 try self.write_manifest();
355 }
353356
354 if (self.manifest_dirty) {
355 try self.write_manifest();
357 file.close();
356358 }
357359
358 self.manifest_file.?.close();
359
360360 for (self.files.items) |*file| {
361361 file.deinit(self.alloc);
362362 }