an experimental irc client

irc: use if/else instead of switch in connect

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>

+8 -11
+8 -11
src/irc.zig
··· 648 648 } 649 649 650 650 pub fn connect(self: *Client) !void { 651 - switch (self.config.tls) { 652 - true => { 653 - self.stream = try std.net.tcpConnectToHost(self.alloc, self.config.server, 6697); 654 - self.client = try tls.client(self.stream, .{ 655 - .host = self.config.server, 656 - .root_ca = self.app.bundle, 657 - }); 658 - }, 659 - false => { 660 - self.stream = try std.net.tcpConnectToHost(self.alloc, self.config.server, 6667); 661 - }, 651 + if (self.config.tls) { 652 + self.stream = try std.net.tcpConnectToHost(self.alloc, self.config.server, 6697); 653 + self.client = try tls.client(self.stream, .{ 654 + .host = self.config.server, 655 + .root_ca = self.app.bundle, 656 + }); 657 + } else { 658 + self.stream = try std.net.tcpConnectToHost(self.alloc, self.config.server, 6667); 662 659 } 663 660 664 661 var buf: [4096]u8 = undefined;