Commit 4fc601895b

isaachier <isaachier@gmail.com>
2018-06-06 20:09:47
Fix const-ness of buffer in replaceContents method (#1065)
1 parent e7f141b
Changed files (1)
std/buffer.zig
@@ -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);
     }