Skip to content

Commit

Permalink
Fix const-ness of buffer in replaceContents method (#1065)
Browse files Browse the repository at this point in the history
  • Loading branch information
isaachier authored and andrewrk committed Jun 6, 2018
1 parent e7f141b commit 4fc6018
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions std/buffer.zig
Expand Up @@ -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) };
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 4fc6018

Please sign in to comment.