diff options
Diffstat (limited to 'clap.zig')
| -rw-r--r-- | clap.zig | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -767,7 +767,7 @@ pub fn parseEx( | |||
| 767 | // fields to slices and return that. | 767 | // fields to slices and return that. |
| 768 | var result_args = Arguments(Id, params, value_parsers, .slice){}; | 768 | var result_args = Arguments(Id, params, value_parsers, .slice){}; |
| 769 | inline for (meta.fields(@TypeOf(arguments))) |field| { | 769 | inline for (meta.fields(@TypeOf(arguments))) |field| { |
| 770 | if (@typeInfo(field.type) == .Struct and | 770 | if (@typeInfo(field.type) == .@"struct" and |
| 771 | @hasDecl(field.type, "toOwnedSlice")) | 771 | @hasDecl(field.type, "toOwnedSlice")) |
| 772 | { | 772 | { |
| 773 | const slice = try @field(arguments, field.name).toOwnedSlice(allocator); | 773 | const slice = try @field(arguments, field.name).toOwnedSlice(allocator); |
| @@ -884,7 +884,7 @@ fn deinitArgs( | |||
| 884 | // If the multi value field is a struct, we know it is a list and should be deinited. | 884 | // If the multi value field is a struct, we know it is a list and should be deinited. |
| 885 | // Otherwise, it is a slice that should be freed. | 885 | // Otherwise, it is a slice that should be freed. |
| 886 | switch (@typeInfo(@TypeOf(field))) { | 886 | switch (@typeInfo(@TypeOf(field))) { |
| 887 | .Struct => @field(arguments, longest.name).deinit(allocator), | 887 | .@"struct" => @field(arguments, longest.name).deinit(allocator), |
| 888 | else => allocator.free(@field(arguments, longest.name)), | 888 | else => allocator.free(@field(arguments, longest.name)), |
| 889 | } | 889 | } |
| 890 | } | 890 | } |
| @@ -937,7 +937,7 @@ fn Arguments( | |||
| 937 | i += 1; | 937 | i += 1; |
| 938 | } | 938 | } |
| 939 | 939 | ||
| 940 | return @Type(.{ .Struct = .{ | 940 | return @Type(.{ .@"struct" = .{ |
| 941 | .layout = .auto, | 941 | .layout = .auto, |
| 942 | .fields = &fields, | 942 | .fields = &fields, |
| 943 | .decls = &.{}, | 943 | .decls = &.{}, |