╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ───────────────╮ │src/ui/widget/thread.zig│ ╰────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────╮ │1455 if (std.mem.eql(u8, name, "conflicts")) return conflict_view_index; │ │1456 if (std.mem.eql(u8, name, "drafts")) return drafts_view_index; │ │1457 if (std.mem.eql(u8, name, "description")) unreachable; │ │1458 - inline for (@typeInfo(Status).@"enum".fields, 0..) |field, index| { │ │1459 - if (std.mem.eql(u8, name, field.name)) return index; │ │1458 + inline for (@typeInfo(Status).@"enum".field_names, 0..) |status_name, index| {│ │1459 + if (std.mem.eql(u8, name, status_name)) return index; │ │1460 } │ │1461 unreachable; │ │1462 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────╮ │1473 // the status a status split lists; the conflicts split has none (its│ │1474 // threads carry their own). │ │1475 fn splitStatus(index: usize) Status { │ │1476 - return @enumFromInt(index); │ │1476 + return @fromBackingInt(@intCast(index)); │ │1477 } │ │1478 │ │1479 fn entryConflicted(entry: Entry) bool { │ ╰───────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────╮ │1482 │ │1483 fn entryStatus(entry: Entry) Status { │ │1484 if (comptime has_status) return Data.statusKind(entry.record.event);│ │1485 - return @enumFromInt(0); │ │1485 + return @fromBackingInt(@intCast(0)); │ │1486 } │ │1487 │ │1488 fn entryDraft(entry: Entry) bool { │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1518 fn listLink(page_arena: *std.heap.ArenaAllocator, identity: []const u8, status: Status, label: []const u8, id: []const u8, search: []const u8) ![]const u8 {│ │1519 var route = listRoute(identity, status, label, id) orelse return error.RouteTooLong; │ │1520 if (search.len != 0) route = route.withSearch(search) orelse return error.RouteTooLong; │ │1521 - return std.fmt.allocPrint(page_arena.allocator(), "a:{s}", .{try route.toUrl(page_arena)}); │ │1521 + return page_arena.allocator().print("a:{s}", .{try route.toUrl(page_arena)}); │ │1522 } │ │1523 │ │1524 fn rowLink(page_arena: *std.heap.ArenaAllocator, data: *const Self, id: []const u8) ![]const u8 { │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1532 ui.RoutablePage.repoThreadCommentsRoute(kind, data.identity, id, data.comments_start) │ │1533 else │ │1534 ui.RoutablePage.repoThreadCommentsRoute(kind, data.identity, id, 0)) orelse return error.RouteTooLong; │ │1535 - return std.fmt.allocPrint(page_arena.allocator(), "ai:{s}", .{try route.toUrl(page_arena)}); │ │1535 + return page_arena.allocator().print("ai:{s}", .{try route.toUrl(page_arena)}); │ │1536 } │ │1537 │ │1538 fn windowLink(page_arena: *std.heap.ArenaAllocator, data: *const Self, status_maybe: ?Status, drafts: bool, id: []const u8) ![]const u8 {│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1539 if (supports_conflicts and status_maybe == null and !drafts) { │ │1540 const route = conflictsRoute(data.identity, id) orelse return error.RouteTooLong; │ │1541 - return std.fmt.allocPrint(page_arena.allocator(), "a:{s}", .{try route.toUrl(page_arena)});│ │1541 + return page_arena.allocator().print("a:{s}", .{try route.toUrl(page_arena)}); │ │1542 } │ │1543 if (drafts and id.len == 0) { │ │1544 const route = draftsRoute(data.identity) orelse return error.RouteTooLong; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1545 - return std.fmt.allocPrint(page_arena.allocator(), "a:{s}", .{try route.toUrl(page_arena)}); │ │1545 + return page_arena.allocator().print("a:{s}", .{try route.toUrl(page_arena)}); │ │1546 } │ │1547 - return listLink(page_arena, data.identity, status_maybe orelse @enumFromInt(0), data.label, id, data.search orelse ""); │ │1547 + return listLink(page_arena, data.identity, status_maybe orelse @fromBackingInt(@intCast(0)), data.label, id, data.search orelse ""); │ │1548 } │ │1549 │ │1550 fn labelLink(page_arena: *std.heap.ArenaAllocator, identity: []const u8, status: Status, label: []const u8, search: []const u8) ![]const u8 {│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1572 } │ │1573 const stack = &outer.children.values()[stack_index].widget.stack; │ │1574 │ │1575 - inline for (@typeInfo(Status).@"enum".fields) |field| { │ │1576 - var split = try initSplit(allocator, session, data, @enumFromInt(field.value), false); │ │1575 + inline for (@typeInfo(Status).@"enum".field_values) |value| { │ │1576 + var split = try initSplit(allocator, session, data, @fromBackingInt(@intCast(value)), false);│ │1577 errdefer split.deinit(allocator); │ │1578 try stack.children.put(allocator, split.getFocus().id, .{ .box = split }); │ │1579 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1586 defer items.deinit(allocator); │ │1587 // when filtered, the first item clears the filter │ │1588 if (data.label.len != 0) │ │1589 - try items.append(allocator, .{ .text = "✕", .link = try listLink(session.page_arena, data.identity, @enumFromInt(0), "", "", data.search orelse "") }); │ │1589 + try items.append(allocator, .{ .text = "✕", .link = try listLink(session.page_arena, data.identity, @fromBackingInt(@intCast(0)), "", "", data.search orelse "") }); │ │1590 for (data.labels) |label| │ │1591 - try items.append(allocator, .{ .text = label, .link = try labelLink(session.page_arena, data.identity, @enumFromInt(0), label, data.search orelse "") }); │ │1591 + try items.append(allocator, .{ .text = label, .link = try labelLink(session.page_arena, data.identity, @fromBackingInt(@intCast(0)), label, data.search orelse "") });│ │1592 try tf.setItems(allocator, items.items); │ │1593 try stack.children.put(allocator, tf.getFocus().id, .{ .word_flow = tf }); │ │1594 } │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1606 .merge => mergeRoute(data.identity, data.selected_id), │ │1607 } orelse return error.RouteTooLong; │ │1608 const page_url = try route.toUrl(session.page_arena); │ │1609 - const action = try std.fmt.allocPrint(aa, "form:{s}", .{page_url}); │ │1609 + const action = try aa.print("form:{s}", .{page_url}); │ │1610 const event_name = if (data.comment_id.len == 0) thread_name else "comment"; │ │1611 var label_buf: ["remove ".len + @max(thread_name.len, "comment".len)]u8 = undefined;│ │1612 var buttons: [2]ConfirmationButton = undefined; │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯