refactor(buffers): use explicit errorsets in undo functions

This commit is contained in:
CJ van den Berg 2025-01-26 17:20:16 +01:00
parent 4d3d91a744
commit 649d369a56
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -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{