From ea5193a2c300a1d0daf42f7208e7b9c3de132ad4 Mon Sep 17 00:00:00 2001 From: joachimschmidt557 Date: Mon, 13 Jul 2020 20:25:42 +0200 Subject: update to latest zig var -> anytype --- clap.zig | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'clap.zig') diff --git a/clap.zig b/clap.zig index ff423cc..204494b 100644 --- a/clap.zig +++ b/clap.zig @@ -276,11 +276,11 @@ pub fn parse( /// --long helpText /// --long helpText pub fn helpFull( - stream: var, + stream: anytype, comptime Id: type, params: []const Param(Id), comptime Error: type, - context: var, + context: anytype, helpText: fn (@TypeOf(context), Param(Id)) Error![]const u8, valueText: fn (@TypeOf(context), Param(Id)) Error![]const u8, ) !void { @@ -309,11 +309,11 @@ pub fn helpFull( } fn printParam( - stream: var, + stream: anytype, comptime Id: type, param: Param(Id), comptime Error: type, - context: var, + context: anytype, valueText: fn (@TypeOf(context), Param(Id)) Error![]const u8, ) !void { if (param.names.short) |s| { @@ -337,7 +337,7 @@ fn printParam( /// A wrapper around helpFull for simple helpText and valueText functions that /// cant return an error or take a context. pub fn helpEx( - stream: var, + stream: anytype, comptime Id: type, params: []const Param(Id), helpText: fn (Param(Id)) []const u8, @@ -376,7 +376,7 @@ pub const Help = struct { }; /// A wrapper around helpEx that takes a Param(Help). -pub fn help(stream: var, params: []const Param(Help)) !void { +pub fn help(stream: anytype, params: []const Param(Help)) !void { try helpEx(stream, Help, params, getHelpSimple, getValueSimple); } @@ -443,11 +443,11 @@ test "clap.help" { /// First all none value taking parameters, which have a short name are /// printed, then non positional parameters and finally the positinal. pub fn usageFull( - stream: var, + stream: anytype, comptime Id: type, params: []const Param(Id), comptime Error: type, - context: var, + context: anytype, valueText: fn (@TypeOf(context), Param(Id)) Error![]const u8, ) !void { var cos = io.countingOutStream(stream); @@ -497,7 +497,7 @@ pub fn usageFull( /// A wrapper around usageFull for a simple valueText functions that /// cant return an error or take a context. pub fn usageEx( - stream: var, + stream: anytype, comptime Id: type, params: []const Param(Id), valueText: fn (Param(Id)) []const u8, @@ -521,7 +521,7 @@ pub fn usageEx( } /// A wrapper around usageEx that takes a Param(Help). -pub fn usage(stream: var, params: []const Param(Help)) !void { +pub fn usage(stream: anytype, params: []const Param(Help)) !void { try usageEx(stream, Help, params, getValueSimple); } -- cgit v1.2.3