From 9e2ac9c6ab567ab3d95db9527147ef80aa4dd7c1 Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Tue, 13 Nov 2018 13:33:51 +0100 Subject: Zig fmt --- clap.zig | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'clap.zig') diff --git a/clap.zig b/clap.zig index 26b97aa..a2d30a5 100644 --- a/clap.zig +++ b/clap.zig @@ -210,7 +210,7 @@ pub const OsArgIterator = struct { /// ::StreamingClap.next to parse all the arguments of your program. pub fn StreamingClap(comptime Id: type, comptime ArgError: type) type { return struct { - const Self = @This(); + const Self = @This(); const State = union(enum) { Normal, @@ -374,26 +374,3 @@ pub fn StreamingClap(comptime Id: type, comptime ArgError: type) type { } }; } - -pub fn ToStructId(comptime T: type) type { - return struct { - parse: fn(*T, ?[]const u8) - }; -} - -const ToStructParamError = error{}; -const ToStructParam = Param(fn (*T, ?[]const u8) ToStructParamError!void); - -fn paramsFromStruct(comptime T: type) []const ToStructParam { - var res: []const ToStructParam = []ToStructParam{}; - - for (@typeInfo(T).Struct.fields) |field| { - res = res ++ []ToStructParam{ - ToStructParam.init() - }; - } -} - -pub fn toStruct(defaults: var, iter: *ArgIterator(ArgError)) !@typeOf(defaults) { - -} -- cgit v1.2.3