authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-02-01 06:27:06 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-02-01 06:27:06 -08:00
log206d51eb3e028e2f09010875727a39db81009582
treed165c85e8d970140a225cc73d5b85c8b0f434fba
parent08ce4f36d30dd3b6516215731da7b16fece72e07

FnArgsTuple was already in stdlib, remove


1 files changed, 1 insertions(+), 9 deletions(-)

src/lib.zig+1-9
...@@ -162,7 +162,7 @@ fn do(comptime Ctx: type, alloc: std.mem.Allocator, writer: anytype, comptime va...@@ -162,7 +162,7 @@ fn do(comptime Ctx: type, alloc: std.mem.Allocator, writer: anytype, comptime va
162 const func = @field(Ctx, "pek_" ++ v.name);162 const func = @field(Ctx, "pek_" ++ v.name);
163 var list = std.ArrayList(u8).init(arena.allocator());163 var list = std.ArrayList(u8).init(arena.allocator());
164 errdefer list.deinit();164 errdefer list.deinit();
165 var args: FnArgsTuple(func) = undefined;165 var args: std.meta.ArgsTuple(@TypeOf(func)) = undefined;
166 args.@"0" = alloc;166 args.@"0" = alloc;
167 args.@"1" = list.writer();167 args.@"1" = list.writer();
168 inline for (v.args) |arg, i| {168 inline for (v.args) |arg, i| {
...@@ -273,11 +273,3 @@ fn docap(comptime Ctx: type, alloc: std.mem.Allocator, writer: anytype, comptime...@@ -273,11 +273,3 @@ fn docap(comptime Ctx: type, alloc: std.mem.Allocator, writer: anytype, comptime
273 try do(Ctx, alloc, writer, bottom, data, ctx, indent, flag1);273 try do(Ctx, alloc, writer, bottom, data, ctx, indent, flag1);
274 }274 }
275}275}
276
277fn FnArgsTuple(func: anytype) type {
278 var types: []const type = &.{};
279 inline for (@typeInfo(@TypeOf(func)).Fn.args) |arg| {
280 types = types ++ &[_]type{arg.arg_type.?};
281 }
282 return std.meta.Tuple(types);
283}