From 25ddbaea75ec88b409057546b79bd95526790964 Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Thu, 5 Sep 2019 23:51:59 +0200 Subject: use emun literals --- src/streaming.zig | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/streaming.zig') diff --git a/src/streaming.zig b/src/streaming.zig index 884a270..b5c3498 100644 --- a/src/streaming.zig +++ b/src/streaming.zig @@ -51,7 +51,7 @@ pub fn StreamingClap(comptime Id: type, comptime ArgIterator: type) type { }; switch (parser.state) { - State.Normal => { + .Normal => { const full_arg = (try parser.iter.next()) orelse return null; const arg_info = if (mem.eql(u8, full_arg, "--") or mem.eql(u8, full_arg, "-")) ArgInfo{ .arg = full_arg, .kind = .Positional } @@ -112,7 +112,7 @@ pub fn StreamingClap(comptime Id: type, comptime ArgIterator: type) type { return error.InvalidArgument; }, - @TagType(State).Chaining => |state| return try parser.chainging(state), + .Chaining => |state| return try parser.chainging(state), } } @@ -177,9 +177,8 @@ fn testNoErr(params: []const clap.Param(u8), args_strings: []const []const u8, r testing.expectEqualSlices(u8, expected_value, actual_value); } - if (c.next() catch @panic("")) |_| { - @panic(""); - } + if (c.next() catch unreachable) |_| + unreachable; } test "clap.streaming.StreamingClap: short params" { -- cgit v1.2.3