From 938b3ff7787a3e99bc41cac9add5ff25835eee22 Mon Sep 17 00:00:00 2001 From: Jimmi Holst Christensen Date: Thu, 17 Jan 2019 15:52:45 +0100 Subject: Refactored the arg iterators to new be static interface implementations * This makes arg iterators easier to understand and implement * It should also be faster than using the fieldToParent builtin --- example/comptime-clap.zig | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'example/comptime-clap.zig') diff --git a/example/comptime-clap.zig b/example/comptime-clap.zig index b275dc7..8517db8 100644 --- a/example/comptime-clap.zig +++ b/example/comptime-clap.zig @@ -27,15 +27,14 @@ pub fn main() !void { // We then initialize an argument iterator. We will use the OsIterator as it nicely // wraps iterating over arguments the most efficient way on each os. - var os_iter = clap.args.OsIterator.init(allocator); - const iter = &os_iter.iter; - defer os_iter.deinit(); + var iter = clap.args.OsIterator.init(allocator); + defer iter.deinit(); // Consume the exe arg. const exe = try iter.next(); // Finally we can parse the arguments - var args = try clap.ComptimeClap([]const u8, params).parse(allocator, clap.args.OsIterator.Error, iter); + var args = try clap.ComptimeClap([]const u8, params).parse(allocator, clap.args.OsIterator, &iter); defer args.deinit(); // clap.help is a function that can print a simple help message, given a -- cgit v1.2.3