╭──────────╮ │← previous│ ╰──────────╯ ╭ changed ────────────╮ │src/ui/Repo/Files.zig│ ╰─────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1012 // following it navigates to that directory's listing. │ │1013 fn dirLink(page_arena: *std.heap.ArenaAllocator, data: *const Self, path: []const u8) ![]const u8 {│ │1014 const route = data.filesRoute(path, 0) orelse return error.RouteTooLong; │ │1015 - return std.fmt.allocPrint(page_arena.allocator(), "a:{s}", .{try route.toUrl(page_arena)}); │ │1015 + return page_arena.allocator().print("a:{s}", .{try route.toUrl(page_arena)}); │ │1016 } │ │1017 │ │1018 // a link to the file's route. a preloaded file gets an "ai:" link │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1022 fn fileLink(page_arena: *std.heap.ArenaAllocator, data: *const Self, path: []const u8, loaded: bool, line: usize) ![]const u8 {│ │1023 const route = data.filesRoute(path, line) orelse return error.RouteTooLong; │ │1024 const prefix = if (loaded) "ai:" else "a:"; │ │1025 - return std.fmt.allocPrint(page_arena.allocator(), "{s}{s}", .{ prefix, try route.toUrl(page_arena) }); │ │1025 + return page_arena.allocator().print("{s}{s}", .{ prefix, try route.toUrl(page_arena) }); │ │1026 } │ │1027 │ │1028 // the url `line` value for a content window: its first line's 1-based number, │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ │1033 │ │1034 // `dir`/`name`, or just `name` at the root. │ │1035 pub fn childDir(arena: std.mem.Allocator, dir: []const u8, name: []const u8) ![]const u8 { │ │1036 - return if (dir.len == 0) name else std.fmt.allocPrint(arena, "{s}/{s}", .{ dir, name });│ │1036 + return if (dir.len == 0) name else arena.print("{s}/{s}", .{ dir, name }); │ │1037 } │ │1038 │ │1039 // `dir` with its last segment removed ("" when `dir` has a single segment). │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────╮ │1050 // the row's border and the label's padding take two columns each │ │1051 const max_width = View.list_max_width - 4; │ │1052 var width = try xitui.width.displayWidth(dir); │ │1053 - if (width <= max_width) return std.fmt.allocPrint(aa, " {s} ", .{dir});│ │1053 + if (width <= max_width) return aa.print(" {s} ", .{dir}); │ │1054 │ │1055 const ellipsis = ".."; │ │1056 var iter = (try std.unicode.Utf8View.init(dir)).iterator(); │ ╰─────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────╮ │1060 width -= xitui.width.cellWidth(try std.unicode.utf8Decode(slice)); │ │1061 start += slice.len; │ │1062 } │ │1063 - return std.fmt.allocPrint(aa, " " ++ ellipsis ++ "{s} ", .{dir[start..]});│ │1063 + return aa.print(" " ++ ellipsis ++ "{s} ", .{dir[start..]}); │ │1064 } │ │1065 │ ╰────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Header.zig│ ╰──────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │81 const bottom_label = try ui.clippedBottomLabel(try aa.alloc(u8, ui.clipped_bottom_label_max_len), ref_name); │ │82 const changes_label = switch (page.changes) { │ │83 .diff => diff_tab_label, │ │84 - .commits => |c| if (c.commit_count) |count| try std.fmt.allocPrint(aa, commits_tab_label ++ " ({d})", .{count}) else commits_tab_label,│ │84 + .commits => |c| if (c.commit_count) |count| try aa.print(commits_tab_label ++ " ({d})", .{count}) else commits_tab_label, │ │85 }; │ │86 const changes_label_width = try xitui.width.displayWidth(changes_label); │ │87 var first_group_width = try data.title.width(); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │92 if (session.data.host_kind == .server) { │ │93 var text_buf: [evt.User.name_max_len + 1]u8 = undefined; │ │94 const text = try std.fmt.bufPrint(&text_buf, "{s}/", .{data.owner_name}); │ │95 - const link = try std.fmt.allocPrint(aa, "a:/{s}", .{data.owner_name}); │ │95 + const link = try aa.print("a:/{s}", .{data.owner_name}); │ │96 │ │97 var text_box = try wgt.TextBox.init(allocator, text, .{ .border_style = .hidden, .wrap_kind = .none });│ │98 errdefer text_box.deinit(allocator); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │107 } │ │108 │ │109 // local routes carry no identity, so their urls come out elided │ │110 - const identity = if (session.data.host_kind == .local) "" else try std.fmt.allocPrint(aa, "{s}:{s}", .{ data.owner_name, data.name });│ │110 + const identity = if (session.data.host_kind == .local) "" else try aa.print("{s}:{s}", .{ data.owner_name, data.name }); │ │111 │ │112 // title links to the repo's files root (the bare route, so it resolves │ │113 // to the default branch). │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │114 { │ │115 const files_root_route = ui.RoutablePage.repoFilesRoute(identity, null, "", "", 0) orelse return error.RouteTooLong;│ │116 - const title_link = try std.fmt.allocPrint(aa, "a:{s}", .{try files_root_route.toUrl(session.page_arena)}); │ │116 + const title_link = try aa.print("a:{s}", .{try files_root_route.toUrl(session.page_arena)}); │ │117 var title_view = try ui.Title.View.init(allocator, &data.title); │ │118 errdefer title_view.deinit(allocator); │ │119 title_view.getFocus().mode = .all; │ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭ changed ─────────────╮ │src/ui/Repo/Issues.zig│ ╰──────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │398 const labels_link = try ui.inPageTabLink(session, labels_route, page_selected and selected_index == View.viewIndex(.labels));│ │399 const label = if (data.label.len == 0) labels_tab_label else blk: { │ │400 const decoded = std.Uri.percentDecodeInPlace(try aa.dupe(u8, data.label)); │ │401 - break :blk try std.fmt.allocPrint(aa, labels_tab_label ++ " ({s})", .{decoded}); │ │401 + break :blk try aa.print(labels_tab_label ++ " ({s})", .{decoded}); │ │402 }; │ │403 try header.addTab(allocator, label, labels_link, View.viewIndex(.labels)); │ │404 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯