summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.zig10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.zig b/src/main.zig
index 951666f..d590fa3 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -64,8 +64,8 @@ const SaprusMessage = union(SaprusPacketType) {
switch (self) {
.relay => |r| try toBytesAux(Relay.Header, r.header, r.payload, w, allocator),
- .file_transfer => return SaprusError.NotImplementedSaprusType,
.connection => |c| try toBytesAux(Connection.Header, c.header, c.payload, w, allocator),
+ .file_transfer => return SaprusError.NotImplementedSaprusType,
}
return buf.toOwnedSlice();
@@ -77,15 +77,15 @@ const SaprusMessage = union(SaprusPacketType) {
switch (@as(SaprusPacketType, @enumFromInt(try r.readInt(u16, .big)))) {
.relay => return fromBytesAux(.relay, Relay.Header, r, allocator),
- .file_transfer => return SaprusError.NotImplementedSaprusType,
.connection => return fromBytesAux(.connection, Connection.Header, r, allocator),
+ .file_transfer => return SaprusError.NotImplementedSaprusType,
else => return SaprusError.UnknownSaprusType,
}
}
};
inline fn toBytesAux(
- comptime Header: type,
+ Header: type,
header: Header,
payload: []const u8,
w: std.ArrayList(u8).Writer,
@@ -100,8 +100,8 @@ inline fn toBytesAux(
}
inline fn fromBytesAux(
- comptime packet: SaprusPacketType,
- comptime Header: type,
+ packet: SaprusPacketType,
+ Header: type,
r: StringReader,
allocator: Allocator,
) !SaprusMessage {