Improve doc comments for two functions (#13456)

* std.heap: fix function name in doc comment

* std.mem: document return value of `replace`
This commit is contained in:
delitako 2022-11-05 16:55:50 -05:00 committed by GitHub
parent aea617c60b
commit c8a5ad6d9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -746,7 +746,7 @@ pub const FixedBufferAllocator = struct {
} }
/// Provides a lock free thread safe `Allocator` interface to the underlying `FixedBufferAllocator` /// 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 { pub fn threadSafeAllocator(self: *FixedBufferAllocator) Allocator {
return Allocator.init( return Allocator.init(
self, self,

View File

@ -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 /// 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. /// appropriate size. Use replacementSize to calculate an appropriate buffer size.
/// The needle must not be empty. /// 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 { 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. // Empty needle will loop until output buffer overflows.
assert(needle.len > 0); assert(needle.len > 0);