From f072562102966aa4e4fcac7d2e95c4ed15646105 Mon Sep 17 00:00:00 2001 From: Dave Gauer Date: Wed, 30 Jun 2021 19:28:27 -0400 Subject: no unused method params --- exercises/070_comptime5.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'exercises') diff --git a/exercises/070_comptime5.zig b/exercises/070_comptime5.zig index 89367bd..714bf1c 100644 --- a/exercises/070_comptime5.zig +++ b/exercises/070_comptime5.zig @@ -50,12 +50,16 @@ const RubberDuck = struct { } fn quack(self: RubberDuck) void { + // Assigning an expression to '_' allows us to safely + // "use" the value while also ignoring it. + _ = self; print("\"Squeek!\" ", .{}); } fn listen(self: RubberDuck, dev_talk: []const u8) void { // Listen to developer talk about programming problem. // Silently contemplate problem. Emit helpful sound. + _ = dev_talk; self.quack(); } }; -- cgit v1.2.3-ZIG