summaryrefslogtreecommitdiff
path: root/clap.zig
diff options
context:
space:
mode:
authorGravatar owl2024-08-30 12:33:10 +0200
committerGravatar Komari Spaghetti2024-08-30 16:46:05 +0200
commit2d9db156ae928860a9acf2f1260750d3b44a4c98 (patch)
tree56897fe054cc55491d4b41ecf8c53a55f40a9952 /clap.zig
parentcount codepoints instead of bytes, to determine width (diff)
downloadzig-clap-2d9db156ae928860a9acf2f1260750d3b44a4c98.tar.gz
zig-clap-2d9db156ae928860a9acf2f1260750d3b44a4c98.tar.xz
zig-clap-2d9db156ae928860a9acf2f1260750d3b44a4c98.zip
adapt to latest zig changes
Diffstat (limited to '')
-rw-r--r--clap.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/clap.zig b/clap.zig
index d03de72..8040852 100644
--- a/clap.zig
+++ b/clap.zig
@@ -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 = &.{},