aboutsummaryrefslogtreecommitdiff
path: root/src/string_mutable.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-06-29 01:34:38 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-06-29 01:34:38 -0700
commitece2a3ccfd34f9d3c0bb5d8ac8b85a1dec9568f9 (patch)
tree7ba6ab6121f8ced5ca164f5b365925aa7bffd6f9 /src/string_mutable.zig
parent70126c074f8d29a5c1767e0830907e736a30febe (diff)
downloadbun-ece2a3ccfd34f9d3c0bb5d8ac8b85a1dec9568f9.tar.gz
bun-ece2a3ccfd34f9d3c0bb5d8ac8b85a1dec9568f9.tar.zst
bun-ece2a3ccfd34f9d3c0bb5d8ac8b85a1dec9568f9.zip
alright now it crashes
Former-commit-id: 26745bb5f300481fc242c8e81de6f252f698c863
Diffstat (limited to 'src/string_mutable.zig')
-rw-r--r--src/string_mutable.zig4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/string_mutable.zig b/src/string_mutable.zig
index 249ab7394..755465b55 100644
--- a/src/string_mutable.zig
+++ b/src/string_mutable.zig
@@ -132,6 +132,10 @@ pub const MutableString = struct {
self.list.shrinkRetainingCapacity(0);
}
+ pub fn inflate(self: *MutableString, amount: usize) !void {
+ try self.list.resize(self.allocator, amount);
+ }
+
pub inline fn appendChar(self: *MutableString, char: u8) !void {
try self.list.append(self.allocator, char);
}