diff options
| author | Veikka Tuominen <git@vexu.eu> | 2022-12-18 19:33:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-18 19:33:15 +0200 |
| commit | 40ed6ae8469fd599f0524d294f38365c3bb8a825 (patch) | |
| tree | 6e37bbb58fef1ca3aae06e65e179dfa017cb7929 /lib/std/crypto/phc_encoding.zig | |
| parent | e9e804edc899d8392c9f93a19b92be603c26df79 (diff) | |
| parent | 2a5e1426aa9469fadb78e837d0100d689213b034 (diff) | |
| download | zig-40ed6ae8469fd599f0524d294f38365c3bb8a825.tar.gz zig-40ed6ae8469fd599f0524d294f38365c3bb8a825.zip | |
Merge pull request #13930 from r00ster91/renamings
std.builtin: renamings
Diffstat (limited to 'lib/std/crypto/phc_encoding.zig')
| -rw-r--r-- | lib/std/crypto/phc_encoding.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/crypto/phc_encoding.zig b/lib/std/crypto/phc_encoding.zig index bba03a3fff..4b6965d040 100644 --- a/lib/std/crypto/phc_encoding.zig +++ b/lib/std/crypto/phc_encoding.zig @@ -110,9 +110,9 @@ pub fn deserialize(comptime HashResult: type, str: []const u8) Error!HashResult var found = false; inline for (comptime meta.fields(HashResult)) |p| { if (mem.eql(u8, p.name, param.key)) { - switch (@typeInfo(p.field_type)) { + switch (@typeInfo(p.type)) { .Int => @field(out, p.name) = fmt.parseUnsigned( - p.field_type, + p.type, param.value, 10, ) catch return Error.InvalidEncoding, @@ -161,7 +161,7 @@ pub fn deserialize(comptime HashResult: type, str: []const u8) Error!HashResult // with default values var expected_fields: usize = 0; inline for (comptime meta.fields(HashResult)) |p| { - if (@typeInfo(p.field_type) != .Optional and p.default_value == null) { + if (@typeInfo(p.type) != .Optional and p.default_value == null) { expected_fields += 1; } } @@ -223,7 +223,7 @@ fn serializeTo(params: anytype, out: anytype) !void { { const value = @field(params, p.name); try out.writeAll(if (has_params) params_delimiter else fields_delimiter); - if (@typeInfo(p.field_type) == .Struct) { + if (@typeInfo(p.type) == .Struct) { var buf: [@TypeOf(value).max_encoded_length]u8 = undefined; try out.print("{s}{s}{s}", .{ p.name, kv_delimiter, try value.toB64(&buf) }); } else { |
