aboutsummaryrefslogtreecommitdiff
path: root/src/Manifest.zig
diff options
context:
space:
mode:
authorEric Joldasov <bratishkaerik@getgoogleoff.me>2023-06-15 13:14:16 +0600
committerAndrew Kelley <andrew@ziglang.org>2023-06-19 12:34:42 -0700
commit50339f595aa6ec96760b1cd9f8d0e0bfc3f167fc (patch)
tree9e2b95d8e111e905e00511962dfd32c8e5bb3245 /src/Manifest.zig
parenta6c8ee5231230947c928bbe1c6a39eb6e1bb9c5b (diff)
downloadzig-50339f595aa6ec96760b1cd9f8d0e0bfc3f167fc.tar.gz
zig-50339f595aa6ec96760b1cd9f8d0e0bfc3f167fc.zip
all: zig fmt and rename "@XToY" to "@YFromX"
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
Diffstat (limited to 'src/Manifest.zig')
-rw-r--r--src/Manifest.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Manifest.zig b/src/Manifest.zig
index 068a14942f..0549287e60 100644
--- a/src/Manifest.zig
+++ b/src/Manifest.zig
@@ -39,7 +39,7 @@ pub const multihash_function: MultihashFunction = switch (Hash) {
comptime {
// We avoid unnecessary uleb128 code in hexDigest by asserting here the
// values are small enough to be contained in the one-byte encoding.
- assert(@enumToInt(multihash_function) < 127);
+ assert(@intFromEnum(multihash_function) < 127);
assert(Hash.digest_length < 127);
}
pub const multihash_len = 1 + 1 + Hash.digest_length;
@@ -117,8 +117,8 @@ test hex64 {
pub fn hexDigest(digest: [Hash.digest_length]u8) [multihash_len * 2]u8 {
var result: [multihash_len * 2]u8 = undefined;
- result[0] = hex_charset[@enumToInt(multihash_function) >> 4];
- result[1] = hex_charset[@enumToInt(multihash_function) & 15];
+ result[0] = hex_charset[@intFromEnum(multihash_function) >> 4];
+ result[1] = hex_charset[@intFromEnum(multihash_function) & 15];
result[2] = hex_charset[Hash.digest_length >> 4];
result[3] = hex_charset[Hash.digest_length & 15];
@@ -284,7 +284,7 @@ const Parse = struct {
@errorName(err),
});
};
- if (@intToEnum(MultihashFunction, their_multihash_func) != multihash_function) {
+ if (@enumFromInt(MultihashFunction, their_multihash_func) != multihash_function) {
return fail(p, tok, "unsupported hash function: only sha2-256 is supported", .{});
}
}