commit cd10ce9a67668bfdf1fd7ba57b499d93caa3c00f (tree)
parent a794287573a84f04f675efeb3278ebc00755a57b
Author: Linus Groh <mail@linusgroh.de>
Date: Sun, 3 May 2026 21:04:49 +0100
std.fmt: Remove bufPrintZ() in favor of bufPrintSentinel()
Diffstat:
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig
@@ -13851,7 +13851,7 @@ fn netLookupFallible(
const name_c = name_buffer[0..name.len :0];
var port_buffer: [8]u8 = undefined;
- const port_c = std.fmt.bufPrintZ(&port_buffer, "{d}", .{options.port}) catch unreachable;
+ const port_c = std.fmt.bufPrintSentinel(&port_buffer, "{d}", .{options.port}, 0) catch unreachable;
const hints: posix.addrinfo = .{
.flags = .{ .CANONNAME = options.canonical_name_buffer != null, .NUMERICSERV = true },
diff --git a/lib/std/fmt.zig b/lib/std/fmt.zig
@@ -602,11 +602,6 @@ pub fn bufPrint(buf: []u8, comptime fmt: []const u8, args: anytype) BufPrintErro
return w.buffered();
}
-/// Deprecated in favor of `bufPrintSentinel`
-pub fn bufPrintZ(buf: []u8, comptime fmt: []const u8, args: anytype) BufPrintError![:0]u8 {
- return try bufPrintSentinel(buf, fmt, args, 0);
-}
-
pub fn bufPrintSentinel(
buf: []u8,
comptime fmt: []const u8,