From 3d8fa5e33c96455c6136c7217d9324e67e2b2e27 Mon Sep 17 00:00:00 2001 From: Robby Zambito Date: Thu, 3 Apr 2025 16:07:57 -0400 Subject: Remove redundant comptime Move edge together at the end of the switch --- src/main.zig | 10 +++++----- 1 file 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 { -- cgit