authorgravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2020-10-15 12:19:50+02:00
committergravatar for mail@isaacfreund.comIsaac Freund <mail@isaacfreund.com> 2020-10-15 12:21:14+02:00
logb259696cfba3c78b0641d30f159250465aa75af8
treee25eba4c149aab71049bc5c99fecc2eb86ceb5cc
parent3b4432d9a6ae7f01f66e5ddcc15bf579d2c47460
signaturelock-open Commit is signed but in an unrecognized format.

std/fmt: rename allocPrint0() to allocPrintZ()

This is consistent with other standard library functions working with null terminated pointers/slices.

1 files changed, 4 insertions(+), 1 deletions(-)

lib/std/fmt.zig+4-1
......@@ -1151,7 +1151,10 @@ pub fn allocPrint(allocator: *mem.Allocator, comptime fmt: []const u8, args: any
11511151 };
11521152}
11531153
1154pub fn allocPrint0(allocator: *mem.Allocator, comptime fmt: []const u8, args: anytype) AllocPrintError![:0]u8 {
1154/// Deprecated, use allocPrintZ
1155pub const allocPrint0 = allocPrintZ;
1156
1157pub fn allocPrintZ(allocator: *mem.Allocator, comptime fmt: []const u8, args: anytype) AllocPrintError![:0]u8 {
11551158 const result = try allocPrint(allocator, fmt ++ "\x00", args);
11561159 return result[0 .. result.len - 1 :0];
11571160}