╭ changed ──╮ │src/web.zig│ ╰───────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭──────────╮ │← previous│ ╰──────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1470 │ │1471 // a draft lives in its author's user repo │ │1472 if (try evt.readForkById(io, allocator, &author_arena, server.users_dir, &user_id, &parts.id)) |fork_record| { │ │1473 - const repo_id = evt.parseEventId(std.fs.path.basename(source.path)) catch return respondRemoveNotFound(request); │ │1473 + const repo_id = evt.parseEventId(std.Io.Dir.path.basename(source.path)) catch return respondRemoveNotFound(request); │ │1474 if (!fork_record.removed and fork_record.event.stage == .draft and std.mem.eql(u8, fork_record.event.repo_id, &repo_id)) {│ │1475 const id = std.fmt.bytesToHex(parts.id, .lower); │ │1476 try fork.remove(io, allocator, server.users_dir, &user_id, &id, author); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1477 │ │1478 - const location = try std.fmt.allocPrint(allocator, "{s}/patches/drafts", .{parts.repo_base});│ │1478 + const location = try allocator.print("{s}/patches/drafts", .{parts.repo_base}); │ │1479 defer allocator.free(location); │ │1480 try request.respond("", .{ │ │1481 .status = .see_other, │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1506 } │ │1507 │ │1508 const id = std.fmt.bytesToHex(parts.id, .lower); │ │1509 - const location = try std.fmt.allocPrint(allocator, "{s}/event:{s}/kind:{s}", .{ parts.repo_base, &id, @tagName(parts.kind) });│ │1509 + const location = try allocator.print("{s}/event:{s}/kind:{s}", .{ parts.repo_base, &id, @tagName(parts.kind) }); │ │1510 defer allocator.free(location); │ │1511 try request.respond("", .{ │ │1512 .status = .see_other, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1639 else => unreachable, │ │1640 }; │ │1641 if (!valid) { │ │1642 - const form_location = try std.fmt.allocPrint(allocator, "{s}/edit", .{base}); │ │1642 + const form_location = try allocator.print("{s}/edit", .{base}); │ │1643 defer allocator.free(form_location); │ │1644 if (!evt.titleValid(title)) { │ │1645 return respondThreadFormFailure(request, allocator, host, form_location, requiredTitleFeedback(parts.thread_kind, title, labels, description, target_branch, null));│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1661 .local => unreachable, │ │1662 }; │ │1663 if (!evt.Patch.branchValid(target_branch) or !try request_repo.source.hasBranch(io, allocator, target_branch)) { │ │1664 - const form_location = try std.fmt.allocPrint(allocator, "{s}/edit", .{base}); │ │1664 + const form_location = try allocator.print("{s}/edit", .{base}); │ │1665 defer allocator.free(form_location); │ │1666 return respondThreadFormFailure(request, allocator, host, form_location, patchFeedback(.invalid_target_branch, title, labels, description, target_branch, null));│ │1667 } │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1668 - const repo_id = evt.parseEventId(std.fs.path.basename(request_repo.source.path)) catch return respondRemoveNotFound(request); │ │1668 + const repo_id = evt.parseEventId(std.Io.Dir.path.basename(request_repo.source.path)) catch return respondRemoveNotFound(request);│ │1669 var admin_repo = try rp.Repo(.xit, evt.admin_repo_opts).open(io, allocator, .{ .path = server.admin_repo_path }); │ │1670 defer admin_repo.deinit(io, allocator); │ │1671 const id = std.fmt.bytesToHex(parts.thread_id, .lower); │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1722 else => { │ │1723 if (parts.thread_kind != .patch) return err; │ │1724 const failure = ui.Session.FormFeedback.PatchFailure.fromError(err) orelse return err; │ │1725 - const form_location = try std.fmt.allocPrint(allocator, "{s}/edit", .{base}); │ │1725 + const form_location = try allocator.print("{s}/edit", .{base}); │ │1726 defer allocator.free(form_location); │ │1727 return respondThreadFormFailure(request, allocator, host, form_location, patchFeedback(failure, title, labels, description, target_branch, null));│ │1728 }, │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────╮ │1768 var hunks: std.ArrayList([]const u8) = .empty; │ │1769 var hunk_index: usize = 0; │ │1770 while (true) : (hunk_index += 1) { │ │1771 - const name = try std.fmt.allocPrint(aa, "d{d}", .{hunk_index}); │ │1771 + const name = try aa.print("d{d}", .{hunk_index}); │ │1772 const submitted = (try parseFormField(aa, body, name)) orelse break; │ │1773 try hunks.append(aa, try std.mem.replaceOwned(u8, aa, submitted, "\r\n", "\n"));│ │1774 } │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ │1817 }, │ │1818 // invalid fields send the user back to the resolve form │ │1819 error.InvalidFields => { │ │1820 - const form_location = try std.fmt.allocPrint(allocator, "{s}/resolve", .{base});│ │1820 + const form_location = try allocator.print("{s}/resolve", .{base}); │ │1821 defer allocator.free(form_location); │ │1822 try request.respond("", .{ │ │1823 .status = .see_other, │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │1842 const target = route.repo_undo; │ │1843 var arena = std.heap.ArenaAllocator.init(allocator); │ │1844 defer arena.deinit(); │ │1845 - const repo_base = if (target.name.len == 0) "" else try std.fmt.allocPrint(arena.allocator(), "/{s}", .{target.name.slice()});│ │1845 + const repo_base = if (target.name.len == 0) "" else try arena.allocator().print("/{s}", .{target.name.slice()}); │ │1846 _ = (try authorizeWrite(io, allocator, &arena, request, host, repo_base, .owner)) orelse return; │ │1847 const resolved = (try requestRepoSource(io, allocator, host, repo_base)) orelse return respondRepoNotFound(request); │ │1848 defer resolved.deinit(allocator); │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ╭──────╮ │next →│ ╰──────╯