zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 3608b1d036e6b16cbea3dac59961b203e3532901 (tree)
parent faca0e4220d1cf6910f6ea7f7ea03077438c5a4d
Author: delitako <22063072+delitako@users.noreply.github.com>
Date:   Sat,  5 Nov 2022 16:55:50 -0500

Improve doc comments for two functions (#13456)

* std.heap: fix function name in doc comment

* std.mem: document return value of `replace`
Diffstat:
Mlib/std/heap.zig | 2+-
Mlib/std/mem.zig | 1+
2 files changed, 2 insertions(+), 1 deletion(-)

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