diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.zig | 8 | 
1 files changed, 3 insertions, 5 deletions
diff --git a/src/main.zig b/src/main.zig index fcda038..fd77d30 100644 --- a/src/main.zig +++ b/src/main.zig @@ -40,14 +40,12 @@ const SaprusMessage = union(SaprusPacketType) {      file_transfer: void, // unimplemented      connection: Connection, -    const Self = @This(); - -    fn toBytes(s: Self, allocator: Allocator) ![]u8 { +    fn toBytes(self: SaprusMessage, allocator: Allocator) ![]u8 {          var buf = std.ArrayList(u8).init(allocator);          const w = buf.writer(); -        try w.writeInt(u16, @intFromEnum(@as(SaprusPacketType, s)), .big); +        try w.writeInt(u16, @intFromEnum(self), .big); -        switch (s) { +        switch (self) {              .relay => |r| {                  try w.writeStructEndian(r.header, .big);                  try w.writeInt(u16, @intCast(r.payload.len), .big);  | 
