╭ changed ─╮ │src/ui.zig│ ╰──────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │217 pub fn slice(self: *const Array(max_len)) []const u8 { │ │218 return self.bytes[0..self.len]; │ │219 } │ │220 - }; │ │221 - } │ │222 - │ │223 - pub fn url(comptime self: RoutablePage) []const u8 { │ │224 - return switch (self) { │ │225 - .home_users => "/users", │ │226 - .home_repos => "/repos", │ │227 - .home_settings => "/settings", │ │228 - .home_auth => "/auth", │ │229 - .user_repos, .user_settings, .user_auth => @compileError("user routes are dynamic; use urlAlloc"), │ │230 - .repo_files, .repo_commits, .repo_refs, .repo_settings, .repo_auth => @compileError("repo routes are dynamic; use urlAlloc"),│ │220 }; │ │221 } │ │222 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │224 return switch (self) { │ │225 .home_users => |after| if (after == 0) @as([]const u8, "/users") else try std.fmt.allocPrint(arena.allocator(), "/users?after={d}", .{after}),│ │226 .home_repos => |after| if (after == 0) @as([]const u8, "/repos") else try std.fmt.allocPrint(arena.allocator(), "/repos?after={d}", .{after}),│ │227 + .home_settings => "/settings", │ │228 + .home_auth => "/auth", │ │229 .user_repos => |u| if (u.after == 0) │ │230 try std.fmt.allocPrint(arena.allocator(), user_segment ++ "{s}/repos", .{u.name.slice()}) │ │231 else │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │246 try std.fmt.allocPrint(arena.allocator(), repo_segment ++ "{s}/refs?kind={s}&after={d}", .{ r.name.slice(), @tagName(r.kind), r.after }),│ │247 .repo_settings => |name| try std.fmt.allocPrint(arena.allocator(), repo_segment ++ "{s}/settings", .{name.slice()}), │ │248 .repo_auth => |name| try std.fmt.allocPrint(arena.allocator(), repo_segment ++ "{s}/auth", .{name.slice()}), │ │258 - inline else => |_, tag| url(tag), │ │249 }; │ │250 } │ │251 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯