From 46fe1baa96d8d0f80dc9d5441e2c610a873081d8 Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Tue, 24 Mar 2020 20:48:38 +0100 Subject: Use Self = @This() in all structs This seems to be the idiomatic way to do things. --- src/keyboard.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/keyboard.zig') diff --git a/src/keyboard.zig b/src/keyboard.zig index 6aab328..2b31287 100644 --- a/src/keyboard.zig +++ b/src/keyboard.zig @@ -4,6 +4,8 @@ const c = @import("c.zig").c; const Seat = @import("seat.zig").Seat; pub const Keyboard = struct { + const Self = @This(); + seat: *Seat, device: *c.wlr_input_device, wlr_keyboard: *c.wlr_keyboard, @@ -11,7 +13,7 @@ pub const Keyboard = struct { listen_modifiers: c.wl_listener, listen_key: c.wl_listener, - pub fn init(self: *@This(), seat: *Seat, device: *c.wlr_input_device) !void { + pub fn init(self: *Self, seat: *Seat, device: *c.wlr_input_device) !void { self.seat = seat; self.device = device; self.wlr_keyboard = device.unnamed_37.keyboard; -- cgit v1.2.3