Skip to content

Commit f8d0cbf

Browse files
committed
update std.meta.FieldType to @FieldType
1 parent 55a3367 commit f8d0cbf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/MetaModel.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub const MapKeyType = union(enum) {
9191
kind: []const u8,
9292
name: []const u8,
9393
}, allocator, source, options);
94-
const NameEnum = std.meta.FieldType(std.meta.FieldType(@This(), .base), .name);
94+
const NameEnum = @FieldType(@FieldType(@This(), "base"), "name");
9595
if (std.mem.eql(u8, result.kind, "base")) {
9696
return .{ .reference = .{ .kind = result.kind, .name = std.meta.stringToEnum(NameEnum, result.name) orelse return error.InvalidEnumTag } };
9797
} else if (std.mem.eql(u8, result.kind, "reference")) {
@@ -107,7 +107,7 @@ pub const MapKeyType = union(enum) {
107107
if (kind != .string) return error.UnexpectedToken;
108108

109109
if (std.mem.eql(u8, kind.string, "base")) {
110-
return .{ .base = try std.json.parseFromValueLeaky(std.meta.FieldType(@This(), .base), allocator, source, options) };
110+
return .{ .base = try std.json.parseFromValueLeaky(@FieldType(@This(), "base"), allocator, source, options) };
111111
} else if (std.mem.eql(u8, kind.string, "reference")) {
112112
return .{ .reference = try std.json.parseFromValueLeaky(ReferenceType, allocator, source, options) };
113113
}

src/lsp.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ pub const JsonRPCMessage = union(enum) {
304304
allocator: std.mem.Allocator,
305305
source: anytype,
306306
options: std.json.ParseOptions,
307-
) std.json.ParseError(@TypeOf(source.*))!std.meta.FieldType(@This(), field) {
307+
) std.json.ParseError(@TypeOf(source.*))!@FieldType(@This(), @tagName(field)) {
308308
return switch (field) {
309309
.jsonrpc, .method => try std.json.innerParse([]const u8, allocator, source, options),
310310
.id => try std.json.innerParse(?JsonRPCMessage.ID, allocator, source, options),
@@ -326,7 +326,7 @@ pub const JsonRPCMessage = union(enum) {
326326
allocator: std.mem.Allocator,
327327
source: std.json.Value,
328328
options: std.json.ParseOptions,
329-
) std.json.ParseFromValueError!std.meta.FieldType(@This(), field) {
329+
) std.json.ParseFromValueError!@FieldType(@This(), @tagName(field)) {
330330
return switch (field) {
331331
.jsonrpc, .method => try std.json.innerParseFromValue([]const u8, allocator, source, options),
332332
.id => try std.json.innerParseFromValue(?JsonRPCMessage.ID, allocator, source, options),

0 commit comments

Comments
 (0)