From 649d369a56bca2f0423035f257448a89eaf4ee1d Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Sun, 26 Jan 2025 17:20:16 +0100 Subject: [PATCH] refactor(buffers): use explicit errorsets in undo functions --- src/buffer/Buffer.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/buffer/Buffer.zig b/src/buffer/Buffer.zig index 60fd470..12e8552 100644 --- a/src/buffer/Buffer.zig +++ b/src/buffer/Buffer.zig @@ -1335,13 +1335,13 @@ pub fn update(self: *Self, root: Root) void { self.mtime = std.time.milliTimestamp(); } -pub fn store_undo(self: *Self, meta: []const u8) !void { +pub fn store_undo(self: *Self, meta: []const u8) error{OutOfMemory}!void { self.push_undo(try self.create_undo(self.root, meta)); self.curr_history = null; try self.push_redo_branch(); } -fn create_undo(self: *const Self, root: Root, meta_: []const u8) !*UndoNode { +fn create_undo(self: *const Self, root: Root, meta_: []const u8) error{OutOfMemory}!*UndoNode { const h = try self.allocator.create(UndoNode); const meta = try self.allocator.dupe(u8, meta_); h.* = UndoNode{