From 24db007cde02f756c8825d0bab0ed46c104f5430 Mon Sep 17 00:00:00 2001 From: mlugg Date: Tue, 11 Mar 2025 15:19:52 +0000 Subject: [PATCH] std.mem.Allocator.remap: fix incorrect doc comment (part 2) --- lib/std/mem/Allocator.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/std/mem/Allocator.zig b/lib/std/mem/Allocator.zig index 9bb16ae741..8ca7ed669b 100644 --- a/lib/std/mem/Allocator.zig +++ b/lib/std/mem/Allocator.zig @@ -308,7 +308,8 @@ pub fn resize(self: Allocator, allocation: anytype, new_len: usize) bool { /// In such case, it is more efficient for the caller to perform those /// operations. /// -/// `allocation` may be an empty slice, in which case `null` is always returned. +/// `allocation` may be an empty slice, in which case `null` is returned, +/// unless `new_len` is also 0, in which case `allocation` is returned. /// /// `new_len` may be zero, in which case the allocation is freed. pub fn remap(self: Allocator, allocation: anytype, new_len: usize) t: {