Use Self = @This() in all structs

This seems to be the idiomatic way to do things.
This commit is contained in:
Isaac Freund
2020-03-24 20:48:38 +01:00
parent 45c7e27935
commit 46fe1baa96
6 changed files with 42 additions and 30 deletions

View File

@ -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