diff options
| author | Isaac Freund <ifreund@ifreund.xyz> | 2020-03-24 20:48:38 +0100 |
|---|---|---|
| committer | Isaac Freund <ifreund@ifreund.xyz> | 2020-03-24 20:48:38 +0100 |
| commit | 46fe1baa96d8d0f80dc9d5441e2c610a873081d8 (patch) | |
| tree | c3b6cc56928956efc95089c5eb74ee2a3cd845b7 /src/keyboard.zig | |
| parent | 45c7e27935497f3702f2278a6514181ef988f6fa (diff) | |
| download | river-46fe1baa96d8d0f80dc9d5441e2c610a873081d8.tar.gz river-46fe1baa96d8d0f80dc9d5441e2c610a873081d8.tar.xz | |
Use Self = @This() in all structs
This seems to be the idiomatic way to do things.
Diffstat (limited to 'src/keyboard.zig')
| -rw-r--r-- | src/keyboard.zig | 4 |
1 files changed, 3 insertions, 1 deletions
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; |
