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/output.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/output.zig') diff --git a/src/output.zig b/src/output.zig index f0f1118..f91fd6b 100644 --- a/src/output.zig +++ b/src/output.zig @@ -12,11 +12,13 @@ const RenderData = struct { }; pub const Output = struct { + const Self = @This(); + server: *Server, wlr_output: *c.wlr_output, listen_frame: c.wl_listener, - pub fn init(self: *@This(), server: *Server, wlr_output: *c.wlr_output) !void { + pub fn init(self: *Self, server: *Server, wlr_output: *c.wlr_output) !void { // Some backends don't have modes. DRM+KMS does, and we need to set a mode // before we can use the output. The mode is a tuple of (width, height, // refresh rate), and each monitor supports only a specific set of modes. We -- cgit v1.2.3