Fix const-ness of buffer in replaceContents method (#1065)

This commit is contained in:
isaachier 2018-06-06 14:09:47 -04:00 committed by Andrew Kelley
parent e7f141b376
commit 4fc601895b

View File

@ -28,7 +28,6 @@ pub const Buffer = struct {
/// Must deinitialize with deinit.
/// None of the other operations are valid until you do one of these:
/// * ::replaceContents
/// * ::replaceContentsBuffer
/// * ::resize
pub fn initNull(allocator: *Allocator) Buffer {
return Buffer{ .list = ArrayList(u8).init(allocator) };
@ -116,7 +115,7 @@ pub const Buffer = struct {
return mem.eql(u8, self.list.items[start..l], m);
}
pub fn replaceContents(self: *const Buffer, m: []const u8) !void {
pub fn replaceContents(self: *Buffer, m: []const u8) !void {
try self.resize(m.len);
mem.copy(u8, self.list.toSlice(), m);
}