diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-12-09 10:51:47 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-09 10:51:47 -0500 |
| commit | 640e09183d3100c477a26c6cdc26f1eae31472a1 (patch) | |
| tree | 0bddf7eb99d6daaaa2e5ee80b51a6766aefb7d9c /lib/std/buffer.zig | |
| parent | 5874cb04bd544ca155d1489bb0bdf9397fa3b41c (diff) | |
| parent | 8b3c0bbeeef080b77d0cb7999682abc52de437e3 (diff) | |
| download | zig-640e09183d3100c477a26c6cdc26f1eae31472a1.tar.gz zig-640e09183d3100c477a26c6cdc26f1eae31472a1.zip | |
Merge pull request #3873 from ziglang/format-no-var-args
std.fmt.format: tuple parameter instead of var args
Diffstat (limited to 'lib/std/buffer.zig')
| -rw-r--r-- | lib/std/buffer.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/buffer.zig b/lib/std/buffer.zig index 46c55a32b8..55a5a890d6 100644 --- a/lib/std/buffer.zig +++ b/lib/std/buffer.zig @@ -16,7 +16,7 @@ pub const Buffer = struct { mem.copy(u8, self.list.items, m); return self; } - + /// Initialize memory to size bytes of undefined values. /// Must deinitialize with deinit. pub fn initSize(allocator: *Allocator, size: usize) !Buffer { @@ -24,7 +24,7 @@ pub const Buffer = struct { try self.resize(size); return self; } - + /// Initialize with capacity to hold at least num bytes. /// Must deinitialize with deinit. pub fn initCapacity(allocator: *Allocator, num: usize) !Buffer { @@ -64,7 +64,7 @@ pub const Buffer = struct { return result; } - pub fn allocPrint(allocator: *Allocator, comptime format: []const u8, args: ...) !Buffer { + pub fn allocPrint(allocator: *Allocator, comptime format: []const u8, args: var) !Buffer { const countSize = struct { fn countSize(size: *usize, bytes: []const u8) (error{}!void) { size.* += bytes.len; @@ -107,7 +107,7 @@ pub const Buffer = struct { pub fn len(self: Buffer) usize { return self.list.len - 1; } - + pub fn capacity(self: Buffer) usize { return if (self.list.items.len > 0) self.list.items.len - 1 |
