aboutsummaryrefslogtreecommitdiff
path: root/exercises/070_comptime5.zig
diff options
context:
space:
mode:
authorDave Gauer <dave@ratfactor.com>2021-06-30 19:28:27 -0400
committerDave Gauer <dave@ratfactor.com>2021-06-30 19:28:27 -0400
commitf072562102966aa4e4fcac7d2e95c4ed15646105 (patch)
tree8150d7a7cb60d848a85f8874d5706a567a78c241 /exercises/070_comptime5.zig
parent14f9325408726d090efc958747e6d5d6dc937d85 (diff)
downloadziglings-f072562102966aa4e4fcac7d2e95c4ed15646105.tar.gz
ziglings-f072562102966aa4e4fcac7d2e95c4ed15646105.tar.bz2
ziglings-f072562102966aa4e4fcac7d2e95c4ed15646105.tar.xz
ziglings-f072562102966aa4e4fcac7d2e95c4ed15646105.zip
no unused method params
Diffstat (limited to 'exercises/070_comptime5.zig')
-rw-r--r--exercises/070_comptime5.zig4
1 files changed, 4 insertions, 0 deletions
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();
}
};