authorgravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-04-07 20:41:46-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-05-25 13:48:43-04:00
logc88ece3679863cd55895bb9696d304c8d8754a4a
treec58865ef88d1519a0d4780c2d5f5a2156eab400c
parentdfb53beb52689519d395541d62519ff01c3d7785

Remove error union from CacheHash.final


1 files changed, 4 insertions(+), 3 deletions(-)

lib/std/cache_hash.zig+4-3
...@@ -242,7 +242,7 @@ pub const CacheHash = struct {...@@ -242,7 +242,7 @@ pub const CacheHash = struct {
242 return null;242 return null;
243 }243 }
244244
245 return try self.final();245 return self.final();
246 }246 }
247247
248 pub fn populate_file_hash(self: *@This(), cache_hash_file: *File) !void {248 pub fn populate_file_hash(self: *@This(), cache_hash_file: *File) !void {
...@@ -259,7 +259,8 @@ pub const CacheHash = struct {...@@ -259,7 +259,8 @@ pub const CacheHash = struct {
259 self.blake3.update(&cache_hash_file.bin_digest);259 self.blake3.update(&cache_hash_file.bin_digest);
260 }260 }
261261
262 pub fn final(self: *@This()) ![BASE64_DIGEST_LEN]u8 {262 /// Returns a base64 encoded hash of the inputs.
263 pub fn final(self: *@This()) [BASE64_DIGEST_LEN]u8 {
263 debug.assert(self.manifest_file != null);264 debug.assert(self.manifest_file != null);
264265
265 var bin_digest: [BIN_DIGEST_LEN]u8 = undefined;266 var bin_digest: [BIN_DIGEST_LEN]u8 = undefined;
...@@ -340,7 +341,7 @@ test "cache file and the recall it" {...@@ -340,7 +341,7 @@ test "cache file and the recall it" {
340 // There should be nothing in the cache341 // There should be nothing in the cache
341 debug.assert((try ch.hit()) == null);342 debug.assert((try ch.hit()) == null);
342343
343 digest1 = try ch.final();344 digest1 = ch.final();
344 }345 }
345 {346 {
346 var ch = try CacheHash.init(testing.allocator, temp_manifest_dir);347 var ch = try CacheHash.init(testing.allocator, temp_manifest_dir);