From 547a9f23f7960de0601b3f325768d58dae3ef5ec Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Wed, 14 Nov 2018 14:55:05 +0100 Subject: Zig fmt --- src/comptime.zig | 5 ++--- src/index.zig | 5 ++--- src/streaming.zig | 2 -- 3 files changed, 4 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/comptime.zig b/src/comptime.zig index ddcd7e1..808915d 100644 --- a/src/comptime.zig +++ b/src/comptime.zig @@ -24,9 +24,8 @@ pub fn ComptimeClap(comptime Id: type, comptime params: []const clap.Param(Id)) break :blk res; }; - converted_params = converted_params ++ []clap.Param(usize){ - clap.Param(usize).init(index, param.takes_value, param.names), - }; + const converted = clap.Param(usize).init(index, param.takes_value, param.names); + converted_params = converted_params ++ []clap.Param(usize){converted}; } return struct { diff --git a/src/index.zig b/src/index.zig index 5900424..225eb9c 100644 --- a/src/index.zig +++ b/src/index.zig @@ -91,11 +91,10 @@ pub fn Param(comptime Id: type) type { return init(id, true, Names{ .short = null, .long = null }); } - fn init(id: Id, takes_value: bool, names: Names) @This() { + pub fn init(id: Id, takes_value: bool, names: Names) @This() { // Assert, that if the param have no name, then it has to take // a value. - debug.assert( - names.long != null or + debug.assert(names.long != null or names.short != null or takes_value); diff --git a/src/streaming.zig b/src/streaming.zig index 99eaecb..f33fd96 100644 --- a/src/streaming.zig +++ b/src/streaming.zig @@ -30,7 +30,6 @@ pub fn Arg(comptime Id: type) type { /// ::StreamingClap.next to parse all the arguments of your program. pub fn StreamingClap(comptime Id: type, comptime ArgError: type) type { return struct { - const State = union(enum) { Normal, Chaining: Chaining, @@ -189,7 +188,6 @@ pub fn StreamingClap(comptime Id: type, comptime ArgError: type) type { }; } - fn testNoErr(params: []const clap.Param(u8), args_strings: []const []const u8, results: []const Arg(u8)) void { var arg_iter = args.SliceIterator.init(args_strings); var c = StreamingClap(u8, args.SliceIterator.Error).init(params, &arg_iter.iter); -- cgit v1.2.3