summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobby Zambito <contact@robbyzambito.me>2025-04-03 10:54:04 -0400
committerRobby Zambito <contact@robbyzambito.me>2025-04-03 11:02:55 -0400
commit0d8155f0af3e67bba08ccbed4b254909721a6aa3 (patch)
tree8ae78df40ebee3f6f53e7b75c09b6c6b4ed39ea3
parent50859a22dcd017fdbda9947ef74a40dd5352c585 (diff)
Remove unnecessary explicit cast
Remove unnecessary Self declaration.
-rw-r--r--src/main.zig8
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);