diff options
author | 2021-06-14 01:49:53 -0700 | |
---|---|---|
committer | 2021-06-14 01:49:53 -0700 | |
commit | 122ef023dd642af830a5419b6172640ebf8af841 (patch) | |
tree | 8c5a84c20758b174742084fa0a3150490320c9b8 /src/string_mutable.zig | |
parent | c51c65325faf6692d3eebf92927f56cf35f6b613 (diff) | |
download | bun-122ef023dd642af830a5419b6172640ebf8af841.tar.gz bun-122ef023dd642af830a5419b6172640ebf8af841.tar.zst bun-122ef023dd642af830a5419b6172640ebf8af841.zip |
extremely close!!!!!
Former-commit-id: 44fce3c5e800f3fb3fbc139a38f14eae9e0c0225
Diffstat (limited to 'src/string_mutable.zig')
-rw-r--r-- | src/string_mutable.zig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/string_mutable.zig b/src/string_mutable.zig index 5dbc687e1..1b63bb9e8 100644 --- a/src/string_mutable.zig +++ b/src/string_mutable.zig @@ -23,6 +23,11 @@ pub const MutableString = struct { try self.list.ensureUnusedCapacity(self.allocator, amount); } + pub fn write(self: *MutableString, bytes: anytype) !usize { + try self.list.appendSlice(self.allocator, bytes); + return bytes.len; + } + pub fn writeAll(self: *MutableString, bytes: string) !usize { try self.list.appendSlice(self.allocator, bytes); return self.list.items.len; |