Skip to content

Commit 4fc6018

Browse files
isaachierandrewrk
authored andcommittedJun 6, 2018
Fix const-ness of buffer in replaceContents method (#1065)
·
0.15.20.3.0
1 parent e7f141b commit 4fc6018

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎std/buffer.zig‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ pub const Buffer = struct {
2828
/// Must deinitialize with deinit.
2929
/// None of the other operations are valid until you do one of these:
3030
/// * ::replaceContents
31-
/// * ::replaceContentsBuffer
3231
/// * ::resize
3332
pub fn initNull(allocator: *Allocator) Buffer {
3433
return Buffer{ .list = ArrayList(u8).init(allocator) };
@@ -116,7 +115,7 @@ pub const Buffer = struct {
116115
return mem.eql(u8, self.list.items[start..l], m);
117116
}
118117

119-
pub fn replaceContents(self: *const Buffer, m: []const u8) !void {
118+
pub fn replaceContents(self: *Buffer, m: []const u8) !void {
120119
try self.resize(m.len);
121120
mem.copy(u8, self.list.toSlice(), m);
122121
}

0 commit comments

Comments
 (0)
Please sign in to comment.