authorgravatar for 22063072+delitako@users.noreply.github.comdelitako <22063072+delitako@users.noreply.github.com> 2022-11-05 16:55:50-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-11-05 22:55:50+01:00
logc8a5ad6d9db529f3440bfd53b1bda8ded6a50a7c
tree71857fe074b0b91c58cb6677a77c5169012e77c6
parentaea617c60be848ed372343e08465bb0ac6cb7b85
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Improve doc comments for two functions (#13456)

* std.heap: fix function name in doc comment * std.mem: document return value of `replace`

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

lib/std/heap.zig+1-1
......@@ -746,7 +746,7 @@ pub const FixedBufferAllocator = struct {
746746 }
747747
748748 /// Provides a lock free thread safe `Allocator` interface to the underlying `FixedBufferAllocator`
749 /// *WARNING* using this at the same time as the interface returned by `getAllocator` is not thread safe
749 /// *WARNING* using this at the same time as the interface returned by `allocator` is not thread safe
750750 pub fn threadSafeAllocator(self: *FixedBufferAllocator) Allocator {
751751 return Allocator.init(
752752 self,
lib/std/mem.zig+1
......@@ -2891,6 +2891,7 @@ test "rotate" {
28912891/// Replace needle with replacement as many times as possible, writing to an output buffer which is assumed to be of
28922892/// appropriate size. Use replacementSize to calculate an appropriate buffer size.
28932893/// The needle must not be empty.
2894/// Returns the number of replacements made.
28942895pub fn replace(comptime T: type, input: []const T, needle: []const T, replacement: []const T, output: []T) usize {
28952896 // Empty needle will loop until output buffer overflows.
28962897 assert(needle.len > 0);