summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jimmi Holst Christensen2020-11-02 20:16:43 +0100
committerGravatar Jimmi Holst Christensen2020-11-02 20:16:43 +0100
commitba2530c3a743b00db37b2269b7c1f952e7cc6b35 (patch)
tree02a1a80009c8953fa35f7181bb8f8a015aeaa333
parentReport error context in Diagnostic (#26) (diff)
downloadzig-clap-ba2530c3a743b00db37b2269b7c1f952e7cc6b35.tar.gz
zig-clap-ba2530c3a743b00db37b2269b7c1f952e7cc6b35.tar.xz
zig-clap-ba2530c3a743b00db37b2269b7c1f952e7cc6b35.zip
Replace `var` with `anytype`
-rw-r--r--clap.zig2
-rw-r--r--clap/streaming.zig2
2 files changed, 2 insertions, 2 deletions
diff --git a/clap.zig b/clap.zig
index f883858..b7235f1 100644
--- a/clap.zig
+++ b/clap.zig
@@ -293,7 +293,7 @@ pub const Diagnostic = struct {
293 293
294 /// Default diagnostics reporter when all you want is English with no colors. 294 /// Default diagnostics reporter when all you want is English with no colors.
295 /// Use this as a reference for implementing your own if needed. 295 /// Use this as a reference for implementing your own if needed.
296 pub fn report(diag: Diagnostic, stream: var, err: anyerror) !void { 296 pub fn report(diag: Diagnostic, stream: anytype, err: anyerror) !void {
297 const prefix = if (diag.name.short) |_| "-" else "--"; 297 const prefix = if (diag.name.short) |_| "-" else "--";
298 const name = if (diag.name.short) |*c| @as(*const [1]u8, c)[0..] else diag.name.long.?; 298 const name = if (diag.name.short) |*c| @as(*const [1]u8, c)[0..] else diag.name.long.?;
299 299
diff --git a/clap/streaming.zig b/clap/streaming.zig
index 90c4e02..af57e8f 100644
--- a/clap/streaming.zig
+++ b/clap/streaming.zig
@@ -157,7 +157,7 @@ pub fn StreamingClap(comptime Id: type, comptime ArgIterator: type) type {
157 return err(diag, .{ .short = arg[index] }, error.InvalidArgument); 157 return err(diag, .{ .short = arg[index] }, error.InvalidArgument);
158 } 158 }
159 159
160 fn err(diag: ?*clap.Diagnostic, names: clap.Names, _err: var) @TypeOf(_err) { 160 fn err(diag: ?*clap.Diagnostic, names: clap.Names, _err: anytype) @TypeOf(_err) {
161 if (diag) |d| 161 if (diag) |d|
162 d.name = names; 162 d.name = names;
163 return _err; 163 return _err;