╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ serve.zig ────────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯
252 }, 253 }; 254 } 255 256 fn parseListenAddress(value: []const u8) !ListenAddress { 257 const colon = std.mem.lastIndexOfScalar(u8, value, ':') orelse return error.InvalidListenAddress; 258 if (colon == 0 or colon + 1 >= value.len) return error.InvalidListenAddress; 259 const port = try std.fmt.parseInt(u16, value[colon + 1 ..], 10); 260 return .{ .host = value[0..colon], .port = port }; 261 } 262